:py:mod:`kosmos.dqc_scheduling.event_queue` =========================================== .. py:module:: kosmos.dqc_scheduling.event_queue Classes ------- .. py:class:: EventQueue Event queue for scheduling protocols within the simulation. .. attribute:: queue Priority queue of events ready to execute, ordered by time. :type: list[Event] .. attribute:: current_time Global clock for simulation. :type: int .. attribute:: waiting_events Events waiting for their dependencies to be satisfied before being added to the execution queue. :type: dict[EventId, Event] .. attribute:: event_results Results from the executed protocols. :type: dict[EventId, ProtocolResult] Initialize the event queue. | .. rubric:: Methods .. py:method:: add_event_with_dependencies(protocol: kosmos.protocols.protocol.Protocol, delay: int = 0, dependencies: list[kosmos.dqc_scheduling.event.EventId] | None = None, event_id: kosmos.dqc_scheduling.event.EventId | None = None) -> kosmos.dqc_scheduling.event.EventId | None Add an event with dependencies to the system. :param protocol: Protocol to execute. :type protocol: Protocol :param delay: Time delay from current time. Defaults to 0. :type delay: int :param dependencies: List of event IDs this event depends on. Defaults to None. :type dependencies: list[str] | None :param event_id: Optional explicit ID for this event. Defaults to None. :type event_id: EventId | None :returns: ID of the added event. :rtype: EventId or None .. py:method:: run() -> None Run all events in the queue until it's empty.