@AnyLogicInternalAPI public interface ExtAgentWithSpatialMetrics extends ExtAnimationParams
P_AGENT_INTERACTIVE_DELEGATE, P_AGENT_WITH_SPATIAL_METRICS_DELEGATE, P_AGENT_WITH_SPECIFIC_SPACE, P_AGENT_WITH_SPECIFIC_SPACE_DELEGATE, P_ENTITY_DELEGATE, P_ENV_WITH_SPECIFIC_SPACE, P_ROOT, P_SPACE, P_USER_EXT
Modifier and Type | Method and Description |
---|---|
<T extends Agent> |
agentsInRange(java.lang.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> |
agentsInRange(java.lang.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 |
double |
distanceTo(Agent other)
Calculates the distance from this agent to another one.
|
double |
distanceTo(Agent other,
LengthUnits units)
Calculates the distance from this agent to another one.
|
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).
|
double |
distanceTo(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. agent's Z coordinate isn't
used in the calculation).
|
double |
distanceTo(Point point)
Calculates the distance from this agent to the point.
|
double |
distanceTo(Point point,
LengthUnits units)
Calculates the distance from this agent to the point.
|
Level |
getLevel()
Returns the level this agent lives in, actual for agents in continuous space.
|
<T extends Agent> |
getNearestAgent(java.lang.Iterable<T> agents)
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.
|
IRouteProvider |
getRouteProvider()
Returns the provider of routes for agent movement
|
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(SpeedUnits units)
Returns the current value of the agent speed.
|
double |
getTargetX()
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.
|
double |
getVelocity()
Deprecated.
|
boolean |
isAutomaticHorizontalRotation()
Returns
true if agent is set to be rotated (in horizontal
plane) during movement, false otherwise |
boolean |
isMoving()
Tests if the agent is currently moving.
|
void |
jumpTo(double x,
double y)
Instantly moves the agent to a given location (without changes to Z-coordinate, if any).
|
void |
jumpTo(INode node,
Point location)
Instantly moves the agent to a given network location.
|
void |
jumpTo(Point location)
Instantly moves the agent to a given location.
|
void |
moveTo(double x,
double y)
Starts movement in the direction of the given target location.
|
void |
moveTo(INode node,
Point location)
Starts movement to the given network node.
|
void |
moveTo(Point location)
Starts movement in the direction of the given target location.
|
void |
moveToInTime(double x,
double y,
double tripTime)
Starts movement in the direction of the given target location.
|
void |
moveToInTime(double x,
double y,
double tripTime,
TimeUnits units)
Starts movement in the direction of the given target location.
|
void |
moveToInTime(INode node,
Point location,
double tripTime)
Starts movement to the given network node.
|
void |
moveToInTime(INode node,
Point location,
double tripTime,
TimeUnits units)
Starts movement to the given network node.
|
void |
moveToInTime(Point location,
double tripTime)
Starts movement in the direction of the given target location.
|
void |
moveToInTime(Point location,
double tripTime,
TimeUnits units)
Starts movement in the direction of the given target location.
|
void |
moveToNearestAgent(java.lang.Iterable<? extends Agent> agents)
Starts movement to the nearest agent from the given collection.
|
void |
moveToNearestAgent(java.lang.Iterable<? extends Agent> agents,
double tripTime)
Starts movement to the nearest agent from the given collection.
|
void |
moveToStraight(Point location)
Starts straight movement in the direction of the given target location.
|
void |
moveToStraightInTime(Point location,
double tripTime)
Starts straight movement in the direction of the given target location.
|
void |
moveToStraightInTime(Point location,
double tripTime,
TimeUnits units)
Starts straight movement in the direction of the given target location.
|
void |
setArrivalCallback(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.
|
void |
setAutomaticHorizontalRotation(boolean yes)
Tells agent to rotate automatically (in horizontal plane) during movements.
|
void |
setLevel(Level level)
Sets this agent to live in the level, actual for agents in continuous space.
|
void |
setNetwork(INetwork network)
Sets this agent to live in the network, actual for agents in continuous space.
|
void |
setNetworkInternal(INetwork network,
INode node,
Position location) |
void |
setNetworkNode(INode node)
Sets the current network location for the agent
|
void |
setNetworkNode(INode node,
Point position)
Deprecated.
|
void |
setRouteProvider(IRouteProvider routeProvider)
Stops agent If it is moving.
|
void |
setSpeed(double speedInMPS)
Changes speed of the agent (measured in m/s).
|
void |
setSpeed(double s,
SpeedUnits units)
Changes speed of the agent
(the units of the value depend on the specific space type).
|
void |
setVelocity(double v)
Deprecated.
|
void |
stop()
Stops movement, if any.
|
double |
timeToArrival()
Returns the time to arrival to the target location, in model-time units.
|
double |
timeToArrival(TimeUnits units)
Returns the time to arrival to the target location, in time units.
|
void |
updatePosition()
Updates agent coordinates
|
getAnimationPosition, getAnimationX, getAnimationY, getAnimationZ, getPresentationScaleOnOwnerSpace, getSpace, isAnimationVisible_xjal, setSpace
getAgent, next_xjal, onDestroy, onExtensionRemoved, priority, setNext_xjal, supportsInterface_xjal
void stop()
void moveTo(double x, double y)
x
- the x coordinate of the target locationy
- the y coordinate of the target locationvoid moveTo(Point location)
location
- the target locationvoid moveToInTime(Point location, double tripTime)
tripTime
model time units.location
- the target locationtripTime
- the time of the movement tripvoid moveToInTime(Point location, double tripTime, TimeUnits units)
tripTime
model time units.location
- the target locationtripTime
- the time of the movement tripunits
- the time unitsvoid moveToStraight(Point location)
location
- the target locationvoid moveToStraightInTime(Point location, double tripTime)
tripTime
model time units.location
- the target locationtripTime
- the time of the movement tripvoid moveToStraightInTime(Point location, double tripTime, TimeUnits units)
tripTime
model time units.location
- the target locationtripTime
- the time of the movement tripunits
- the time unitsvoid moveTo(INode node, Point location)
node
- the network node.location
- (optional) location within node, may be null
void moveToInTime(double x, double y, double tripTime)
x
- the x coordinate of the target locationy
- the y coordinate of the target locationtripTime
- the time of the movement tripvoid moveToInTime(double x, double y, double tripTime, TimeUnits units)
x
- the x coordinate of the target locationy
- the y coordinate of the target locationtripTime
- the time of the movement tripunits
- the time unitsvoid moveToInTime(INode node, Point location, double tripTime)
tripTime
model time units.node
- the network node.location
- (optional) location within node, may be null
tripTime
- the time of the movement tripvoid moveToInTime(INode node, Point location, double tripTime, TimeUnits units)
tripTime
model time units.node
- the network node.location
- (optional) location within node, may be null
tripTime
- the time of the movement tripunits
- the time unitsvoid jumpTo(double x, double y)
x
- the x coordinate of the new locationy
- the y coordinate of the new locationvoid jumpTo(Point location)
location
- the new locationvoid jumpTo(INode node, Point location)
node
- the network node.location
- (optional) location within node, may be null
void setArrivalCallback(ArrivalCallback arrivalCallback)
arrivalCallback
- the listener which will be notified about agent's arrivalvoid moveToNearestAgent(java.lang.Iterable<? extends Agent> agents)
agents
- the collection of agentsvoid moveToNearestAgent(java.lang.Iterable<? extends Agent> agents, double tripTime)
tripTime
model time units.agents
- the collection of agentstripTime
- the time of the movement trip<T extends Agent> T getNearestAgent(java.lang.Iterable<T> agents)
agents
- the collection of agentsthis
one)
or null
if the collection is empty<T extends Agent> java.util.List<T> agentsInRange(java.lang.Iterable<T> agents, double distance)
distance
from this agentagents
- the collection of agentsdistance
, unsorted<T extends Agent> java.util.List<T> agentsInRange(java.lang.Iterable<T> agents, double distance, LengthUnits units)
distance
from this agentagents
- the collection of agentsdistance
, unsortedvoid setAutomaticHorizontalRotation(boolean yes)
yes
- true
- agent will be rotated during movement,
false
- rotation will not be changed#setRotation(double)
boolean isAutomaticHorizontalRotation()
true
if agent is set to be rotated (in horizontal
plane) during movement, false
otherwisetrue
if agent is set to be rotated during movementsetAutomaticHorizontalRotation(boolean)
double getTargetX()
double getTargetY()
double distanceTo(Agent other)
other
- another agentdouble distanceTo(Agent other, LengthUnits units)
other
- another agentunits
- the units of lengthdouble distanceTo(Point point)
point
- double distanceTo(Point point, LengthUnits units)
point
- units
- the units of lengthdouble distanceTo(double x, double y)
x
- the x coordinate of the pointy
- the y coordinate of the pointdouble distanceTo(double x, double y, LengthUnits units)
x
- the x coordinate of the pointy
- the y coordinate of the pointunits
- the units of lengthsboolean isMoving()
true
if the agent is moving, false
otherwise@Deprecated void setVelocity(double v)
v
- the new speed@Deprecated double getVelocity()
void setSpeed(double speedInMPS)
s
- the new speed, meters per secondvoid setSpeed(double s, SpeedUnits units)
s
- the new speedunits
- the units of speeddouble getSpeed()
double getSpeed(SpeedUnits units)
units
- the units of speeddouble timeToArrival()
double timeToArrival(TimeUnits units)
unit
- the time unitsvoid updatePosition()
Level getLevel()
void setLevel(Level level)
level
- the level this agent will live inINetwork getNetwork()
void setNetwork(INetwork network)
network
- the network this agent will live in@AnyLogicInternalAPI void setNetworkInternal(INetwork network, INode node, Position location)
INode getNetworkNode()
@Deprecated void setNetworkNode(INode node, Point position)
node
- the network nodeposition
- (optional) location within node, may be null
void setNetworkNode(INode node)
node
- the network nodeSpaceType getSpaceType()
SPACE_CONTINUOUS, SPACE_GIS
SPACE_CONTINUOUS, SPACE_GIS
IRouteProvider getRouteProvider()
void setRouteProvider(IRouteProvider routeProvider)
routeProvider
- the route providerCopyright © AnyLogic North America, LLC. All Rights Reserved.