
The Enter block inserts the already existing agents into a specific location in the flowchart.
Demo model: Enter and Exit Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files). Demo model: Enter and ExitOpen the model in your AnyLogic desktop installation.This block is typically used either to transfer the agents created by a statechart, an event, and the like into the process flow, or, in conjunction with the Exit block, to implement custom routing in the process model.
To insert the agent via this block, call its take(agent) function.
-
The type of the agents entering the flowchart via this block. Referred below as T.
Default value: Agent
- New location
-
Defines the new location for the agents entering the flowchart via this block. There are six 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 node, GIS 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 property below.Name: locationType
Type: InitialLocationType
Default value: Enter.LOCATION_NOT_SPECIFIED — Not specified
Valid values:
Enter.LOCATION_NOT_SPECIFIED — Not specified
Enter.LOCATION_NODE — Network / GIS node
Enter.LOCATION_ATTRACTOR — Attractor
Enter.LOCATION_XYZ — (x, y, z)
Enter.LOCATION_LATLON — (latitude, longitude)
Enter.LOCATION_GEO_PLACE — Geographic place -
[Visible if New location: Network / GIS node]
The network node, GIS point, or GIS region where the agents that entered this block are put.Type: INode
Local variable: T agent — the agent -
[Visible if New location is Attractor]
Attractor where the agents that entered this block are put.Type: Attractor
Local variable: T agent — the agent -
[Visible if New location: (x, y, z)]
The X, Y, and Z coordinates of the point where the agents will be put.Type: double
Local variable: T agent — the agent -
[Visible if New location: (x, y, z)]
Specifies where the agent will be added to upon entering this block: either Level or Network.Name: destinationInNetwork
Type: boolean
Default value: false — Level -
[Visible if … located in: Level]
The level the agent will be added to once it enters the block.Type: Level
Local variable: T agent — the agent -
[Visible if … located in: Network]
The network the agent will be added to once it enters the block.Type: INetwork
Local variable: T agent — the agent -
[Visible if New location is (latitude, longitude)]
The latitude and longitude of the point on the GIS map where the agents will be placed.Type: double
Local variable: T agent — the agent -
[Visible if New location: 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, for example: "London". The GIS map will perform a GIS search for a location with the specified name. The first location from the list of GIS search results will be used.Type: String
Local variable: T agent — the agent -
[Visible unless New location: Not specified]
The speed of the agents that are entering the flowchart via this block.Type: double
Default value: 10 meters per second
Local variable: T agent — the agent
-
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: boolean
Local variable: T agent — the agent -
[Visible if the Change dimensions option is selected]
The new length of the agent.Type: double
Default value: 1 meters
Local variable: T agent — the agent -
[Visible if the Change dimensions option is selected]
The new width of the agent.Type: double
Default value: 1 meters
Local variable: T agent — the agent -
[Visible if the Change dimensions option is selected]
The new height of the agent.Type: double
Default value: 1 meters
Local variable: T agent — the agent
- Add newborns to
-
Defines where the agents created by this block will be stored: in the default population of the top-level agent of the model or in a custom population (specified below in the Population property). Note that this applies only to those agents that were just created with the new() constructor and have not been present in the model yet. The default population (the Java collection of the AgentList type) contained in the top-level agent can be accessed with the getDefaultPopulation() function.
Name: addToCustomPopulation
Type: boolean -
[Visible if Add newborns to: custom population]
The name of the agent population where the agents created by this block will be stored.Type: AgentList
Local variable: T agent — the agent - Forced pushing
-
If the option is selected (true), then 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.Name: pushProtocol
Type: boolean
Default value: true
- On enter
-
The code executed when the agent enters the block.
Local variable: T agent — the agent
- On remove
-
The code executed when the agent is intentionally removed from this block by calling the remove() function of the agent. This code is automatically executed after the remove() function call.
Local variable: T agent — the agent
- On at enter
-
The code executed when the agent decides that it most likely will go through this block.
Local variable: T agent — the agent
| Function | Description |
|---|---|
| void take(T agent) |
Inserts the specified agent into the process flow by sending it to output from the out port. agent — the agent to insert |
| long count() | Returns the number of agents inserted into the flowchart by this Enter block. This function does not count agents waiting to be inserted; the size() function should be used instead. |
| int size() | Returns the number of agents waiting to be inserted in this block: the agents that have not yet been accepted by subsequent flowchart blocks. |
| boolean cancel(T agent) |
Cancels the insertion of the specified agent, if it has not yet been accepted by subsequent flowchart blocks. Returns true if the agent has been successfully removed from this block, and false if the agent has already been inserted into the flowchart by this block, or if the specified agent has not been taken by this block using the take() function. agent — the agent to cancel; use null to cancel all the agents pending transfer in this block |
| int cancelAll() | Cancels all the agents currently pending transfer in this block: the agents that have not yet been accepted by subsequent flowchart blocks. Returns the number of canceled agents. |
| T remove(T agent) |
Removes the agent from the block and returns it. If the agent was not in the block, returns null. agent — the agent to remove |
| Iterator<T> iterator() | Returns the iterator over agents currently awaiting transmission in this block (which have not yet been accepted by subsequent flowchart blocks), in their take() order. Note that returned agents may be consumed by subsequent blocks at any time later, unless the cancel() function is called. For example, some Delay block may become free, or the Hold block may be unblocked. |
- out
- The output port.
-
How can we improve this article?
-