(self)
Run the simulation until the end, processing each event in the queue one-at-a-time in priority order
Run the simulation until the end, processing each event in the queue one-at-a-time in priority order
Run the simulation until the end processing each event in the queue one - at - a - time in priority order
def run(self):
        """ Run the simulation until the end, processing each event in the queue one-at-a-time in priority order """
        print(f"Starting simulation from {self.start_time} to {self.end_time}")

        with self.metadata:
            while self.event_queue:
                evt = heappop(self.event_queue)
                self.current_time = evt.time
                logger.event(evt)
                evt.handle(self)

        # charge any instances that haven't been terminated yet
        for cluster in self.aws_clusters:
            for instance in cluster.instances.values():
                instance.end_time = self.current_time
                self._compute_instance_cost(instance)

        print(
            "Simulation complete ({time}s)".format(
                time=(self.metadata.sim_end - self.metadata.sim_start).total_seconds()
            )
        )
def run ( self ) : print ( f"Starting simulation from {self.start_time} to {self.end_time}" ) with self . metadata : while self . event_queue : evt = heappop ( self . event_queue ) self . current_time = evt . time logger . event ( evt ) evt . handle ( self ) # charge any instances that haven't been terminated yet for cluster in self . aws_clusters : for instance in cluster . instances . values ( ) : instance . end_time = self . current_time self . _compute_instance_cost ( instance ) print ( "Simulation complete ({time}s)" . format ( time = ( self . metadata . sim_end - self . metadata . sim_start ) . total_seconds ( ) ) )