[docs]classNotifiableQueueStage:"""Models a queue where agents can wait until notified. The queues waiting positions are predefined and agents will wait on the first empty position. When agents leave the queue the remaining waiting agents move up. If there are more agents trying to enqueue than there are waiting positions defined the overflow agents will wait at the last waiting position in the queue. .. note:: This type is used to interact with an already created stage. To create a stage of this type see :class:`~jupedsim.simulation.Simulation` """def__init__(self,backing):self._obj=backing
[docs]defcount_targeting(self)->int:""" Returns: Number of agents currently targeting this stage. """returnself._obj.count_targeting()
[docs]defcount_enqueued(self)->int:""" Returns: Number of agents currently enqueued at this stage. """returnself._obj.count_enqueued()
[docs]defpop(self,count)->None:"""Pop `count` number of agents from the front of the queue. Arguments: count: Number of agents to be popped from the front of the queue """returnself._obj.pop(count)
[docs]defenqueued(self)->list[int]:"""Access the ids of all enqueued agents in order they are waiting at the queue. Returns: list of enqueued agents ordered by their position in the queue. """returnself._obj.enqueued()
[docs]classWaitingSetStage:"""Models a set of waiting positions that can be activated or deactivated. Similar as with a :class:`NotifiableQueueStage` there needs to be a set of waiting positions defined which will be filled in order of definition. The :class:`WaitingSetStage` now can be active or inactive. If active agents will fill waiting positions until all are occupied. Additional agents will all try to wait at the last defined waiting position. In inactive state the :class:`WaitingSetStage` acts as a simple waypoint at the position of the first defined waiting position. """def__init__(self,backing)->None:self._obj=backing
[docs]defcount_targeting(self)->int:""" Returns: Number of agents currently targeting this stage. """returnself._obj.count_targeting()
[docs]defcount_waiting(self)->int:""" Returns: Number of agents currently waiting at this stage. """returnself._obj.count_waiting()
[docs]defwaiting(self)->list[int]:"""Access the ids of all waiting agents in order they are waiting. Returns: list of waiting agents ordered by their position. """returnself._obj.waiting()
@property
[docs]defstate(self)->WaitingSetState:"""State of the set. Can be active or inactive, see :class:`WaitingSetState` """returnWaitingSetState(self._obj.state)
[docs]classWaypointStage:"""Models a waypoint. A waypoint is considered to be reached if an agent is within the specified distance to the waypoint. """def__init__(self,backing)->None:self._obj=backing
[docs]defcount_targeting(self)->int:"""Returns: Number of agents currently targeting this stage. """returnself._obj.count_targeting()
[docs]classExitStage:"""Models an exit. Agents entering the polygon defining the exit will be removed at the beginning of the next iteration, i.e. agents will be inside the specified polygon for one frame. """def__init__(self,backing):self._obj=backing
[docs]defcount_targeting(self):""" Returns: Number of agents currently targeting this stage. """returnself._obj.count_targeting()