SelectOutput


Routes the incoming agents to one of the two output ports depending on (probabilistic or deterministic) condition. The condition may depend on the agent as well as on any external factors. The agents spend zero time in SelectOutput.

May be used to sort agents according to a certain criteria, to randomly split the agent flow, etc. For example, suppose the agents are of type Customer that has a boolean field vip. Then if you wish VIP customers to exit via the upper (True) output and all others - via lower (False) port, you should specify the condition agent.vip and set Customer as a generic parameter of SelectOutput. A more sophisticated case: you wish only 80% of VIP customers to exit via upper port and 20% (and all others) - via lower port. Then the condition will look like agent.vip && randomTrue( 0.8 ).

Sometimes it is needed to have more than two outputs. We provide you with two blocks for routing agents to different flowchart branches: SelectOutput and SelectOutput5SelectOutput5 has five output ports, so it may route agents to up to five exits. Using SelectOutputIn and SelectOutputOut blocks you can create one large quasi-block SelectOutput with the required number of exits. 

Parameters

Select True output
Defines whether agents will be routed depending on the specified boolean condition (If condition is true) or randomly With specified probability [0..1].
Syntax: boolean conditionIsProbabilistic
Probability [dynamic]
[Visible when Select True output is set to With specified probability] Expression used to evaluate the probability that the current agent will exit the upper port. The probability value should lie in the [0..1] range.
Value type: double
Local variable: agent - the agent
Default value: 0.5 - simply splits the agent flow into two equal parts.
Condition [dynamic]
[Visible when Select True output is set to If condition is true] Condition evaluated for an incoming agent. If it evaluates to true, the agent exits via the upper port, otherwise via the lower port.
Value type: boolean
Local variable: agent - the agent
Default value: randomTrue( 0.5 ) - does not depend on the agent and simply splits the agent flow into two equal parts.
Actions
In all these actions the current agent is available as the local variable agent.
On enter [code]
Code executed when the agent enters the object.
On exit (true) [code]
Code executed when the agent exits the object via the upper outT port.
On exit (false) [code]
Code executed when the agent exits the object via the lower outF port.

Ports

in
The input port.
outT
The upper output port (for the agents, for which the Select condition returned true).
outF
The lower output port (for the agents, for which the Select condition returned false).