AnyLogic
Expand
Font size
Type Parameters:
E - type of agent extension to delegate to. If you are creating new extension based on 'continuous or GIS space agent', please set the type to ExtAgentWithSpatialMetrics
All Implemented Interfaces:
AgentExtension, ExtAgentWithSpatialMetrics, ExtAnimationParams, Serializable
Direct Known Subclasses:
ExtEntityDelegate

@AnyLogicInternalAPI
public abstract class ExtAgentWithSpatialMetricsDelegate<E extends ExtAgentWithSpatialMetrics>
extends AgentExtensionImpl
implements ExtAgentWithSpatialMetrics
Base class for extensions delegating their 'Continuous / GIS space agent' activity to an existing extension of agent
See Also:
Serialized Form

Field Summary

Constructor Summary

ConstructorDescription
ExtAgentWithSpatialMetricsDelegate(Agent owner) 

Method Summary

Modifier and TypeMethodDescription
<T extends Agent>
List<T>
agentsInRange(Iterable<T> agents, double distance)
Returns the unsorted list of agents from the given collection which are within the given distance from this agent
<T extends Agent>
List<T>
agentsInRange(Iterable<T> agents, double distance, LengthUnits units)
Returns the unsorted list of agents from the given collection which are within the given distance from this agent
doubledistanceTo(double x, double y)
Calculates the distance from this agent to a given point in the projection to the horizontal plane (i.e.
doubledistanceTo(double x, double y, LengthUnits units)
Calculates the distance from this agent to a given point in the projection to the horizontal plane (i.e.
doubledistanceTo(Agent other)
Calculates the distance from this agent to another one.
The exact behavior of this method depends on the underlying space type.
doubledistanceTo(Agent other, LengthUnits units)
Calculates the distance from this agent to another one.
The exact behavior of this method depends on the underlying space type.
doubledistanceTo(Point point)
Calculates the distance from this agent to the point.
The exact behavior of this method depends on the underlying space type.
doubledistanceTo(Point point, LengthUnits units)
Calculates the distance from this agent to the point.
The exact behavior of this method depends on the underlying space type.
final Ee() 
abstract Class<E>extClass() 
PositiongetAnimationPosition(Position out) 
doublegetAnimationX() 
doublegetAnimationY() 
doublegetAnimationZ() 
LevelgetLevel()
Returns the level this agent lives in, actual for agents in continuous space.
<T extends Agent>
T
getNearestAgent(Iterable<T> agents)
Returns the nearest agent from the given collection
INetworkgetNetwork()
Returns the network this agent lives in, actual for agents in continuous space.
INodegetNetworkNode()
Returns the network node this agent currently is located in, actual for agents in continuous space.
doublegetPresentationScaleOnOwnerSpace()
Returns the scale of the agent presentation animation on its space or 1.0 if space isn't defined or agent list is empty
IRouteProvidergetRouteProvider()
Returns the provider of routes for agent movement
AgentgetSpace()
Returns the agent representing space this agent lives in
SpaceTypegetSpaceType()
Returns the type of space this agent lives in, one of SPACE_CONTINUOUS, SPACE_GIS
doublegetSpeed()
Returns the current value of the agent speed (measured in m/s).
doublegetSpeed(SpeedUnits units)
Returns the current value of the agent speed.
doublegetTargetX()
Returns the x of the target location if moving, otherwise current x.
The exact behavior of this method depends on the underlying space type.
doublegetTargetY()
Returns the y of the target location if moving, otherwise current y.
The exact behavior of this method depends on the underlying space type.
doublegetVelocity()
Deprecated.
booleanisAnimationVisible_xjal() 
booleanisAutomaticHorizontalRotation()
Returns true if agent is set to be rotated (in horizontal plane) during movement, false otherwise
booleanisAutomaticVerticalRotation()
This functions is valid only for specific set of spaces
booleanisMoving()
Tests if the agent is currently moving.
voidjumpTo(double x, double y)
Instantly moves the agent to a given location (without changes to Z-coordinate, if any).
voidjumpTo(INode node, Point location)
Instantly moves the agent to a given network location.
voidjumpTo(Point location)
Instantly moves the agent to a given location.
voidmoveTo(double x, double y)
Starts movement in the direction of the given target location.
voidmoveTo(INode node, Point location)
Starts movement to the given network node.
"On arrival" code is executed when movement is finished.
voidmoveTo(Point location)
Starts movement in the direction of the given target location.
"On arrival" code is executed when movement is finished.
voidmoveToInTime(double x, double y, double tripTime)
Starts movement in the direction of the given target location.
voidmoveToInTime(double x, double y, double tripTime, TimeUnits units)
Starts movement in the direction of the given target location.
voidmoveToInTime(INode node, Point location, double tripTime)
Starts movement to the given network node.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
voidmoveToInTime(INode node, Point location, double tripTime, TimeUnits units)
Starts movement to the given network node.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
voidmoveToInTime(Point location, double tripTime)
Starts movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
voidmoveToInTime(Point location, double tripTime, TimeUnits units)
Starts movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
voidmoveToNearestAgent(Iterable<? extends Agent> agents)
Starts movement to the nearest agent from the given collection.
voidmoveToNearestAgent(Iterable<? extends Agent> agents, double tripTime)
Starts movement to the nearest agent from the given collection.
voidmoveToStraight(Point location)
Starts straight movement in the direction of the given target location.
"On arrival" code is executed when movement is finished.
voidmoveToStraightInTime(Point location, double tripTime)
Starts straight movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
voidmoveToStraightInTime(Point location, double tripTime, TimeUnits units)
Starts straight movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
voidonExtensionRemoved(AgentExtension ext)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Default implementation does nothing
intpriority()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
This function is used for sorting extensions (in order for the overriding delegation to work)
voidsetArrivalCallback(ArrivalCallback arrivalCallback)
This method is designed for advanced users and library developers, for general purpose arrival processing please use "On arrival" action which can be found on the properties of Agent Type.
Sets the listener which will be notified when the agent arrives (onArrival) or when the agent movement is cancelled or redirected (onCancel).
voidsetAutomaticHorizontalRotation(boolean yes)
Tells agent to rotate automatically (in horizontal plane) during movements.
voidsetLevel(Level level)
Sets this agent to live in the level, actual for agents in continuous space.
voidsetNetwork(INetwork network)
Sets this agent to live in the network, actual for agents in continuous space.
voidsetNetworkInternal(INetwork network, INode node, Position location) 
voidsetNetworkNode(INode node)
Sets the current network location for the agent
voidsetNetworkNode(INode node, Point position)
Sets the current network location for the agent
voidsetRouteProvider(IRouteProvider routeProvider)
Stops agent If it is moving.
voidsetSpace(Agent space)
Sets the space for agent.
voidsetSpeed(double speedInMPS)
Changes speed of the agent (measured in m/s).
If the agent is moving, it continues moving with the new speed.
voidsetSpeed(double s, SpeedUnits units)
Changes speed of the agent (the units of the value depend on the specific space type).
If the agent is moving, it continues moving with the new speed.
voidsetVelocity(double v)
Deprecated.
voidstop()
Stops movement, if any.
doubletimeToArrival()
Returns the time to arrival to the target location, in model-time units.
If the agent is not moving, returns 0.
doubletimeToArrival(TimeUnits units)
Returns the time to arrival to the target location, in time units.
If the agent is not moving, returns 0.
voidupdatePosition()
Updates agent coordinates

Methods inherited from class com.anylogic.engine.AgentExtensionImpl

error, error, getAgent, getSupportedInterfaces_xjal, next_xjal, onDestroy, setNext_xjal, supportsInterface_xjal

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.AgentExtension

getAgent, next_xjal, onDestroy, setNext_xjal, supportsInterface_xjal

Constructor Details

ExtAgentWithSpatialMetricsDelegate

public ExtAgentWithSpatialMetricsDelegate(Agent owner)

Method Details

setSpace

public void setSpace(Agent space)
Description copied from interface: ExtAnimationParams
Sets the space for agent. Shouldn't be called for moving agents. Coordinates and rotations are left "as is"
Specified by:
setSpace in interface ExtAnimationParams
Parameters:
space - the agent representing space this agent will live in

stop

public void stop()
Description copied from interface: ExtAgentWithSpatialMetrics
Stops movement, if any.
Specified by:
stop in interface ExtAgentWithSpatialMetrics

moveTo

public void moveTo(double x,
 double y)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement in the direction of the given target location. Z coordinate of target is the same as the current agent's Z coordinate.
"On arrival" code is executed when movement is finished.
Specified by:
moveTo in interface ExtAgentWithSpatialMetrics
Parameters:
x - the x coordinate of the target location
y - the y coordinate of the target location

getSpace

public Agent getSpace()
Description copied from interface: ExtAnimationParams
Returns the agent representing space this agent lives in
Specified by:
getSpace in interface ExtAnimationParams
Returns:
the agent representing space this agent lives in

getAnimationX

public double getAnimationX()
Specified by:
getAnimationX in interface ExtAnimationParams

getAnimationY

public double getAnimationY()
Specified by:
getAnimationY in interface ExtAnimationParams

getAnimationZ

public double getAnimationZ()
Specified by:
getAnimationZ in interface ExtAnimationParams

getAnimationPosition

public Position getAnimationPosition(Position out)
Specified by:
getAnimationPosition in interface ExtAnimationParams

getPresentationScaleOnOwnerSpace

public double getPresentationScaleOnOwnerSpace()
Description copied from interface: ExtAnimationParams
Returns the scale of the agent presentation animation on its space or 1.0 if space isn't defined or agent list is empty
Specified by:
getPresentationScaleOnOwnerSpace in interface ExtAnimationParams
Returns:
the scale of presentation animation on owner space

moveTo

public void moveTo(Point location)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement in the direction of the given target location.
"On arrival" code is executed when movement is finished.
Specified by:
moveTo in interface ExtAgentWithSpatialMetrics
Parameters:
location - the target location

moveToInTime

public void moveToInTime(Point location,
 double tripTime)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
Specified by:
moveToInTime in interface ExtAgentWithSpatialMetrics
Parameters:
location - the target location
tripTime - the time of the movement trip

moveToStraight

public void moveToStraight(Point location)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts straight movement in the direction of the given target location.
"On arrival" code is executed when movement is finished.
Specified by:
moveToStraight in interface ExtAgentWithSpatialMetrics
Parameters:
location - the target location

moveToStraightInTime

public void moveToStraightInTime(Point location,
 double tripTime)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts straight movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
Specified by:
moveToStraightInTime in interface ExtAgentWithSpatialMetrics
Parameters:
location - the target location
tripTime - the time of the movement trip

moveToStraightInTime

public void moveToStraightInTime(Point location,
 double tripTime,
 TimeUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts straight movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
Specified by:
moveToStraightInTime in interface ExtAgentWithSpatialMetrics
Parameters:
location - the target location
tripTime - the time of the movement trip
units - the time units

isAnimationVisible_xjal

public boolean isAnimationVisible_xjal()
Specified by:
isAnimationVisible_xjal in interface ExtAnimationParams

moveToInTime

public void moveToInTime(Point location,
 double tripTime,
 TimeUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
Specified by:
moveToInTime in interface ExtAgentWithSpatialMetrics
Parameters:
location - the target location
tripTime - the time of the movement trip
units - the time units

moveTo

public void moveTo(INode node,
 Point location)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement to the given network node.
"On arrival" code is executed when movement is finished.
Specified by:
moveTo in interface ExtAgentWithSpatialMetrics
Parameters:
node - the network node.
location - (optional) location within node, may be null

moveToInTime

public void moveToInTime(double x,
 double y,
 double tripTime)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement in the direction of the given target location. (in case of 3D space, Z coordinate of target is the same as the current agent's Z coordinate.
"On arrival" code is executed when movement is finished.
The exact behavior of this method depends on the underlying space type.
Specified by:
moveToInTime in interface ExtAgentWithSpatialMetrics
Parameters:
x - the x coordinate of the target location
y - the y coordinate of the target location
tripTime - the time of the movement trip

moveToInTime

public void moveToInTime(double x,
 double y,
 double tripTime,
 TimeUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement in the direction of the given target location. (in case of 3D space, Z coordinate of target is the same as the current agent's Z coordinate.
"On arrival" code is executed when movement is finished.
The exact behavior of this method depends on the underlying space type.
Specified by:
moveToInTime in interface ExtAgentWithSpatialMetrics
Parameters:
x - the x coordinate of the target location
y - the y coordinate of the target location
tripTime - the time of the movement trip
units - the time units

moveToInTime

public void moveToInTime(INode node,
 Point location,
 double tripTime)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement to the given network node.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
Specified by:
moveToInTime in interface ExtAgentWithSpatialMetrics
Parameters:
node - the network node.
location - (optional) location within node, may be null
tripTime - the time of the movement trip

moveToInTime

public void moveToInTime(INode node,
 Point location,
 double tripTime,
 TimeUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement to the given network node.
Changes the speed of the agent in order to reach target in tripTime model time units.
"On arrival" code is executed when movement is finished.
Specified by:
moveToInTime in interface ExtAgentWithSpatialMetrics
Parameters:
node - the network node.
location - (optional) location within node, may be null
tripTime - the time of the movement trip
units - the time units

jumpTo

public void jumpTo(double x,
 double y)
Description copied from interface: ExtAgentWithSpatialMetrics
Instantly moves the agent to a given location (without changes to Z-coordinate, if any). Terminates any movement.
The exact behavior of this method depends on the underlying space type.
Doesn't call "on arrival" code
Specified by:
jumpTo in interface ExtAgentWithSpatialMetrics
Parameters:
x - the x coordinate of the new location
y - the y coordinate of the new location

jumpTo

public void jumpTo(Point location)
Description copied from interface: ExtAgentWithSpatialMetrics
Instantly moves the agent to a given location. Terminates any movement.
Doesn't call "on arrival" code
Specified by:
jumpTo in interface ExtAgentWithSpatialMetrics
Parameters:
location - the new location

jumpTo

public void jumpTo(INode node,
 Point location)
Description copied from interface: ExtAgentWithSpatialMetrics
Instantly moves the agent to a given network location. Terminates any movement.
Doesn't call "on arrival" code
Specified by:
jumpTo in interface ExtAgentWithSpatialMetrics
Parameters:
node - the network node.
location - (optional) location within node, may be null

setArrivalCallback

public void setArrivalCallback(ArrivalCallback arrivalCallback)
Description copied from interface: ExtAgentWithSpatialMetrics
This method is designed for advanced users and library developers, for general purpose arrival processing please use "On arrival" action which can be found on the properties of Agent Type.
Sets the listener which will be notified when the agent arrives (onArrival) or when the agent movement is cancelled or redirected (onCancel). The agent should be stopped at the time this method is called and should have no arrival callback set, otherwise this method will throw an error.
The arrival callback is automatically forgotten once notified.
Specified by:
setArrivalCallback in interface ExtAgentWithSpatialMetrics
Parameters:
arrivalCallback - the listener which will be notified about agent's arrival

moveToNearestAgent

public void moveToNearestAgent(Iterable<? extends Agent> agents)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement to the nearest agent from the given collection. Stops any current movement.
Specified by:
moveToNearestAgent in interface ExtAgentWithSpatialMetrics
Parameters:
agents - the collection of agents

moveToNearestAgent

public void moveToNearestAgent(Iterable<? extends Agent> agents,
 double tripTime)
Description copied from interface: ExtAgentWithSpatialMetrics
Starts movement to the nearest agent from the given collection. Stops any current movement.
Changes the speed of the agent in order to reach target in tripTime model time units.
Specified by:
moveToNearestAgent in interface ExtAgentWithSpatialMetrics
Parameters:
agents - the collection of agents
tripTime - the time of the movement trip

getNearestAgent

public <T extends Agent> T getNearestAgent(Iterable<T> agents)
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the nearest agent from the given collection
Specified by:
getNearestAgent in interface ExtAgentWithSpatialMetrics
Parameters:
agents - the collection of agents
Returns:
the nearest agent (never this one) or null if the collection is empty

agentsInRange

public <T extends Agent> List<T> agentsInRange(Iterable<T> agents,
 double distance)
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the unsorted list of agents from the given collection which are within the given distance from this agent
Specified by:
agentsInRange in interface ExtAgentWithSpatialMetrics
Parameters:
agents - the collection of agents
Returns:
the list of agents within the given distance, unsorted

agentsInRange

public <T extends Agent> List<T> agentsInRange(Iterable<T> agents,
 double distance,
 LengthUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the unsorted list of agents from the given collection which are within the given distance from this agent
Specified by:
agentsInRange in interface ExtAgentWithSpatialMetrics
Parameters:
agents - the collection of agents
Returns:
the list of agents within the given distance, unsorted

setAutomaticHorizontalRotation

public void setAutomaticHorizontalRotation(boolean yes)
Description copied from interface: ExtAgentWithSpatialMetrics
Tells agent to rotate automatically (in horizontal plane) during movements.
Specified by:
setAutomaticHorizontalRotation in interface ExtAgentWithSpatialMetrics
Parameters:
yes - true - agent will be rotated during movement, false - rotation will not be changed
See Also:

isAutomaticHorizontalRotation

public boolean isAutomaticHorizontalRotation()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns true if agent is set to be rotated (in horizontal plane) during movement, false otherwise
Specified by:
isAutomaticHorizontalRotation in interface ExtAgentWithSpatialMetrics
Returns:
true if agent is set to be rotated during movement
See Also:

getTargetX

public double getTargetX()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the x of the target location if moving, otherwise current x.
The exact behavior of this method depends on the underlying space type.
Specified by:
getTargetX in interface ExtAgentWithSpatialMetrics
Returns:
the x of the target location if moving, otherwise current x

getTargetY

public double getTargetY()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the y of the target location if moving, otherwise current y.
The exact behavior of this method depends on the underlying space type.
Specified by:
getTargetY in interface ExtAgentWithSpatialMetrics
Returns:
the y of the target location if moving, otherwise current y

distanceTo

public double distanceTo(Agent other)
Description copied from interface: ExtAgentWithSpatialMetrics
Calculates the distance from this agent to another one.
The exact behavior of this method depends on the underlying space type.
Specified by:
distanceTo in interface ExtAgentWithSpatialMetrics
Parameters:
other - another agent
Returns:
the distance to the other agent

distanceTo

public double distanceTo(Agent other,
 LengthUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Calculates the distance from this agent to another one.
The exact behavior of this method depends on the underlying space type.
Specified by:
distanceTo in interface ExtAgentWithSpatialMetrics
Parameters:
other - another agent
units - the units of length
Returns:
the distance to the other agent

distanceTo

public double distanceTo(Point point)
Description copied from interface: ExtAgentWithSpatialMetrics
Calculates the distance from this agent to the point.
The exact behavior of this method depends on the underlying space type.
Specified by:
distanceTo in interface ExtAgentWithSpatialMetrics
Returns:
the distance to the point

distanceTo

public double distanceTo(Point point,
 LengthUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Calculates the distance from this agent to the point.
The exact behavior of this method depends on the underlying space type.
Specified by:
distanceTo in interface ExtAgentWithSpatialMetrics
units - the units of length
Returns:
the distance to the point

distanceTo

public double distanceTo(double x,
 double y)
Description copied from interface: ExtAgentWithSpatialMetrics
Calculates the distance from this agent to a given point in the projection to the horizontal plane (i.e. agent's Z coordinate isn't used in the calculation).
Specified by:
distanceTo in interface ExtAgentWithSpatialMetrics
Parameters:
x - the x coordinate of the point
y - the y coordinate of the point
Returns:
the distance of Agent's projection (on the plane Z=0) to the point (x,y)

distanceTo

public double distanceTo(double x,
 double y,
 LengthUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Calculates the distance from this agent to a given point in the projection to the horizontal plane (i.e. agent's Z coordinate isn't used in the calculation).
Specified by:
distanceTo in interface ExtAgentWithSpatialMetrics
Parameters:
x - the x coordinate of the point
y - the y coordinate of the point
units - the units of lengths
Returns:
the distance of Agent's projection (on the plane Z=0) to the point (x,y)

isMoving

public boolean isMoving()
Description copied from interface: ExtAgentWithSpatialMetrics
Tests if the agent is currently moving.
Specified by:
isMoving in interface ExtAgentWithSpatialMetrics
Returns:
true if the agent is moving, false otherwise

setVelocity

@Deprecated
public void setVelocity(double v)
Deprecated.
Description copied from interface: ExtAgentWithSpatialMetrics
Changes speed of the agent (the units of the value depend on the specific space type).
If the agent is moving, it continues moving with the new speed. Note that nonzero speed does not mean the agent is moving - it starts moving only after moveTo() is called.
Specified by:
setVelocity in interface ExtAgentWithSpatialMetrics
Parameters:
v - the new speed

getVelocity

@Deprecated
public double getVelocity()
Deprecated.
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the current value of the agent speed. The units of the returned value depend on the specific space type.
Note that nonzero speed does not mean the agent is moving - it starts moving only after moveTo is called.
Specified by:
getVelocity in interface ExtAgentWithSpatialMetrics
Returns:
the current value of agent speed

setSpeed

public void setSpeed(double speedInMPS)
Description copied from interface: ExtAgentWithSpatialMetrics
Changes speed of the agent (measured in m/s).
If the agent is moving, it continues moving with the new speed. Note that nonzero speed does not mean the agent is moving - it starts moving only after moveTo() is called.
Specified by:
setSpeed in interface ExtAgentWithSpatialMetrics

setSpeed

public void setSpeed(double s,
 SpeedUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Changes speed of the agent (the units of the value depend on the specific space type).
If the agent is moving, it continues moving with the new speed. Note that nonzero speed does not mean the agent is moving - it starts moving only after moveTo() is called.
Specified by:
setSpeed in interface ExtAgentWithSpatialMetrics
Parameters:
s - the new speed
units - the units of speed

getSpeed

public double getSpeed()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the current value of the agent speed (measured in m/s). The units of the returned value depend on the specific space type.
Note that nonzero speed does not mean the agent is moving - it starts moving only after moveTo is called.
Specified by:
getSpeed in interface ExtAgentWithSpatialMetrics
Returns:
the current value of agent speed, meters per second

getSpeed

public double getSpeed(SpeedUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the current value of the agent speed. The units of the returned value depend on the specific space type.
Note that nonzero speed does not mean the agent is moving - it starts moving only after moveTo is called.
Specified by:
getSpeed in interface ExtAgentWithSpatialMetrics
Parameters:
units - the units of speed
Returns:
the current value of agent speed

timeToArrival

public double timeToArrival()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the time to arrival to the target location, in model-time units.
If the agent is not moving, returns 0.
Specified by:
timeToArrival in interface ExtAgentWithSpatialMetrics
Returns:
the time to arrival to the target location, or 0

timeToArrival

public double timeToArrival(TimeUnits units)
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the time to arrival to the target location, in time units.
If the agent is not moving, returns 0.
Specified by:
timeToArrival in interface ExtAgentWithSpatialMetrics
Returns:
the time to arrival to the target location, or 0

updatePosition

public void updatePosition()
Description copied from interface: ExtAgentWithSpatialMetrics
Updates agent coordinates
Specified by:
updatePosition in interface ExtAgentWithSpatialMetrics

getRouteProvider

public IRouteProvider getRouteProvider()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the provider of routes for agent movement
Specified by:
getRouteProvider in interface ExtAgentWithSpatialMetrics
Returns:
the route provider

setRouteProvider

public void setRouteProvider(IRouteProvider routeProvider)
Description copied from interface: ExtAgentWithSpatialMetrics
Stops agent If it is moving. Sets the route provider for agent movement. Route provider has several implementations: network, straight movement, specific movement in GIS space such as movement by roads.
Specified by:
setRouteProvider in interface ExtAgentWithSpatialMetrics
Parameters:
routeProvider - the route provider

getLevel

public Level getLevel()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the level this agent lives in, actual for agents in continuous space.
Specified by:
getLevel in interface ExtAgentWithSpatialMetrics
Returns:
the level this agent lives in

setLevel

public void setLevel(Level level)
Description copied from interface: ExtAgentWithSpatialMetrics
Sets this agent to live in the level, actual for agents in continuous space.
Specified by:
setLevel in interface ExtAgentWithSpatialMetrics
Parameters:
level - the level this agent will live in

getNetwork

public INetwork getNetwork()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the network this agent lives in, actual for agents in continuous space.
Specified by:
getNetwork in interface ExtAgentWithSpatialMetrics
Returns:
the network this agent lives in

setNetwork

public void setNetwork(INetwork network)
Description copied from interface: ExtAgentWithSpatialMetrics
Sets this agent to live in the network, actual for agents in continuous space.
Specified by:
setNetwork in interface ExtAgentWithSpatialMetrics
Parameters:
network - the network this agent will live in

setNetworkInternal

public void setNetworkInternal(INetwork network,
 INode node,
 Position location)
Specified by:
setNetworkInternal in interface ExtAgentWithSpatialMetrics

getNetworkNode

public INode getNetworkNode()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the network node this agent currently is located in, actual for agents in continuous space.
Specified by:
getNetworkNode in interface ExtAgentWithSpatialMetrics
Returns:
the network node this agent currently is located in

setNetworkNode

public void setNetworkNode(INode node,
 Point position)
Description copied from interface: ExtAgentWithSpatialMetrics
Sets the current network location for the agent
Specified by:
setNetworkNode in interface ExtAgentWithSpatialMetrics
Parameters:
node - the network node
position - (optional) location within node, may be null

setNetworkNode

public void setNetworkNode(INode node)
Description copied from interface: ExtAgentWithSpatialMetrics
Sets the current network location for the agent
Specified by:
setNetworkNode in interface ExtAgentWithSpatialMetrics
Parameters:
node - the network node

getSpaceType

public SpaceType getSpaceType()
Description copied from interface: ExtAgentWithSpatialMetrics
Returns the type of space this agent lives in, one of SPACE_CONTINUOUS, SPACE_GIS
Specified by:
getSpaceType in interface ExtAgentWithSpatialMetrics
Returns:
one of SPACE_CONTINUOUS, SPACE_GIS

priority

@AnyLogicInternalAPI
public int priority()
Description copied from interface: AgentExtension
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
This function is used for sorting extensions (in order for the overriding delegation to work)
Specified by:
priority in interface AgentExtension
Overrides:
priority in class AgentExtensionImpl
Returns:
int value, see also P_* constants

onExtensionRemoved

@AnyLogicInternalAPI
public void onExtensionRemoved(AgentExtension ext)
Description copied from class: AgentExtensionImpl
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Default implementation does nothing
Specified by:
onExtensionRemoved in interface AgentExtension
Overrides:
onExtensionRemoved in class AgentExtensionImpl
Parameters:
ext - the extension which has just been removed
See Also:

e

@AnyLogicInternalAPI
public final E e()

extClass

@AnyLogicInternalAPI
public abstract Class<E> extClass()

isAutomaticVerticalRotation

@AnyLogicInternalAPI
public boolean isAutomaticVerticalRotation()
This functions is valid only for specific set of spaces
See Also: