AnyLogic
Expand
Font size

PedSelectOutput

Routes the incoming pedestrians to one of several (up to five) processes depending on specified ratios or conditions. Each process has to be defined with a flowchart connected to one of the block’s output ports.

The block works in three modes: Probabilities, Conditions, or Exit number.

  • In the Probabilities mode, you provide 5 probabilities for five exits (if their sum does not equal 1, they are normalized). The exit the pedestrian takes is defined randomly according to the specified probabilities. For example, if, Probability 1 is 5, Probability 2 is 1, and Probability 3 is 4, pedestrians will use the out1, out2, and out3 ports with average probabilities of 0.5, 0.1, and 0.4.
  • In the Conditions mode, you provide 4 conditions. When a pedestrian arrives, the conditions are evaluated sequentially one by one. If condition 1 is true, the pedestrian leaves the block through the out1 port, otherwise, condition 2 is evaluated, and so on. If all conditions are false, the pedestrian exits via the out5 port — the default exit. The result of the condition’s evaluation may depend on the properties and attributes of the pedestrian — as well as on other external factors.
  • In the Exit number mode, you provide an expression that returns integer numbers in the [1..5] range. When the pedestrian enters the block, the expression is evaluated, and the resulting number determines the number of the output port the pedestrian should use to leave this block. The result of the condition’s evaluation may depend on the properties and attributes of the pedestrian — as well as on other external factors.

Pedestrians spend zero time in the PedSelectOutput block.

Use this block to sort pedestrians according to certain criteria, randomly split the pedestrian flow, and so on.

In the Probabilities and Conditions modes, it is not necessary to define all five chance ratios or all four conditions. If you want to route pedestrians to only one of two ports, you will only need to define two corresponding parameters.

Parameters

Use
Defines whether pedestrians will be routed randomly according to specified Probabilities, depending on the specified Conditions, or the specified expression will be evaluated to get the number of the output port the pedestrian will use to leave the block.
Syntax: boolean useConditions
Get value: type
Set new value dynamically:set_type(new value)
Valid values:
PedSelectOutput.TYPE_PROBABILITIES — for the Probabilities mode
PedSelectOutput.TYPE_CONDITIONS — for the Conditions mode
PedSelectOutput.TYPE_EXIT_NUMBERS — for the Exit number mode
Probability 1, 2, … 5
[Visible if Use: Probabilities]
Ratio of pedestrian flow that exits the block via the port out1, out2, ….
Value type: double
Local variable: ped — the pedestrian
Condition 1, 2, … 5
[Visible if Use: Conditions]
Condition that checks whether the pedestrian should leave this block via the out1, out2, ... port. If Condition 1 is true, the pedestrian leaves the block via out1, if not, Condition 2 is checked. If Condition 2 is true, the pedestrian leaves the block via out2, if not, the next condition is checked, and so on. If no conditions are met, the pedestrian leaves the block via the last out5 port.
Value type: boolean
Local variable: ped — the pedestrian
Exit number [1 .. 5]
[Visible if Use: Exit number]
Expression evaluating the index of the output port that the agent should take to leave this block. The expression may depend on the agent as well as on any external factors. The result should lie in the [1..5] range.
Value type: int
Local variable: ped — the pedestrian
Default value: uniform_discr( 1, 5 ) — does not depend on the pedestrian; simply splits the pedestrian flow into five equal parts.

Actions

On enter
Code executed when the pedestrian enters the block.
Local variable: ped — the pedestrian
On exit 1, 2, …
Code executed when the pedestrian exits the block via port out1, out2, ….
Local variable: ped — the pedestrian

Ports

in

The input port.

out1, out2, out3, out4, out5

Output ports.

How can we improve this article?