You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should be done after some of the other wirings are first complete, but eventually we need a controller wiring that does the routing of an event to the wiring that it should take on. When we get here I can help out a bunch because there are a LOT of design considerations to work through first
Add the following text to the wiring or control action (from the notebook):
The simulation is event-driven, handling various events such as ride requests, driver assignments, and ride completions.
An event queue manages the sequence and timing of events, ensuring that the system evolves over time.
Scaffold the wiring and write issues for all the actions that might need to come after
The text was updated successfully, but these errors were encountered:
while event_queue or retry_queue:
while event_queue and event_queue[0].t == current_time:
current_event = heapq.heappop(event_queue)
handle_event(current_event, event_queue, simulation, retry_queue, current_time)
while retry_queue and retry_queue[0].t <= current_time:
current_event = retry_queue.popleft()
handle_event(current_event, event_queue, simulation, retry_queue, current_time)
# Record the state at each time step
simulation.record_state(current_time)
print("State recorded")
current_time += 1
simulation.grid.update_priorities()
print(f"The event queue is now empty. Simulation complete! Time: {current_time}")
simulation.state_map.print_state_map()
def handle_event(event, event_queue, simulation, retry_queue, current_time):
print(f"Processing event: {event} at time {current_time}")
This should be done after some of the other wirings are first complete, but eventually we need a controller wiring that does the routing of an event to the wiring that it should take on. When we get here I can help out a bunch because there are a LOT of design considerations to work through first
The text was updated successfully, but these errors were encountered: