Package com.anylogic.engine
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- setSpace
- stop
- moveTo
- getSpace
- getAnimationX
- getAnimationY
- getAnimationZ
- getAnimationPosition
- getPresentationScaleOnOwnerSpace
- moveTo
- moveToInTime
- moveToStraight
- moveToStraightInTime
- moveToStraightInTime
- isAnimationVisible_xjal
- moveToInTime
- moveTo
- moveToInTime
- moveToInTime
- moveToInTime
- moveToInTime
- jumpTo
- jumpTo
- jumpTo
- setArrivalCallback
- moveToNearestAgent
- moveToNearestAgent
- getNearestAgent
- agentsInRange
- agentsInRange
- setAutomaticHorizontalRotation
- isAutomaticHorizontalRotation
- getTargetX
- getTargetY
- distanceTo
- distanceTo
- distanceTo
- distanceTo
- distanceTo
- distanceTo
- isMoving
- setVelocity
- getVelocity
- setSpeed
- setSpeed
- getSpeed
- getSpeed
- timeToArrival
- timeToArrival
- updatePosition
- getRouteProvider
- setRouteProvider
- getLevel
- setLevel
- getNetwork
- setNetwork
- setNetworkInternal
- getNetworkNode
- setNetworkNode
- setNetworkNode
- getSpaceType
- priority
- onExtensionRemoved
- e
- extClass
- isAutomaticVerticalRotation
- java.lang.Object
- com.anylogic.engine.AgentExtensionImpl
- com.anylogic.engine.ExtAgentWithSpatialMetricsDelegate<E>
- 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 toExtAgentWithSpatialMetrics
- 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
| Constructor | Description |
|---|---|
ExtAgentWithSpatialMetricsDelegate |
| Modifier and Type | Method | Description |
|---|---|---|
<T extends Agent> | agentsInRange |
Returns the unsorted list of agents from the given collection which are within the given
distance from this agent |
<T extends Agent> | agentsInRange |
Returns the unsorted list of agents from the given collection which are within the given
distance from this agent |
double | distanceTo |
Calculates the distance from this agent to a given point in the
projection to the horizontal plane (i.e.
|
double | distanceTo |
Calculates the distance from this agent to a given point in the
projection to the horizontal plane (i.e.
|
double | distanceTo |
Calculates the distance from this agent to another one.
The exact behavior of this method depends on the underlying space type. |
double | distanceTo |
Calculates the distance from this agent to another one.
The exact behavior of this method depends on the underlying space type. |
double | distanceTo |
Calculates the distance from this agent to the point.
The exact behavior of this method depends on the underlying space type. |
double | distanceTo |
Calculates the distance from this agent to the point.
The exact behavior of this method depends on the underlying space type. |
final E | e() | |
abstract Class<E> | extClass() | |
Position | getAnimationPosition |
...
|
double | getAnimationX() | |
double | getAnimationY() | |
double | getAnimationZ() | |
Level | getLevel() |
Returns the level this agent lives in, actual for agents in continuous space.
|
<T extends Agent> | getNearestAgent |
Returns the nearest agent from the given collection
|
INetwork | getNetwork() |
Returns the network this agent lives in, actual for agents in continuous space.
|
INode | getNetworkNode() |
Returns the network node this agent currently is located in, actual for agents in continuous space.
|
double | getPresentationScaleOnOwnerSpace() |
Returns the scale of the agent presentation animation
on its space or
1.0 if space isn't defined
or agent list is empty |
IRouteProvider | getRouteProvider() |
Returns the provider of routes for agent movement
|
Agent | getSpace() |
Returns the agent representing space this agent lives in
|
SpaceType | getSpaceType() |
Returns the type of space this agent lives in, one of
SPACE_CONTINUOUS, SPACE_GIS |
double | getSpeed() |
Returns the current value of the agent speed (measured in m/s).
|
double | getSpeed |
Returns the current value of the agent speed.
|
double | getTargetX() |
Returns the x of the target location if moving, otherwise current x.
The exact behavior of this method depends on the underlying space type. |
double | getTargetY() |
Returns the y of the target location if moving, otherwise current y.
The exact behavior of this method depends on the underlying space type. |
double | getVelocity() |
Deprecated.
|
boolean | isAnimationVisible_xjal() | |
boolean | isAutomaticHorizontalRotation() |
Returns
true if agent is set to be rotated (in horizontal
plane) during movement, false otherwise |
boolean | isAutomaticVerticalRotation() |
This functions is valid only for specific set of spaces
|
boolean | isMoving() |
Tests if the agent is currently moving.
|
void | jumpTo |
Instantly moves the agent to a given location (without changes to Z-coordinate, if any).
|
void | jumpTo |
Instantly moves the agent to a given network location.
|
void | jumpTo |
Instantly moves the agent to a given location.
|
void | moveTo |
Starts movement in the direction of the given target location.
|
void | moveTo |
Starts movement to the given network node.
"On arrival" code is executed when movement is finished. |
void | moveTo |
Starts movement in the direction of the given target location.
"On arrival" code is executed when movement is finished. |
void | moveToInTime |
Starts movement in the direction of the given target location.
|
void | moveToInTime |
Starts movement in the direction of the given target location.
|
void | moveToInTime |
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. |
void | moveToInTime |
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. |
void | moveToInTime |
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. |
void | moveToInTime |
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. |
void | moveToNearestAgent |
Starts movement to the nearest agent from the given collection.
|
void | moveToNearestAgent |
Starts movement to the nearest agent from the given collection.
|
void | moveToStraight |
Starts straight movement in the direction of the given target location.
"On arrival" code is executed when movement is finished. |
void | moveToStraightInTime |
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. |
void | moveToStraightInTime |
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. |
void | onExtensionRemoved |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. Default implementation does nothing |
int | priority() |
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) |
void | setArrivalCallback |
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). |
void | setAutomaticHorizontalRotation |
Tells agent to rotate automatically (in horizontal plane) during movements.
|
void | setLevel |
Sets this agent to live in the level, actual for agents in continuous space.
|
void | setNetwork |
Sets this agent to live in the network, actual for agents in continuous space.
|
void | setNetworkInternal | |
void | setNetworkNode |
Sets the current network location for the agent
|
void | setNetworkNode |
Sets the current network location for the agent
|
void | setRouteProvider |
Stops agent If it is moving.
|
void | setSpace |
Sets the space for agent.
|
void | setSpeed |
Changes speed of the agent (measured in m/s).
If the agent is moving, it continues moving with the new speed. |
void | setSpeed |
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. |
void | setVelocity |
Deprecated.
|
void | stop() |
Stops movement, if any.
|
double | timeToArrival() |
Returns the time to arrival to the target location, in model-time units.
If the agent is not moving, returns 0. |
double | timeToArrival |
Returns the time to arrival to the target location, in time units.
If the agent is not moving, returns 0. |
void | updatePosition() |
Updates agent coordinates
|
error, error, getAgent, getSupportedInterfaces_xjal, next_xjal, onDestroy, setNext_xjal, supportsInterface_xjalpublic ExtAgentWithSpatialMetricsDelegate(Agent owner)
public void setSpace(Agent space)
Description copied from interface:
ExtAnimationParamsSets the space for agent. Shouldn't be called for moving agents.
Coordinates and rotations are left "as is"
- Specified by:
setSpacein interfaceExtAnimationParams- Parameters:
space- the agent representing space this agent will live in
public void stop()
Description copied from interface:
ExtAgentWithSpatialMetricsStops movement, if any.
- Specified by:
stopin interfaceExtAgentWithSpatialMetrics
public void moveTo(double x, double y)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts 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.
"On arrival" code is executed when movement is finished.
- Specified by:
moveToin interfaceExtAgentWithSpatialMetrics- Parameters:
x- the x coordinate of the target locationy- the y coordinate of the target location
public Agent getSpace()
Description copied from interface:
ExtAnimationParamsReturns the agent representing space this agent lives in
- Specified by:
getSpacein interfaceExtAnimationParams- Returns:
- the agent representing space this agent lives in
public double getAnimationX()
- Specified by:
getAnimationXin interfaceExtAnimationParams
public double getAnimationY()
- Specified by:
getAnimationYin interfaceExtAnimationParams
public double getAnimationZ()
- Specified by:
getAnimationZin interfaceExtAnimationParams
public Position getAnimationPosition(Position out)
Description copied from interface:
ExtAnimationParams... In case of GIS space this method is equal to
Agent.getPosition(Position)- Specified by:
getAnimationPositionin interfaceExtAnimationParams
public double getPresentationScaleOnOwnerSpace()
Description copied from interface:
ExtAnimationParamsReturns 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:
getPresentationScaleOnOwnerSpacein interfaceExtAnimationParams- Returns:
- the scale of presentation animation on owner space
public void moveTo(Point location)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts movement in the direction of the given target location.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Specified by:
moveToin interfaceExtAgentWithSpatialMetrics- Parameters:
location- the target location
public void moveToInTime(Point location, double tripTime)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in
"On arrival" code is executed when movement is finished.
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:
moveToInTimein interfaceExtAgentWithSpatialMetrics- Parameters:
location- the target locationtripTime- the time of the movement trip
public void moveToStraight(Point location)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts straight movement in the direction of the given target location.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Specified by:
moveToStraightin interfaceExtAgentWithSpatialMetrics- Parameters:
location- the target location
public void moveToStraightInTime(Point location, double tripTime)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts straight movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in
"On arrival" code is executed when movement is finished.
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:
moveToStraightInTimein interfaceExtAgentWithSpatialMetrics- Parameters:
location- the target locationtripTime- the time of the movement trip
public void moveToStraightInTime(Point location, double tripTime, TimeUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts straight movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in
"On arrival" code is executed when movement is finished.
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:
moveToStraightInTimein interfaceExtAgentWithSpatialMetrics- Parameters:
location- the target locationtripTime- the time of the movement tripunits- the time units
public boolean isAnimationVisible_xjal()
- Specified by:
isAnimationVisible_xjalin interfaceExtAnimationParams
public void moveToInTime(Point location, double tripTime, TimeUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts movement in the direction of the given target location.
Changes the speed of the agent in order to reach target in
"On arrival" code is executed when movement is finished.
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:
moveToInTimein interfaceExtAgentWithSpatialMetrics- Parameters:
location- the target locationtripTime- the time of the movement tripunits- the time units
public void moveTo(INode node, Point location)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts movement to the given network node.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Specified by:
moveToin interfaceExtAgentWithSpatialMetrics- Parameters:
node- the network node.location- (optional) location within node, may benull
public void moveToInTime(double x, double y, double tripTime)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts 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.
"On arrival" code is executed when movement is finished.
The exact behavior of this method depends on the underlying space type.
- Specified by:
moveToInTimein interfaceExtAgentWithSpatialMetrics- Parameters:
x- the x coordinate of the target locationy- the y coordinate of the target locationtripTime- the time of the movement trip
public void moveToInTime(double x, double y, double tripTime, TimeUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts 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.
"On arrival" code is executed when movement is finished.
The exact behavior of this method depends on the underlying space type.
- Specified by:
moveToInTimein interfaceExtAgentWithSpatialMetrics- Parameters:
x- the x coordinate of the target locationy- the y coordinate of the target locationtripTime- the time of the movement tripunits- the time units
public void moveToInTime(INode node, Point location, double tripTime)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts movement to the given network node.
Changes the speed of the agent in order to reach target in
"On arrival" code is executed when movement is finished.
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:
moveToInTimein interfaceExtAgentWithSpatialMetrics- Parameters:
node- the network node.location- (optional) location within node, may benulltripTime- the time of the movement trip
public void moveToInTime(INode node, Point location, double tripTime, TimeUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts movement to the given network node.
Changes the speed of the agent in order to reach target in
"On arrival" code is executed when movement is finished.
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:
moveToInTimein interfaceExtAgentWithSpatialMetrics- Parameters:
node- the network node.location- (optional) location within node, may benulltripTime- the time of the movement tripunits- the time units
public void jumpTo(double x, double y)
Description copied from interface:
ExtAgentWithSpatialMetricsInstantly 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
The exact behavior of this method depends on the underlying space type.
Doesn't call "on arrival" code
- Specified by:
jumpToin interfaceExtAgentWithSpatialMetrics- Parameters:
x- the x coordinate of the new locationy- the y coordinate of the new location
public void jumpTo(Point location)
Description copied from interface:
ExtAgentWithSpatialMetricsInstantly moves the agent to a given location.
Terminates any movement.
Doesn't call "on arrival" code
Doesn't call "on arrival" code
- Specified by:
jumpToin interfaceExtAgentWithSpatialMetrics- Parameters:
location- the new location
public void jumpTo(INode node, Point location)
Description copied from interface:
ExtAgentWithSpatialMetricsInstantly moves the agent to a given network location.
Terminates any movement.
Doesn't call "on arrival" code
Doesn't call "on arrival" code
- Specified by:
jumpToin interfaceExtAgentWithSpatialMetrics- Parameters:
node- the network node.location- (optional) location within node, may benull
public void setArrivalCallback(ArrivalCallback arrivalCallback)
Description copied from interface:
ExtAgentWithSpatialMetricsThis 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.
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:
setArrivalCallbackin interfaceExtAgentWithSpatialMetrics- Parameters:
arrivalCallback- the listener which will be notified about agent's arrival
public void moveToNearestAgent(Iterable<? extends Agent> agents)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts movement to the nearest agent from the given collection.
Stops any current movement.
- Specified by:
moveToNearestAgentin interfaceExtAgentWithSpatialMetrics- Parameters:
agents- the collection of agents
public void moveToNearestAgent(Iterable<? extends Agent> agents, double tripTime)
Description copied from interface:
ExtAgentWithSpatialMetricsStarts 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
Changes the speed of the agent in order to reach target in
tripTime
model time units.- Specified by:
moveToNearestAgentin interfaceExtAgentWithSpatialMetrics- Parameters:
agents- the collection of agentstripTime- the time of the movement trip
public <T extends Agent> T getNearestAgent(Iterable<T> agents)
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the nearest agent from the given collection
- Specified by:
getNearestAgentin interfaceExtAgentWithSpatialMetrics- Parameters:
agents- the collection of agents- Returns:
- the nearest agent (never
thisone) ornullif the collection is empty
public <T extends Agent> List<T> agentsInRange(Iterable<T> agents, double distance)
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the unsorted list of agents from the given collection which are within the given
distance from this agent- Specified by:
agentsInRangein interfaceExtAgentWithSpatialMetrics- Parameters:
agents- the collection of agents- Returns:
- the list of agents within the given
distance, unsorted
public <T extends Agent> List<T> agentsInRange(Iterable<T> agents, double distance, LengthUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the unsorted list of agents from the given collection which are within the given
distance from this agent- Specified by:
agentsInRangein interfaceExtAgentWithSpatialMetrics- Parameters:
agents- the collection of agents- Returns:
- the list of agents within the given
distance, unsorted
public void setAutomaticHorizontalRotation(boolean yes)
Description copied from interface:
ExtAgentWithSpatialMetricsTells agent to rotate automatically (in horizontal plane) during movements.
- Specified by:
setAutomaticHorizontalRotationin interfaceExtAgentWithSpatialMetrics- Parameters:
yes-true- agent will be rotated during movement,false- rotation will not be changed- See Also:
public boolean isAutomaticHorizontalRotation()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns
true if agent is set to be rotated (in horizontal
plane) during movement, false otherwise- Specified by:
isAutomaticHorizontalRotationin interfaceExtAgentWithSpatialMetrics- Returns:
trueif agent is set to be rotated during movement- See Also:
public double getTargetX()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the x of the target location if moving, otherwise current x.
The exact behavior of this method depends on the underlying space type.
The exact behavior of this method depends on the underlying space type.
- Specified by:
getTargetXin interfaceExtAgentWithSpatialMetrics- Returns:
- the x of the target location if moving, otherwise current x
public double getTargetY()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the y of the target location if moving, otherwise current y.
The exact behavior of this method depends on the underlying space type.
The exact behavior of this method depends on the underlying space type.
- Specified by:
getTargetYin interfaceExtAgentWithSpatialMetrics- Returns:
- the y of the target location if moving, otherwise current y
public double distanceTo(Agent other)
Description copied from interface:
ExtAgentWithSpatialMetricsCalculates the distance from this agent to another one.
The exact behavior of this method depends on the underlying space type.
The exact behavior of this method depends on the underlying space type.
- Specified by:
distanceToin interfaceExtAgentWithSpatialMetrics- Parameters:
other- another agent- Returns:
- the distance to the other agent
public double distanceTo(Agent other, LengthUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsCalculates the distance from this agent to another one.
The exact behavior of this method depends on the underlying space type.
The exact behavior of this method depends on the underlying space type.
- Specified by:
distanceToin interfaceExtAgentWithSpatialMetrics- Parameters:
other- another agentunits- the units of length- Returns:
- the distance to the other agent
public double distanceTo(Point point)
Description copied from interface:
ExtAgentWithSpatialMetricsCalculates the distance from this agent to the point.
The exact behavior of this method depends on the underlying space type.
The exact behavior of this method depends on the underlying space type.
- Specified by:
distanceToin interfaceExtAgentWithSpatialMetrics- Returns:
- the distance to the point
public double distanceTo(Point point, LengthUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsCalculates the distance from this agent to the point.
The exact behavior of this method depends on the underlying space type.
The exact behavior of this method depends on the underlying space type.
- Specified by:
distanceToin interfaceExtAgentWithSpatialMetricsunits- the units of length- Returns:
- the distance to the point
public double distanceTo(double x, double y)
Description copied from interface:
ExtAgentWithSpatialMetricsCalculates 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:
distanceToin interfaceExtAgentWithSpatialMetrics- Parameters:
x- the x coordinate of the pointy- the y coordinate of the point- Returns:
- the distance of Agent's projection (on the plane Z=0) to the point (x,y)
public double distanceTo(double x, double y, LengthUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsCalculates 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:
distanceToin interfaceExtAgentWithSpatialMetrics- Parameters:
x- the x coordinate of the pointy- the y coordinate of the pointunits- the units of lengths- Returns:
- the distance of Agent's projection (on the plane Z=0) to the point (x,y)
public boolean isMoving()
Description copied from interface:
ExtAgentWithSpatialMetricsTests if the agent is currently moving.
- Specified by:
isMovingin interfaceExtAgentWithSpatialMetrics- Returns:
trueif the agent is moving,falseotherwise
@Deprecated public void setVelocity(double v)
Deprecated.
Description copied from interface:
ExtAgentWithSpatialMetricsChanges 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.
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:
setVelocityin interfaceExtAgentWithSpatialMetrics- Parameters:
v- the new speed
@Deprecated public double getVelocity()
Deprecated.
Description copied from interface:
ExtAgentWithSpatialMetricsReturns 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.
Note that nonzero speed does not mean the agent is moving - it starts moving only after moveTo is called.
- Specified by:
getVelocityin interfaceExtAgentWithSpatialMetrics- Returns:
- the current value of agent speed
public void setSpeed(double speedInMPS)
Description copied from interface:
ExtAgentWithSpatialMetricsChanges 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.
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:
setSpeedin interfaceExtAgentWithSpatialMetrics
public void setSpeed(double s, SpeedUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsChanges 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.
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:
setSpeedin interfaceExtAgentWithSpatialMetrics- Parameters:
s- the new speedunits- the units of speed
public double getSpeed()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns 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.
Note that nonzero speed does not mean the agent is moving - it starts moving only after moveTo is called.
- Specified by:
getSpeedin interfaceExtAgentWithSpatialMetrics- Returns:
- the current value of agent speed, meters per second
public double getSpeed(SpeedUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsReturns 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.
Note that nonzero speed does not mean the agent is moving - it starts moving only after moveTo is called.
- Specified by:
getSpeedin interfaceExtAgentWithSpatialMetrics- Parameters:
units- the units of speed- Returns:
- the current value of agent speed
public double timeToArrival()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the time to arrival to the target location, in model-time units.
If the agent is not moving, returns 0.
If the agent is not moving, returns 0.
- Specified by:
timeToArrivalin interfaceExtAgentWithSpatialMetrics- Returns:
- the time to arrival to the target location, or 0
public double timeToArrival(TimeUnits units)
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the time to arrival to the target location, in time units.
If the agent is not moving, returns 0.
If the agent is not moving, returns 0.
- Specified by:
timeToArrivalin interfaceExtAgentWithSpatialMetrics- Returns:
- the time to arrival to the target location, or 0
public void updatePosition()
Description copied from interface:
ExtAgentWithSpatialMetricsUpdates agent coordinates
- Specified by:
updatePositionin interfaceExtAgentWithSpatialMetrics
public IRouteProvider getRouteProvider()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the provider of routes for agent movement
- Specified by:
getRouteProviderin interfaceExtAgentWithSpatialMetrics- Returns:
- the route provider
public void setRouteProvider(IRouteProvider routeProvider)
Description copied from interface:
ExtAgentWithSpatialMetricsStops 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:
setRouteProviderin interfaceExtAgentWithSpatialMetrics- Parameters:
routeProvider- the route provider
public Level getLevel()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the level this agent lives in, actual for agents in continuous space.
- Specified by:
getLevelin interfaceExtAgentWithSpatialMetrics- Returns:
- the level this agent lives in
public void setLevel(Level level)
Description copied from interface:
ExtAgentWithSpatialMetricsSets this agent to live in the level, actual for agents in continuous space.
- Specified by:
setLevelin interfaceExtAgentWithSpatialMetrics- Parameters:
level- the level this agent will live in
public INetwork getNetwork()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the network this agent lives in, actual for agents in continuous space.
- Specified by:
getNetworkin interfaceExtAgentWithSpatialMetrics- Returns:
- the network this agent lives in
public void setNetwork(INetwork network)
Description copied from interface:
ExtAgentWithSpatialMetricsSets this agent to live in the network, actual for agents in continuous space.
- Specified by:
setNetworkin interfaceExtAgentWithSpatialMetrics- Parameters:
network- the network this agent will live in
public void setNetworkInternal(INetwork network, INode node, Position location)
- Specified by:
setNetworkInternalin interfaceExtAgentWithSpatialMetrics
public INode getNetworkNode()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the network node this agent currently is located in, actual for agents in continuous space.
- Specified by:
getNetworkNodein interfaceExtAgentWithSpatialMetrics- Returns:
- the network node this agent currently is located in
public void setNetworkNode(INode node, Point position)
Description copied from interface:
ExtAgentWithSpatialMetricsSets the current network location for the agent
- Specified by:
setNetworkNodein interfaceExtAgentWithSpatialMetrics- Parameters:
node- the network nodeposition- (optional) location within node, may benull
public void setNetworkNode(INode node)
Description copied from interface:
ExtAgentWithSpatialMetricsSets the current network location for the agent
- Specified by:
setNetworkNodein interfaceExtAgentWithSpatialMetrics- Parameters:
node- the network node
public SpaceType getSpaceType()
Description copied from interface:
ExtAgentWithSpatialMetricsReturns the type of space this agent lives in, one of
SPACE_CONTINUOUS, SPACE_GIS- Specified by:
getSpaceTypein interfaceExtAgentWithSpatialMetrics- Returns:
- one of
SPACE_CONTINUOUS, SPACE_GIS
@AnyLogicInternalAPI public int priority()
Description copied from interface:
AgentExtensionThis 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)
it may be removed/renamed in future.
This function is used for sorting extensions (in order for the overriding delegation to work)
- Specified by:
priorityin interfaceAgentExtension- Overrides:
priorityin classAgentExtensionImpl- Returns:
- int value, see also
P_*constants
@AnyLogicInternalAPI public void onExtensionRemoved(AgentExtension ext)
Description copied from class:
AgentExtensionImplThis method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Default implementation does nothing
it may be removed/renamed in future.
Default implementation does nothing
- Specified by:
onExtensionRemovedin interfaceAgentExtension- Overrides:
onExtensionRemovedin classAgentExtensionImpl- Parameters:
ext- the extension which has just been removed- See Also:
@AnyLogicInternalAPI public final E e()
@AnyLogicInternalAPI public abstract Class<E> extClass()
@AnyLogicInternalAPI public boolean isAutomaticVerticalRotation()
This functions is valid only for specific set of spaces