jupedsim.journey
#
Module Contents#
- class Transition(backing)[source]#
Describes the Transition at a stage.
This type describes how a agent will proceed after completing its stage. This effectively describes the set of outbound edges for a stage.
There are 3 types of transitions currently available:
Fixed transitions: On completion of this transitions stage all agents will proceed to the specified next stage.
Round robin transitions: On completion of this transitions stage agents will proceed in a weighted round-robin manner. A round-robin transitions with 3 outgoing stages and the weights 5, 7, 11 the first 5 agents to make a choice will take the first stage, the next 7 the second stage and the next 11 the third stage. Next 5 will take the first stage, and so on…
Least targeted transition: On completion of this stage agents will proceed towards the currently least targeted amongst the specified choices. The number of “targeting” agents is the amount of agents currently moving towards this stage. This includes agents from different journeys.
- static create_fixed_transition(stage_id: int) Transition [source]#
Create a fixed transition.
On completion of this transitions stage all agents will proceed to the specified next stage.
- Parameters:
stage_id (int) – id of the stage to move to next.
- Return type:
- static create_round_robin_transition(stage_weights: list[tuple[int, int]]) Transition [source]#
Create a round-robin transition.
Round-robin transitions: On completion of this transitions stage agents will proceed in a weighted round-robin manner. A round-robin transitions with 3 outgoing stages and the weights 5, 7, 11 the first 5 agents to make a choice will take the first stage, the next 7 the second stage and the next 11 the third stage. Next 5 will take the first stage, and so on…
- static create_least_targeted_transition(stage_ids: list[int]) Transition [source]#
Create a least targeted transition.
On completion of this stage agents will proceed towards the currently least targeted amongst the specified choices. The number of “targeting” agents is the amount of agents currently moving towards this stage. This includes agents from different journeys.
- class JourneyDescription(stage_ids: list[int] | None = None)[source]#
Used to describe a journey for construction by the
Simulation
.A Journey describes the desired stations an agent should take when moving through the simulation space. A journey is described by a graph of stages (nodes) and transitions (edges). See
Transition
for an overview of the possible transitions.Create a Journey Description.
- set_transition_for_stage(stage_id: int, transition: Transition) None [source]#
Set a new transition for the specified stage.
Any prior set transition for this stage will be removed.
- Parameters:
stage_id (int) – id of the stage to set the transition for.
transition (Transition) – transition to set
- Return type:
None