Enter


Inserts the (already existing) agents into a particular point of the process model.

This block is typically used either to transfer the agents created by e.g. a statechart, an event, etc. to the process flow, or, in pair with the Exit object - to implement custom routing in the process model. To insert the agent via this object you call its take( agent ) function.

How-To video: Using agents in a process flow

Parameters

Agent type [dynamic]
The type of the agents entering the flowchart via this block.
Default value: Agent
New location
Defines the new location for the agents entering the flowchart via this block. There are six alternative options:
Not specified - You do not specify the new location for the agents, they stay where they are currently.
Network / GIS node - Agents are placed in the given network nodeGIS point, or GIS region.
Attractor - Agents are placed in the specified attractor.
(x, y, z) - Agents are placed in the point with the specified coordinates X, Y, Z.
(latitude, longitude) - Agents are placed in the given point on the GIS map with the specified Latitude and Longitude.
Geographic place - Agents are placed in the particular location on the GIS map. You define this place using the Name of place parameter below.
Get value: locationType
Valid values: Enter.LOCATION_NOT_SPECIFIED, Enter.LOCATION_NODE, Enter.LOCATION_ATTRACTOR, Enter.LOCATION_XYZ, Enter.LOCATION_LATLON, Enter.LOCATION_GEO_PLACE
Speed [dynamic]
[Visible if New location is specified] The speed of the agents that are entering the flowchart via this block.
Value type: double
Default value: 10 m/s
Local variable: agent - the agent
Node [dynamic]
[Visible if New location is Network / GIS node] Network nodeGIS point, or GIS region where the agents that entered this block are put.
Local variable: agent -  the agent
Attractor [dynamic]
[Visible if New location is AttractorAttractor where the agents that entered this block are put.
Value type
: Attractor
Local variable: agent -  the agent
X, Y, Z [dynamic]
[Visible if New location is (x, y, z)] X,Y,Z coordinates of the point where the agents will be put.
Type of value: double
Local variable: agent -  the agent
... in the network
[Visible if New location is (x, y, z)] If the option is selected (true), the agents are added into the network you choose in the parameter Network below.
Syntax:  boolean locationXYZInNetwork
Network [dynamic]
[Visible if ...in network is selected] Network where the agents that entered this block are put.
Value type: Network
Local variable: agent -  the agent
Latitude, Longitude [dynamic]
[Visible if New location is (latitude, longitude)] Latitude and longitude of the point on the GIS map where the agents will be placed.
Type of value: double
Local variable: agent - the agent
Name of place [dynamic]
[Visible if New location is Geographic place] The name of the particular location on the GIS map, where the agents will be placed. You specify the name as text put in quotes, e.g. "London". GIS map will search for a location with such name. The first location from the list of GIS search results will be used. 
Type of value: String
Local variable: agent - the agent
Agent
Change dimensions [dynamic]
If the option is selected (true), you will be able to change the dimensions of the agents entering the flowchart via this block by specifying the new Length, Width and Height values below.
Type of value: boolean
Local variable:  agent - the agent
Length [dynamic]
[Visible if the Change dimensions option is selected] The new length of the agent.
Type of value: double
Local variable:  agent - the agent
Width [dynamic]
[Visible if the Change dimensions option is selected] The new width of the agent.
Type of value: double
Local variable:  agent - the agent
Height [dynamic]
[Visible if the Change dimensions option is selected] The new height of the agent.
Type of value: double
Local variable:  agent - the agent
Advanced
Add newborns to
Here you specify where the agents that were created by this block will be stored: in the default , or in some custom population (specified below in the Population property). Please note that this applies only to those agents that were just created with new() constructor and have not been present in the model yet.
Syntax: boolean addToCustomPopulation
Population [dynamic]
[Visible if Add newborns to: custom population] The name of the agent population where the agents created by this block will be stored.
Value type: AgentList
Local variable: agent - the agent
Forced pushing
If the option is selected (true), when agents finish processing at the block, they are instantly pushed further regardless the state of the succeeding block.
If the option is not selected, agents are not pushed, but pulled: only when the succeeding block is ready to accept one more agent, it requests the agent from this block, and only then this agent passes further.
Syntax: boolean pushProtocol
Default value: false
Actions
On enter [code]
Code executed when the agent enters the object.
Local variable: agent - the agent
On remove [code]
Code executed when the agent is intentionally removed from this block by calling the agent's  function remove(). This code is automatically executed after the remove() function call.
Local variable: agent - the agent
On at enter [code]
Here you can type Java code that will be executed when the agent decides that it most likely will go through this block.
Local variable: agent - the agent

Functions

void take(agent) - Inserts the given agent in the process flow by outputting it from the out port.

long count() - Returns the number of agents entered flowchart by this Enter object. This function doesn't count agents pending transmission (which are counted by size() method).

int size() - Returns the number of agents currently pending transmission in this block (which haven't yet been consumed by subsequent flowchart blocks).

boolean cancel(Agent agent) - Cancels taking of the given agent - if it hasn't yet been consumed by subsequent flowchart blocks.
Parameter: agent: agent to cancel, use null to cancel all the agents pending transmission in this block.
Returns true  if agent was successfully removed from this block, and false in case the agent has already been transmitted to the flowchart following this block or when the given agent wasn't taken by this block using take() method.

int cancelAll() - Cancels all the agents currently pending transmission in this block (which haven't yet been consumed by subsequent flowchart blocks). Returns the number of cancelled agents.

Iterator<T> iterator() - Returns the iterator over agents currently pending transmission in this block (which has't yet been consumed by subsequent flowchart blocks) - in their take() order. Note that returned agents may be consumed by subsequent block at any time later (e.g. some Delay gets free, or Hold unblocks) - unless cancel() function is called.

Ports

out
The output port.