AnyLogic
Expand
Font size
All Implemented Interfaces:
IRouteProvider<ShortestPathData<GISNode,GISRoute>>, INetwork<GISNode,GISRoute>, Serializable

public class GISNetwork
extends AbstractNetwork<GISNode,GISRoute,ShapeGISMap>
Implementation of network for agent movement in GIS space.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
GISNetwork(ShapeGISMap map, String name)
Creates an empty network without nodes and edges.
GISNetwork(ShapeGISMap map, String name, boolean visible)
Creates an empty network without nodes and edges.
GISNetwork(ShapeGISMap map, String name, boolean visible, GISMarkupElement... markupShapes)
Creates network with nodes and edges in GIS space and initializes it.

Method Summary

Modifier and TypeMethodDescription
voidaddAll(GISMarkupElement... markupShapes)
Adds nodes and relations to this network.
Stream<? extends AbstractMarkup>elementsInternal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
final Class<? extends ExtAgentWithSpatialMetrics>getCompatibleAgentExtensionClass()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
GISNodegetNearestNode(double lat, double lon)
Returns the node in this network that is the closest to the given latitude and longitude
doublegetPlainDistance(Point firstPoint, Point secondPoint)
Straight line distance between two points.
AgentgetSpace()
Returns the space where the markup element is defined
voidinitialize()
Initialization of markup aggregator (e.g.

Methods inherited from class com.anylogic.engine.markup.AbstractMarkupAggregator

error, getName, getOwner, initializeInternal, isVisible, onAggregatorVisibilityChanged, setVisible

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

GISNetwork

public GISNetwork(ShapeGISMap map,
 String name)
Creates an empty network without nodes and edges. Use methods add(GISNode) and add(GISRoute) to fill network then call initialize() method to prepare network for using in an agent's movement.
Parameters:
map - GIS map which network is painted by
name - the name of the network

GISNetwork

public GISNetwork(ShapeGISMap map,
 String name,
 boolean visible)
Creates an empty network without nodes and edges. Use methods add(GISNode) and add(GISRoute) to fill network then call initialize() method to prepare network for using in an agent's movement.
Parameters:
map - GIS map which network is painted by
name - the name of the network
visible - determines visibility of network's elements

GISNetwork

public GISNetwork(ShapeGISMap map,
 String name,
 boolean visible,
 GISMarkupElement... markupShapes)
Creates network with nodes and edges in GIS space and initializes it. Network can't be modified after initialization.
Parameters:
map - GIS map which network is painted by
name - the name of the network
visible - determines visibility of network's markup elements
markupShapes - markup elements

Method Details

initialize

public void initialize()
Initialization of markup aggregator (e.g. network).It can't be modified since this method has been called.

elementsInternal

@AnyLogicInternalAPI
public Stream<? extends AbstractMarkup> elementsInternal()
Description copied from class: AbstractMarkupAggregator
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
elementsInternal in class AbstractMarkupAggregator<ShapeGISMap>

addAll

public void addAll(GISMarkupElement... markupShapes)
Adds nodes and relations to this network. The network should be uninitialized.
Parameters:
markupShapes - elements to be added

getNearestNode

public GISNode getNearestNode(double lat,
 double lon)
Returns the node in this network that is the closest to the given latitude and longitude
Parameters:
lat - latitude
lon - longitude
Returns:
nearest node to the specified coords

getSpace

public Agent getSpace()
Description copied from interface: INetwork
Returns the space where the markup element is defined
Returns:
the space associated with this element

getPlainDistance

public double getPlainDistance(Point firstPoint,
 Point secondPoint)
Description copied from interface: INetwork
Straight line distance between two points.
Specified by:
getPlainDistance in interface INetwork<GISNode,GISRoute>
Specified by:
getPlainDistance in class AbstractNetwork<GISNode,GISRoute,ShapeGISMap>
Returns:
distance between two points

getCompatibleAgentExtensionClass

@AnyLogicInternalAPI
public final Class<? extends ExtAgentWithSpatialMetrics> getCompatibleAgentExtensionClass()
Description copied from interface: INetwork
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.