Package com.anylogic.engine
- Field Summary
- Method Summary
- Method Details
- setNetworkNode
- stop
- moveTo
- moveTo
- moveTo
- moveToInTime
- moveToInTime
- moveToInTime
- moveToInTime
- moveToInTime
- moveToInTime
- moveTo
- moveToInTime
- moveToInTime
- moveTo
- moveToInTime
- moveToInTime
- jumpTo
- moveToStraight
- moveToStraightInTime
- moveToStraightInTime
- setAutomaticVerticalRotation
- isAutomaticVerticalRotation
- getTargetX
- getTargetY
- getTargetZ
- distanceTo
- distanceToSq
- distanceTo
- distanceToSq
- distanceTo
- distanceTo
- distanceToSq
- setVelocity
- getVelocity
- setSpeed
- getSpeed
- timeToArrival
- All Superinterfaces:
AgentExtension
,ExtAgentInteractive
,ExtAgentWithSpatialMetrics
,ExtAnimationParams
,ExtWithSpaceType
,Serializable
- All Known Implementing Classes:
ExtAgentContinuousDelegate
,ExtEntityContinuousDelegate
public interface ExtAgentContinuous extends ExtAgentInteractive, ExtAnimationParams, ExtAgentWithSpatialMetrics, ExtWithSpaceType
An extension of agent designed to support agent based modeling in continuous (3D) space, in particular:
- time (continuous or discrete)
- 3D continuous space
- connections between agents, networks (e.g. social) and their visualization
- communication - message passing and broadcasting
- time (continuous or discrete)
- 3D continuous space
- connections between agents, networks (e.g. social) and their visualization
- communication - message passing and broadcasting
- Author:
- AnyLogic North America, LLC https://anylogic.com
Modifier and Type | Method | Description |
---|---|---|
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 continuous 3D space.
|
double | distanceTo |
Calculates the distance from this agent to a given point in continuous 3D space.
|
double | distanceTo |
Calculates the distance from this agent to another one in continuous 3D space.
|
double | distanceToSq |
Calculates the square of distance from this agent to a given point in the
projection to the horizontal plane (i.e.
|
double | distanceToSq |
Calculates the square of distance from this agent to a given point in continuous 3D space.
(this method has better performance compared to distanceTo(double, double, double) ) |
double | distanceToSq |
Calculates the square of distance from this agent to another one in continuous space.
(this method has better performance compared to distanceTo(Agent) ) |
double | getSpeed |
Returns the current value of the agent speed in continuous space.
|
double | getTargetX() |
Returns the x of the target location if moving, otherwise current x in
continuous space.
|
double | getTargetY() |
Returns the y of the target location if moving, otherwise current y in
continuous space.
|
double | getTargetZ() |
Returns the z of the target location if moving, otherwise current z in
continuous space.
|
double | getVelocity() |
Deprecated.
this function is deprecated since AnyLogic 7.1.
|
boolean | isAutomaticVerticalRotation() |
Returns
true if agent is set to be rotated (in vertical direction,
along Z-axis) during movement in 3D, false otherwise.The returned value has no effect if ExtAgentWithSpatialMetrics.isAutomaticHorizontalRotation() is false |
void | jumpTo |
Instantly moves the agent to a given location.
|
void | moveTo |
Starts movement in the direction of the given target location.
"On arrival" code is executed when movement is finished. |
void | moveTo |
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
|
void | moveTo |
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
|
void | moveTo |
Starts movement to the given attractor.
"On arrival" code is executed when movement is finished. |
void | moveTo |
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
|
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 | moveToInTime |
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
|
void | moveToInTime |
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
|
void | moveToInTime |
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
|
void | moveToInTime |
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
|
void | moveToInTime |
Starts movement to the given attractor.
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 attractor.
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 in
continuous 3D space along a given path.
|
void | moveToInTime |
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
|
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.
"On arrival" code is executed when movement is finished. |
void | moveToStraightInTime |
Starts straight movement in the direction of the given target location.
"On arrival" code is executed when movement is finished. |
void | setAutomaticVerticalRotation |
Tells agent to rotate automatically (in vertical direction, along Z-axis)
during movements in 3D.
Has no effect if ExtAgentWithSpatialMetrics.isAutomaticHorizontalRotation() is false |
void | setNetworkNode |
Sets the current network location for the agent
|
void | setSpeed |
Changes speed of the agent in continuous space
(measured in the given units).
If the agent is moving, it continues moving with the new speed. |
void | setVelocity |
Deprecated.
this function is deprecated since AnyLogic 7.1.
|
void | stop() |
Stops movement, if any.
|
double | timeToArrival() |
Returns the time to arrival to the target location in continuous space, in model-time units.
If the agent is not moving, returns 0. |
addConnection_xjal, agentInfo, connectTo, copyToAndDestroyOnSpaceTypeChange_xjal, deliver, deliver, disconnectFrom, disconnectFromAll, getConnectedAgent, getConnections, getConnectionsNumber, getEnvironment, getRandomConnectedAgent, getSpaceType, isConnectedTo, receive, removeConnection_xjal, restoreConnections_xjal, send, send, setEnvironment_xjal
agentsInRange, agentsInRange, distanceTo, distanceTo, distanceTo, distanceTo, getLevel, getNearestAgent, getNetwork, getNetworkNode, getRouteProvider, getSpaceType, getSpeed, isAutomaticHorizontalRotation, isMoving, jumpTo, jumpTo, jumpTo, moveTo, moveTo, moveTo, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToNearestAgent, moveToNearestAgent, moveToStraight, moveToStraightInTime, moveToStraightInTime, setArrivalCallback, setAutomaticHorizontalRotation, setLevel, setNetwork, setNetworkInternal, setNetworkNode, setNetworkNode, setRouteProvider, setSpeed, timeToArrival, updatePosition
void setNetworkNode(Attractor attractor)
Sets the current network location for the agent
- Parameters:
attractor
- the attractor
void stop()
Stops movement, if any.
- Specified by:
stop
in interfaceExtAgentWithSpatialMetrics
void moveTo(double x, double y, double z)
Starts 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.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationz
- the z coordinate of the target location
void moveTo(double x, double y, Path2D path)
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
Z coordinate of target (and path points) is the same as the current
agent's Z coordinate.
If the agent is currently not on the path, it will first move to
the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationpath
- the polyline along which the agent will move
void moveTo(Attractor attractor)
Starts movement to the given attractor.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
attractor
- the attractor.
void moveToInTime(double x, double y, double z, double tripTime)
Starts 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.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationz
- the z coordinate of the target locationtripTime
- the time of the movement trip
void moveToInTime(double x, double y, double z, 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
"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.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationz
- the z coordinate of the target locationtripTime
- the time of the movement tripunits
- the time units
void moveToInTime(Attractor attractor, double tripTime)
Starts movement to the given attractor.
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.
- Parameters:
attractor
- the attractor.tripTime
- the time of the movement trip
void moveToInTime(Attractor attractor, double tripTime, TimeUnits units)
Starts movement to the given attractor.
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.
- Parameters:
attractor
- the attractor.tripTime
- the time of the movement tripunits
- the time units
void moveToInTime(double x, double y, Path2D path, double tripTime)
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
Z coordinate of target (and path points) is the same as the current
agent's Z coordinate.
If the agent is currently not on the path, it will first move to
the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationpath
- the polyline along which the agent will movetripTime
- the time of the movement trip
void moveToInTime(double x, double y, Path2D path, double tripTime, TimeUnits units)
Starts movement in the direction of the given target location in
continuous 3D space along a given path.
Z coordinate of target (and path points) is the same as the current
agent's Z coordinate.
If the agent is currently not on the path, it will first move to
the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationpath
- the polyline along which the agent will movetripTime
- the time of the movement tripunits
- the time units
void moveTo(Point location, Path3D path)
Starts movement in the direction of the given target location in
continuous 3D space along a given path. If the agent is currently
not on the path, it will first move to the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
location
- the target locationpath
- the polyline along which the agent will move
void moveToInTime(Point location, Path3D path, double tripTime)
Starts movement in the direction of the given target location in
continuous 3D space along a given path. If the agent is currently
not on the path, it will first move to the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
location
- the target locationpath
- the polyline along which the agent will movetripTime
- the time of the movement trip
void moveToInTime(Point location, Path3D path, double tripTime, TimeUnits units)
Starts movement in the direction of the given target location in
continuous 3D space along a given path. If the agent is currently
not on the path, it will first move to the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
location
- the target locationpath
- the polyline along which the agent will movetripTime
- the time of the movement tripunits
- the time units
void moveTo(double x, double y, double z, Path3D path)
Starts movement in the direction of the given target location in
continuous 3D space along a given path. If the agent is currently
not on the path, it will first move to the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationz
- the z coordinate of the target locationpath
- the polyline along which the agent will move
void moveToInTime(double x, double y, double z, Path3D path, double tripTime)
Starts movement in the direction of the given target location in
continuous 3D space along a given path. If the agent is currently
not on the path, it will first move to the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationz
- the z coordinate of the target locationpath
- the polyline along which the agent will movetripTime
- the time of the movement trip
void moveToInTime(double x, double y, double z, Path3D path, double tripTime, TimeUnits units)
Starts movement in the direction of the given target location in
continuous 3D space along a given path. If the agent is currently
not on the path, it will first move to the closest point on the path.
If the target is not on the path, the agent will move along the path
to the point closest to the target, and then move to the target.
"On arrival" code is executed when movement is finished.
"On arrival" code is executed when movement is finished.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationz
- the z coordinate of the target locationpath
- the polyline along which the agent will movetripTime
- the time of the movement tripunits
- the time units
void jumpTo(double x, double y, double z)
Instantly moves the agent to a given location.
Terminates any movement.
Doesn't call "on arrival" code
Doesn't call "on arrival" code
- Parameters:
x
- the x coordinate of the new locationy
- the y coordinate of the new locationz
- the z coordinate of the new location
void moveToStraight(double x, double y, double z)
Starts 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.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationz
- the z coordinate of the target location
void moveToStraightInTime(double x, double y, double z, double tripTime)
Starts 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.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationz
- the z coordinate of the target locationtripTime
- the time of the movement trip- Since:
- 7.1
void moveToStraightInTime(double x, double y, double z, double tripTime, TimeUnits units)
Starts 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.
- Parameters:
x
- the x coordinate of the target locationy
- the y coordinate of the target locationz
- the z coordinate of the target locationtripTime
- the time of the movement tripunits
- the time units- Since:
- 7.1
void setAutomaticVerticalRotation(boolean yes)
Tells agent to rotate automatically (in vertical direction, along Z-axis)
during movements in 3D.
Has no effect if
Has no effect if
ExtAgentWithSpatialMetrics.isAutomaticHorizontalRotation()
is false
- Parameters:
yes
-true
- agent will be rotated during movement (e.g. box travelling on conveyor slope),false
- rotation will not be changed (e.g. passenger going upstairs)- See Also:
boolean isAutomaticVerticalRotation()
Returns
The returned value has no effect if
true
if agent is set to be rotated (in vertical direction,
along Z-axis) during movement in 3D, false
otherwise.The returned value has no effect if
ExtAgentWithSpatialMetrics.isAutomaticHorizontalRotation()
is false
- Returns:
true
if agent is set to be rotated during movement (e.g. box travelling on conveyor slope),false
- rotation will not be changed (e.g. passenger going upstairs)- See Also:
double getTargetX()
Returns the x of the target location if moving, otherwise current x in
continuous space.
- Specified by:
getTargetX
in interfaceExtAgentWithSpatialMetrics
- Returns:
- the x of the target location if moving, otherwise current x
double getTargetY()
Returns the y of the target location if moving, otherwise current y in
continuous space.
- Specified by:
getTargetY
in interfaceExtAgentWithSpatialMetrics
- Returns:
- the y of the target location if moving, otherwise current y
double getTargetZ()
Returns the z of the target location if moving, otherwise current z in
continuous space.
- Returns:
- the z of the target location if moving, otherwise current z
double distanceTo(Agent other)
Calculates the distance from this agent to another one in continuous 3D space.
- Specified by:
distanceTo
in interfaceExtAgentWithSpatialMetrics
- Parameters:
other
- another agent- Returns:
- the distance to the other agent (in pixels)
double distanceToSq(Agent other)
Calculates the square of distance from this agent to another one in continuous space.
(this method has better performance compared to
(this method has better performance compared to
distanceTo(Agent)
)- Parameters:
other
- another agent- Returns:
- the square of distance to the other agent
double distanceTo(double x, double y)
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 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) (in pixels)
double distanceToSq(double x, double y)
Calculates the square of 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).
(this method has better performance compared to
(this method has better performance compared to
distanceTo(double, double)
)- Parameters:
x
- the x coordinate of the pointy
- the y coordinate of the point- Returns:
- the square of distance of Agent's projection (on the plane Z=0) to the point (x,y)
double distanceTo(double x, double y, double z)
Calculates the distance from this agent to a given point in continuous 3D space.
- Parameters:
x
- the x coordinate of the pointy
- the y coordinate of the pointz
- the z coordinate of the point- Returns:
- the distance to the point (x,y,z) (in pixels)
double distanceTo(double x, double y, double z, LengthUnits units)
Calculates the distance from this agent to a given point in continuous 3D space.
- Parameters:
x
- the x coordinate of the pointy
- the y coordinate of the pointz
- the z coordinate of the point- Returns:
- the distance to the point (x,y,z)
double distanceToSq(double x, double y, double z)
Calculates the square of distance from this agent to a given point in continuous 3D space.
(this method has better performance compared to
(this method has better performance compared to
distanceTo(double, double, double)
)- Parameters:
x
- the x coordinate of the pointy
- the y coordinate of the pointz
- the z coordinate of the point- Returns:
- the square of distance to the point (x,y,z)
@Deprecated void setVelocity(double v)
Deprecated.
this function is deprecated since AnyLogic 7.1. Please use
setSpeed(double, SpeedUnits)
insteadChanges speed of the agent in continuous space
(measured in pixels per model-time-unit).
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:
setVelocity
in interfaceExtAgentWithSpatialMetrics
- Parameters:
v
- the new speed
@Deprecated double getVelocity()
Deprecated.
this function is deprecated since AnyLogic 7.1. Please use
#getSpeed(double, SpeedUnits)
insteadReturns the current value of the agent speed in continuous space.
(measured in pixels per model-time-unit).
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:
getVelocity
in interfaceExtAgentWithSpatialMetrics
- Returns:
- the current value of agent speed
void setSpeed(double s, SpeedUnits units)
Changes speed of the agent in continuous space
(measured in the given units).
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:
setSpeed
in interfaceExtAgentWithSpatialMetrics
- Parameters:
v
- the new speedunits
- the speed units
double getSpeed(SpeedUnits units)
Returns the current value of the agent speed in continuous space.
(measured in the given units).
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:
getSpeed
in interfaceExtAgentWithSpatialMetrics
- Parameters:
units
- the speed units- Returns:
- the current value of agent speed
double timeToArrival()
Returns the time to arrival to the target location in continuous space, in model-time units.
If the agent is not moving, returns 0.
If the agent is not moving, returns 0.
- Specified by:
timeToArrival
in interfaceExtAgentWithSpatialMetrics
- Returns:
- the time to arrival to the target location, or 0