RestrictedAreaStart


Marks the entry to the section (area) of the process where you wish to limit the maximum number of agents. Such area can only have one entry and arbitrary number of exits, each of those must be marked with object referring to this RestrictedAreaStart, see the picture below. Once the number of times RestrictedAreaStart has been entered minus the number of times RestrictedAreaEnd has been exited reaches the limit, the RestrictedAreaStart object blocks the entry and would not allow a new agent in until one of the agents exits the area.

The RestrictedAreaStart object is implemented using Hold object, so the agent is just passed to the next object and does not spend any time in RestrictedAreaStart.

Please note that if you occasionally allow agents to leave the area not through a RestrictedAreaEnd object (e.g. by programmatically removing them from the flow), the RestrictedAreaStart would not notice that and would count those agents as still being inside, which may result in the area entry blocked forever.

Parameters

Capacity (max allowed)
The maximum number of agents allowed in the restricted area.
Syntax: int capacity
Default value: 10
Actions
On enter [code]
Code executed when the agent enters the object.
Local variable: agent - the agent

Functions

int entitiesInside() - Returns the number of agents currently in the restricted area.

boolean isBlocked()- Returns true if the entry to the area is blocked, otherwise false.

Embedded block

Hold hold
The embedded object that used to block the entry to the restricted area depending on the number of agents there.

Ports

in
The input port.
out
The output port.