AnyLogic AnyLogic
Expand
Font size
All Superinterfaces:
AgentExtension, ExtAgentInteractive, ExtAgentWithSpatialMetrics, ExtAnimationParams, ExtWithSpaceType, java.io.Serializable

public interface ExtAgentGIS
extends ExtAgentInteractive, ExtAnimationParams, ExtAgentWithSpatialMetrics, ExtWithSpaceType
An extension of Agent designed to support agent based modeling in continuous GIS space, in particular:
- time (continuous or discrete)
- continuous 2D space based on GIS map
- connections between agents, networks (e.g. social) and their visualization
- communication - message passing and broadcasting
Author:
AnyLogic North America, LLC https://anylogic.com

Field Summary

Fields inherited from interface com.anylogic.engine.AgentExtension

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

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods 
double distanceByRoute​(Agent agent)
Calculates the distance from this agent to another one by route.
In case of GIS environment returns distance measured in meters
double distanceTo​(double x, double y)
Calculates the distance from this GIS agent to a given point (latitude, longitude) in continuous GIS space, measured in meters.
double distanceTo​(Agent other)
Calculates the distance from this agent to another one in GIS space.
In case of GIS environment returns distance measured in meters
double getGISHeading()
Returns current heading angle (measured in radians CW, starting from North direction) of agent moving in continuous GIS space.
AbstractShapeGISMap getGISMap()
Returns the GIS map the agent is moving on.
double getLat()
Returns the current (up-to-date) latitude of the agent in continuous GIS space.
double getLon()
Returns the current (up-to-date) longitude of the agent in continuous GIS space.
<T extends Agent>
T
getNearestAgentByRoute​(java.lang.Iterable<T> agents)
Returns the nearest agent from the given collection.
double getTargetLat()
Returns the latitude of the target location if moving, otherwise current latitude in GIS space, measured in degrees (-90 ...
double getTargetLon()
Returns the longitude of the target location if moving, otherwise current longitude in GIS space, measured in degrees (-180 ...
double getTargetX()
Returns the latitude of the target location if moving, otherwise current latitude in GIS space, measured in degrees (-90 ...
double getTargetY()
Returns the longitude of the target location if moving, otherwise current longitude in GIS space, measured in degrees (-180 ...
double getVelocity()
Deprecated.
boolean isAnimationVisible_xjal()  
void jumpTo​(double x, double y)
Instantly moves the agent to a given location in GIS space.
void jumpTo​(java.lang.String geographicPlace)
Finds first geographic point on the Earth and calls method jumpTo(latitude, longitude) with coordinates of the found point
void moveTo​(double x, double y)
Starts movement in the direction of the given target location in continuous GIS space.
"On arrival" code is executed when movement is finished.
void moveTo​(java.lang.String geographicPlace)
Finds first geographic point on the Earth and calls method moveTo(latitude, longitude) with coordinates of the found point
void setVelocity​(double v)
Deprecated.
Modifier and Type Method Description

Methods inherited from interface com.anylogic.engine.AgentExtension

getAgent, next_xjal, onDestroy, onExtensionRemoved, priority, setNext_xjal, supportsInterface_xjal

Methods inherited from interface com.anylogic.engine.ExtAgentInteractive

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

Methods inherited from interface com.anylogic.engine.ExtAgentWithSpatialMetrics

agentsInRange, agentsInRange, distanceTo, distanceTo, distanceTo, distanceTo, getLevel, getNearestAgent, getNetwork, getNetworkNode, getRouteProvider, getSpaceType, getSpeed, getSpeed, isAutomaticHorizontalRotation, isMoving, jumpTo, jumpTo, moveTo, moveTo, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToInTime, moveToNearestAgent, moveToNearestAgent, moveToStraight, moveToStraightInTime, moveToStraightInTime, setArrivalCallback, setAutomaticHorizontalRotation, setLevel, setNetwork, setNetworkInternal, setNetworkNode, setNetworkNode, setRouteProvider, setSpeed, setSpeed, stop, timeToArrival, timeToArrival, updatePosition

Methods inherited from interface com.anylogic.engine.ExtAnimationParams

getAnimationPosition, getAnimationX, getAnimationY, getAnimationZ, getPresentationScaleOnOwnerSpace, getSpace, setSpace

Method Detail

getGISMap

@AnyLogicInternalAPI
AbstractShapeGISMap getGISMap()
Returns the GIS map the agent is moving on. Throws error if there is no GIS space
Returns:
the GIS map instance

getLat

double getLat()
Returns the current (up-to-date) latitude of the agent in continuous GIS space.
Returns:
the latitude of the current location, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)

getLon

double getLon()
Returns the current (up-to-date) longitude of the agent in continuous GIS space.
Returns:
the longitude of the current location, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

getGISHeading

double getGISHeading()
Returns current heading angle (measured in radians CW, starting from North direction) of agent moving in continuous GIS space.
Returns:
the current GIS heading angle (measured in radians CW, starting from North direction)

distanceTo

double distanceTo​(Agent other)
Calculates the distance from this agent to another one in GIS space.
In case of GIS environment returns distance measured in meters
Specified by:
distanceTo in interface ExtAgentWithSpatialMetrics
Parameters:
other - another agent
Returns:
the distance to the other agent

distanceByRoute

double distanceByRoute​(Agent agent)
Calculates the distance from this agent to another one by route.
In case of GIS environment returns distance measured in meters
Parameters:
other - another agent
Returns:
the distance to the other agent

getNearestAgentByRoute

<T extends Agent> T getNearestAgentByRoute​(java.lang.Iterable<T> agents)
Returns the nearest agent from the given collection. Distance calculates by route provider.
Parameters:
agents - the collection of agents
Returns:
the closest agent

distanceTo

double distanceTo​(double x,
                  double y)
Calculates the distance from this GIS agent to a given point (latitude, longitude) in continuous GIS space, measured in meters.
Specified by:
distanceTo in interface ExtAgentWithSpatialMetrics
Parameters:
x - the latitude of the point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
y - the longitude of the point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Returns:
the distance to the point (x,y)

jumpTo

void jumpTo​(double x,
            double y)
Instantly moves the agent to a given location in GIS space. Terminates any movement.
Doesn't call "on arrival" code
Specified by:
jumpTo in interface ExtAgentWithSpatialMetrics
Parameters:
x - the latitude of the new location, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
y - the longitude of the new location, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

jumpTo

void jumpTo​(java.lang.String geographicPlace)
Finds first geographic point on the Earth and calls method jumpTo(latitude, longitude) with coordinates of the found point
Parameters:
geographicPlace -

moveTo

void moveTo​(double x,
            double y)
Starts movement in the direction of the given target location in continuous GIS space.
"On arrival" code is executed when movement is finished.
Specified by:
moveTo in interface ExtAgentWithSpatialMetrics
Parameters:
x - the latitude of the target location, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
y - the longitude of the target location, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)

moveTo

void moveTo​(java.lang.String geographicPlace)
Finds first geographic point on the Earth and calls method moveTo(latitude, longitude) with coordinates of the found point
Parameters:
geographicPlace -

setVelocity

@Deprecated
void setVelocity​(double v)
Deprecated.
Changes speed of the agent in continuous space (measured in pixels per model-time-unit, and in GIS-based environments - 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:
setVelocity in interface ExtAgentWithSpatialMetrics
Parameters:
v - the new speed

getVelocity

@Deprecated
double getVelocity()
Deprecated.
Returns the current value of the agent speed in continuous space. (measured in pixels per model-time-unit, and in GIS-based environments - in m/s).
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

getTargetX

double getTargetX()
Returns the latitude of the target location if moving, otherwise current latitude in GIS space, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
Specified by:
getTargetX in interface ExtAgentWithSpatialMetrics
Returns:
the latitude of the target location if moving, otherwise current latitude

getTargetY

double getTargetY()
Returns the longitude of the target location if moving, otherwise current longitude in GIS space, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Specified by:
getTargetY in interface ExtAgentWithSpatialMetrics
Returns:
the longitude of the target location if moving, otherwise current longitude

getTargetLon

double getTargetLon()
Returns the longitude of the target location if moving, otherwise current longitude in GIS space, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Returns:
the longitude of the target location if moving, otherwise current longitude

getTargetLat

double getTargetLat()
Returns the latitude of the target location if moving, otherwise current latitude in GIS space, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
Returns:
the latitude of the target location if moving, otherwise current latitude

isAnimationVisible_xjal

@AnyLogicInternalAPI
boolean isAnimationVisible_xjal()
Specified by:
isAnimationVisible_xjal in interface ExtAnimationParams
How can we improve this article?