MoveTo


Moves the agent to a new location. If any resources are attached to the agent, they will move with it. The speed will be the agent speed regardless of the attached resources speed. The time spent by the agent in this object equals the length of the shortest route from the agent current location to the destination divided by the agent speed (note that you may modify the speed by enabling the parameter Set agent's speed and specifying new Speed below.) The agent is animated moving along the route.

Parameters

Agent
Choose whether the agent instantly jumps to the new location, or moves there.
Get value: mode
Valid values: moves to - MoveTo.MODE_MOVE_TO
                      is placed (jumps) to - MoveTo.MODE_PLACE_TO
Destination
Defines how the destination is defined:
Network / GIS node
- agent moves to the specified network nodeGIS point, or GIS region.
Attractor
- agent moves to the specified attractor.
Seized resource unit - agent moves to the current location of the seized resource (specified below in the Resource field).
Home of seized unit - agent moves to the home location of the seized resource (specified below in the Resource field).
Agent / unit - the agent moves to the location of the specified agent.
(x,y,z) - the agent moves to the point with the specified coordinates.
Node + (x,y,z) - agent moves to the specified node and then moves to the point with the specified X,Y,Z coordinates. Use this mode when you need to move agents to the particular location inside the mode. Note that you define absolute coordinates, see the X, Y, Z parameter description below.
(latitude, longitude) - the agent moves to the given point on the GIS map with the specified Latitude and Longitude.
Geographic place - the agent moves to the particular location on the GIS map. You define this place using the Name of place parameter below.
The next three destinations are for resources [res.] used in the preparation and wrap-up flowcharts.
[res.] Agent which possesses me - the resource moves to the agent that possesses it.
[res.] Other unit seized by my agent - the resource moves to some other resource unit.
[res.] Other unit's home - the resource moves to another unit's home location.
Get value: destinationType
Set new value dynamically: set_destinationType( new value )
Valid values: Network / GIS node - MoveTo.DEST_NODE
                      Attractor - MoveTo.DEST_ATTRACTOR
                      Seized resource unit - MoveTo.DEST_RESOURCE
                      Home of seized unit - MoveTo.DEST_RESOURCE_HOME
                      Agent / unit - MoveTo.DEST_AGENT
                      (x,y,z) - MoveTo.DEST_XYZ
                      Node + (x,y,z) - MoveTo.DEST_NODE_XYZ
           
(latitude, longitude) - MoveTo.DEST_LATLON
                                Geographic place - MoveTo.DEST_GEO_PLACE
                      [res.] Agent which possesses me - MoveTo.DEST_POSSESSING_ENTITY
                                [res.] Other unit seized by my agent - MoveTo.DEST_OTHER_RESOURCE
                      [res.] Other unit's home - MoveTo.DEST_OTHER_RESOURCE_HOME
Node [dynamic]
[Visible if Destination is Network / GIS node] Network nodeGIS point, or GIS region where the agent will move.
Local variable: agent - the agent.
Attractor [dynamic]
[Visible if Destination is AttractorAttractor where the agent will move.
Value type: Attractor
Local variable: agent - the agent
Resource [dynamic]
[Visible if Destination is Seized resource unit, or Home of seized resource] The name of the ResourcePool block that defines the set of resource units. The agent will move to the current location (or home location, depending on the Destination parameter value) of the seized resource unit of this type. If several units of the same pool are seized, the first in the list will be chosen.
Value type: ResourcePool
Local variable: agent - the agent
Agent [dynamic]
[Visible if Destination is Agent / unit] The agent to move to (it may be e.g. a particular resource unit of some other agent).
Value type: Agent
Local variable: agent - the agent
X, Y, Z [dynamic]
[Visible if Destination is (x, y, z) or Node + (x,y,z)] X,Y,Z coordinates of the point where agents will move after reaching the specified node. Note that you define absolute coordinates, so you should make the point coordinates correspond to the node coordinates, otherwise agents will move to the point residing  outside the node.
Value type: double
Local variable: agent - the agent
Latitude, Longitude [dynamic]
[Visible if Destination is (latitude, longitude)] Latitude and longitude of the point on the GIS map where the agents will move.
Type of value: double
Local variable: agent - the agent
Name of place [dynamic]
[Visible if Destination is Geographic place] The name of the particular location on the GIS map, where the agents will move. 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
Set rotation upon arrival
[Visible if Destination is (x, y, z) , Node + (x,y,z), (latitude, longitude) or geographic place] Here you can set agent rotation when it arrives at destination.
Syntax: boolean destinationUseRotation
Rotation [dynamic]
[Visible if Set rotation upon arrival is enabled] Here you can set agent horizontal rotation when it arrives at destination.
Value type: double
Local variable: agent - the agent
Vertical rotation [dynamic]
[Visible if Set rotation upon arrival is enabled] Here you can set agent vertical rotation when it arrives at destination.
Value type: double
Local variable: agent - the agent
... With offset
[Visible if Destination is set to Network node, Attractor, Seized resource unit, Home of seized unit, Agent/unit and [res.] options] Select if you want to define offset from the destination point.
Syntax: boolean useOffsets
Default value: false
X, Y, Z offset [dynamic]
[Visible if ... With offset is selected] Here you can define the offset from the destination point as values along the corresponding axis.
Value type: double
Local variable: agent - the agent
Default value: 0
... in the network
[Visible if Agent: is placed (jumps)to: (x,y,z), (latitude, longitude), and geographic place] Select this option if you want to use a point with the given coordinates or a place that is in the network.
Syntax: boolean destinationInNetwork
Default value: false
Network [dynamic]
[Visible if ...in the network is selected] Select the network that contains the defined point or place.
Value type: INetwork
Local variable: agent - the agent
Straight movement
Select this option if you do not want the agent to be included in the network and move along a straight line (the shortest route between locations).
Syntax: boolean straightMovement
Default value: false
Movement is defined by [dynamic]
[Visible if Agent is set to Moves to] Choose how movement is defined: by Distance / speed or by Trip time.
Local variable: agent - the agent
Set agent's speed [dynamic]
[Visible if Movement is defined by Distance / speed] Select if you want to define the speed of the agent.
Value type: boolean
Local variable: agent - the agent
Default value: false
Speed [dynamic]
[Visible if Set agent's speed is selected] Expression evaluated to obtain the speed of the agent.
Value type: double
Local variable: agent - the agent
Trip time [dynamic]
[Visible if Movement is defined by Trip time]
Value type: double
Local variable: agent - the agent
Restore speed on arrival
[Visible if Movement is defined by Trip time] When agent movement is defined by trip time, the agent changes its speed. This parameter allows to restore the original speed.
Syntax: boolean restoreSpeedOnArrival
Default value: false
Actions
On enter [code]
Code executed when the agent enters the object.
Local variable: agent - the agent
On exit [code]
Code executed when the agent exits 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

Functions

int size() - returns the number of agents moving in this object.

Agent remove(Agent agent) - removes the given agent from the object and returns it. Returns null if agent doesn't belong to this object.

Iterator<Agent> iterator() - returns the iterator over agents (ordering: the first is at the exit, the last has the largest remaining time to be delayed).

Ports

in
The input port.
out
The output port.