SelectOutput5


This object routes the incoming agents to one of the five output ports depending on (probabilistic or deterministic) conditions. 

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

The agents spend zero time in SelectOutput5.

This block be used to sort agents according to a certain criteria, to randomly split the agent flow, etc. 

Sometimes it is needed to have more than five outputs. Using SelectOutputIn and SelectOutputOut blocks you can create one large quasi-block SelectOutput with the required number of exits. 

Parameters

Use
Defines whether agents will be routed depending on the specified Conditions, randomly according to specified Probabilities, or the specified expression will be evaluated to get the number of the output port the agent should take to leave the block.
Get value: type
Set new value dynamically: set_type(new value)
Valid values: Probabilities - SelectOutput5.TYPE_PROBABILITIES
           
Conditions - SelectOutput5.TYPE_CONDITIONS
           Exit number - SelectOutput5.TYPE_EXIT_NUMBERS
Probability 1 .. 5 [dynamic]
[Visible when Use is set to Probabilities] Expression used to evaluate the probability that the current agent will exit via out0 .. out4 ports. The probability value should lie in the [0..1] range.
Value type: double
Local variable: agent - the agent.
Default value: 0.2 - does not depend on the agent and simply splits the agent flow into five equal parts.
Condition 1 .. 4 [dynamic]
[Visible when Use is set to Conditions] Condition evaluated for an incoming agent. If Condition N evaluates to true, the agent exits via outN port, otherwise the next condition (Condition N+1) is checked. If all conditions are false, the agent exits via the last (default exit). The condition may depend on the agent as well as on any external factors.
Value type:  boolean
Local variable: agent - the agent.
Exit number [1 .. 5] [dynamic]
[Visible when Use is set to Exit number] Expression used to evaluate 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: agent - the agent.
Default value: uniform_discr( 1, 5 ) - does not depend on the agent and simply splits the agent flow into five equal parts.
Actions
In all these actions the current agent is available as local variable agent.
On enter [code]
Code executed when the agent enters the object.
On exit 1, 2, .. , 5 [code]
Code executed when the agent exits the object via out1, out2, ... port.

Ports

in
The input port.
out1, out2, out3, out4, out5
The output ports.