AnyLogic
Expand
Font size
All Superinterfaces:
AgentExtension, ExtAgentInteractive, ExtAgentWithSpatialMetrics, ExtAnimationParams, ExtWithSpaceType, 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

Method Summary

Modifier and TypeMethodDescription
doubledistanceByRoute(Agent agent)
Calculates the distance from this agent to another one by route.
In case of GIS environment returns distance measured in meters
doubledistanceTo(double x, double y)
Calculates the distance from this GIS agent to a given point (latitude, longitude) in continuous GIS space, measured in meters.
doubledistanceTo(Agent other)
Calculates the distance from this agent to another one in GIS space.
In case of GIS environment returns distance measured in meters
doublegetGISHeading()
Returns current heading angle (measured in radians CW, starting from North direction) of agent moving in continuous GIS space.
AbstractShapeGISMapgetGISMap()
Returns the GIS map the agent is moving on.
doublegetLat()
Returns the current (up-to-date) latitude of the agent in continuous GIS space.
doublegetLon()
Returns the current (up-to-date) longitude of the agent in continuous GIS space.
<T extends Agent>
T
getNearestAgentByRoute(Iterable<T> agents)
Returns the nearest agent from the given collection.
doublegetTargetLat()
Returns the latitude of the target location if moving, otherwise current latitude in GIS space, measured in degrees (-90 ...
doublegetTargetLon()
Returns the longitude of the target location if moving, otherwise current longitude in GIS space, measured in degrees (-180 ...
doublegetTargetX()
Returns the latitude of the target location if moving, otherwise current latitude in GIS space, measured in degrees (-90 ...
doublegetTargetY()
Returns the longitude of the target location if moving, otherwise current longitude in GIS space, measured in degrees (-180 ...
doublegetVelocity()
Deprecated.
booleanisAnimationVisible_xjal() 
voidjumpTo(double x, double y)
Instantly moves the agent to a given location in GIS space.
voidjumpTo(String geographicPlace)
Finds first geographic point on the Earth and calls method jumpTo(latitude, longitude) with coordinates of the found point
voidmoveTo(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.
voidmoveTo(String geographicPlace)
Finds first geographic point on the Earth and calls method moveTo(latitude, longitude) with coordinates of the found point
voidsetVelocity(double v)
Deprecated.

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.ExtAnimationParams

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

Method Details

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(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(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(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