jupedsim.stages#

Module Contents#

class NotifiableQueueStage(backing)[source]#

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 Simulation

count_targeting() int[source]#
Returns:

Number of agents currently targeting this stage.

Return type:

int

count_enqueued() int[source]#
Returns:

Number of agents currently enqueued at this stage.

Return type:

int

pop(count) None[source]#

Pop count number of agents from the front of the queue.

Parameters:

count – Number of agents to be popped from the front of the queue

Return type:

None

enqueued() list[int][source]#

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.

Return type:

list[int]

class WaitingSetState(*args, **kwds)[source]#

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

ACTIVE[source]#
INACTIVE[source]#
class WaitingSetStage(backing)[source]#

Models a set of waiting positions that can be activated or deactivated.

Similar as with a NotifiableQueueStage there needs to be a set of waiting positions defined which will be filled in order of definition. The 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 WaitingSetStage acts as a simple waypoint at the position of the first defined waiting position.

property state: WaitingSetState[source]#

State of the set.

Can be active or inactive, see WaitingSetState

Return type:

WaitingSetState

count_targeting() int[source]#
Returns:

Number of agents currently targeting this stage.

Return type:

int

count_waiting() int[source]#
Returns:

Number of agents currently waiting at this stage.

Return type:

int

waiting() list[int][source]#

Access the ids of all waiting agents in order they are waiting.

Returns:

list of waiting agents ordered by their position.

Return type:

list[int]

class WaypointStage(backing)[source]#

Models a waypoint.

A waypoint is considered to be reached if an agent is within the specified distance to the waypoint.

count_targeting() int[source]#

Returns: Number of agents currently targeting this stage.

Return type:

int

class ExitStage(backing)[source]#

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.

count_targeting()[source]#
Returns:

Number of agents currently targeting this stage.