AnyLogic AnyLogic
Expand
Font size
All Implemented Interfaces:
IRouteProvider<ShortestPathData<GISNode,​GISRoute>>, INetwork<GISNode,​GISRoute>, java.io.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

Constructors 
GISNetwork​(ShapeGISMap map, java.lang.String name)
Creates an empty network without nodes and edges.
GISNetwork​(ShapeGISMap map, java.lang.String name, boolean visible)
Creates an empty network without nodes and edges.
GISNetwork​(ShapeGISMap map, java.lang.String name, boolean visible, GISMarkupElement... markupShapes)
Creates network with nodes and edges in GIS space and initializes it.
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
void addAll​(GISMarkupElement... markupShapes)
Adds nodes and relations to this network.
java.util.stream.Stream<? extends AbstractMarkup> elementsInternal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
java.lang.Class<? extends ExtAgentWithSpatialMetrics> getCompatibleAgentExtensionClass()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
GISNode getNearestNode​(double lat, double lon)
Returns the node in this network that is the closest to the given latitude and longitude
double getPlainDistance​(Point firstPoint, Point secondPoint)
Straight line distance between two points.
Agent getSpace()
Returns the space where the markup element is defined
void initialize()
Initialization of markup aggregator (e.g. network).It can't be modified since this method has been called.
Modifier and Type Method Description

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

add, add, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getDistance, getLength, getNearestNetworkElement, getNearestNetworkElement, getNearestNetworkElement, getNearestNode, getNearestNode, getNearestNode, getNearestNode, getNearestPath, getNearestPath, getNearestPath, getNode, getNodeCount, getPath, getPathCount, getPathData, getPlainDistance, getPosition, getPosition, getPositionAtOffset, getRelatedNetworks, nodes, paths, ports

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 Detail

GISNetwork

public GISNetwork​(ShapeGISMap map,
                  java.lang.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,
                  java.lang.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,
                  java.lang.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 Detail

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 java.util.stream.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 java.lang.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.
How can we improve this article?