Package com.anylogic.engine.markup
- Method Summary
- Method Details
- add
- add
- getNearestNode
- getNearestNetworkElement
- getNearestNetworkElement
- getNode
- getNodeCount
- getPath
- getPathCount
- ports
- nodes
- paths
- getRelatedNetworks
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getDistance
- getPlainDistance
- getPlainDistance
- getPosition
- getPosition
- getSpace
- getCompatibleAgentExtensionClass
- All Superinterfaces:
IRouteProvider<ShortestPathData<N,
,P>> Serializable
- All Known Implementing Classes:
AbstractNetwork
,ConveyorNetwork
,GISNetwork
,Network
public interface INetwork<N extends INode<N,P>, extends IRouteProvider<ShortestPathData<N,P extends IPath<N>> P>>
Basic interface of network for agent movement based on markup elements.
- Author:
- AnyLogic North America, LLC https://anylogic.com
Modifier and Type | Method | Description |
---|---|---|
void | add |
Adds node to network.
|
void | add |
Adds relation to network.
|
Class<? extends ExtAgentWithSpatialMetrics> | getCompatibleAgentExtensionClass() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance between two points using the network paths.
|
double | getDistance |
Calculates the distance from source object in the network to the target object.
|
double | getDistance |
Calculates the distance from source object in the network to the target object.
|
double | getDistance |
Calculates the distance from source object in the network to the target object.
|
double | getDistance |
Calculates the distance from source object in the network to the target object.
|
double | getDistance |
Calculates the distance from source object in the network to the target object.
|
double | getDistance |
Calculates the distance from source object in the network to the target object.
|
double | getDistance |
Calculates the distance from source object in the network to the target object.
|
double | getDistance |
Calculates the distance from source object in the network to the target object.
|
INetworkMarkupElement | getNearestNetworkElement |
Looking for the closest markup element in this network to the given coordinates.
|
INetworkMarkupElement | getNearestNetworkElement |
Looking for the closest markup element in this network to the given point.
|
N | getNearestNode |
Looking for the closest node in this network to the given point.
|
N | getNode | |
int | getNodeCount() |
Amount of nodes in this network.
|
P | getPath | |
int | getPathCount() |
Amount of paths in this network.
|
double | getPlainDistance |
Straight line distance between two points.
|
double | getPlainDistance |
Straight line distance between two points in given units of length.
|
Position | getPosition |
Calculates current position on the shortest path through network by the given offset
|
Position | getPosition |
Calculates current position on the shortest path through network by the given offset
|
List<INetwork<?, | getRelatedNetworks() | |
Agent | getSpace() |
Returns the space where the markup element is defined
|
List<N> | nodes() | |
List<P> | paths() | |
List<NetworkPort> | ports() |
void add(N n)
Adds node to network. Don't call this method when network has been initialized.
- Parameters:
n
- network node, instance ofINode
void add(P p)
Adds relation to network. Don't call this method when network has been initialized.
- Parameters:
p
- network path, instance ofIPath
N getNearestNode(Point p)
Looking for the closest node in this network to the given point.
- Parameters:
p
- the given point- Returns:
INetworkMarkupElement getNearestNetworkElement(double x, double y, double z, Point out)
Looking for the closest markup element in this network to the given coordinates.
- Parameters:
x
- the x given coordinatey
- the y given coordinatez
- the z given coordinateout
- the point in this markup element nearest to the given coordinates- Returns:
- nearest markup element
INetworkMarkupElement getNearestNetworkElement(Point givenPoint, Point out)
Looking for the closest markup element in this network to the given point.
- Parameters:
givenPoint
- the given pointout
- the point in this markup element nearest to the given point- Returns:
- nearest markup element
N getNode(int index)
int getNodeCount()
Amount of nodes in this network.
- Returns:
- amount of nodes
P getPath(int index)
int getPathCount()
Amount of paths in this network.
- Returns:
- amount of paths
List<NetworkPort> ports()
- Returns:
- all ports of this network
List<N> nodes()
- Returns:
- all nodes of this network
List<P> paths()
- Returns:
- all paths of this network
@AnyLogicInternalAPI List<INetwork<?,?>> getRelatedNetworks()
- Returns:
- list of related networks
double getDistance(N from, N to, ShortestPathData<N, P> data)
Calculates the distance from source object in the network to the target object. Source and target points can be
extracted from source and target objects in the following ways:
From network node - extracted point is a connection point of the node and the path, that will be used to calculate distance
From path and offset - extracted point lies at the certain distance (offset) from the start of the path
- Parameters:
from
- from nodeto
- to nodedata
- output object to write to, may be null- Returns:
- distance between two points in the network
double getDistance(N from, N to, ShortestPathData<N, P> data, LengthUnits units)
Calculates the distance from source object in the network to the target object. Source and target points can be
extracted from source and target objects in the following ways:
From network node - extracted point is a connection point of the node and the path, that will be used to calculate distance
From path and offset - extracted point lies at the certain distance (offset) from the start of the path
- Parameters:
from
- source nodeto
- target nodedata
- output object to write to, may be nullunits
- length units- Returns:
- distance between two points in the network
double getDistance(N from, P to, double toOffset, ShortestPathData<N, P> data)
Calculates the distance from source object in the network to the target object. Source and target points can be
extracted from source and target objects in the following ways:
From network node - extracted point is a connection point of the node and the path, that will be used to calculate distance
From path and offset - extracted point lies at the certain distance (offset) from the start of the path
- Parameters:
from
- source nodeto
- target pathtoOffset
- offset on the target pathdata
- output object to write to, may be null- Returns:
- distance between two points in the network
double getDistance(N from, P to, double toOffset, ShortestPathData<N, P> data, LengthUnits units)
Calculates the distance from source object in the network to the target object. Source and target points can be
extracted from source and target objects in the following ways:
From network node - extracted point is a connection point of the node and the path, that will be used to calculate distance
From path and offset - extracted point lies at the certain distance (offset) from the start of the path
- Parameters:
from
- source nodeto
- target pathtoOffset
- offset on the target pathdata
- output object to write to, may be nullunits
- length units- Returns:
- distance between two points in the network
double getDistance(P from, double fromOffset, N to, ShortestPathData<N, P> data)
Calculates the distance from source object in the network to the target object. Source and target points can be
extracted from source and target objects in the following ways:
From network node - extracted point is a connection point of the node and the path, that will be used to calculate distance
From path and offset - extracted point lies at the certain distance (offset) from the start of the path
- Parameters:
from
- source pathfromOffset
- offset on the source pathto
- target nodedata
- output object to write to, may be null- Returns:
- distance between two points in the network
double getDistance(P from, double fromOffset, N to, ShortestPathData<N, P> data, LengthUnits units)
Calculates the distance from source object in the network to the target object. Source and target points can be
extracted from source and target objects in the following ways:
From network node - extracted point is a connection point of the node and the path, that will be used to calculate distance
From path and offset - extracted point lies at the certain distance (offset) from the start of the path
- Parameters:
from
- source pathfromOffset
- offset on the source pathto
- target nodedata
- output object to write to, may be nullunits
- length units- Returns:
- distance between two points in the network
double getDistance(P from, double fromOffset, P to, double toOffset, ShortestPathData<N, P> data)
Calculates the distance from source object in the network to the target object. Source and target points can be
extracted from source and target objects in the following ways:
From network node - extracted point is a connection point of the node and the path, that will be used to calculate distance
From path and offset - extracted point lies at the certain distance (offset) from the start of the path
- Parameters:
from
- source pathfromOffset
- offset on the source pathto
- target pathtoOffset
- offset on the target pathdata
- output object to write to, may be null- Returns:
- distance between two points in the network
double getDistance(P from, double fromOffset, P to, double toOffset, ShortestPathData<N, P> data, LengthUnits units)
Calculates the distance from source object in the network to the target object. Source and target points can be
extracted from source and target objects in the following ways:
From network node - extracted point is a connection point of the node and the path, that will be used to calculate distance
From path and offset - extracted point lies at the certain distance (offset) from the start of the path
- Parameters:
from
- source pathfromOffset
- offset on the source pathto
- target pathtoOffset
- offset on the target pathdata
- output object to write to, may be nullunits
- length units- Returns:
- distance between two points in the network
double getDistance(Point source, Point target, N from, N to, ShortestPathData<N, P> data)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
You have two options in terms of 'connecting' the source point to the network start point and the network end point to the target point, namely:
Specifying the network node. The network point will lie at the connection point of the node and the path, that will be used to calculate distance
Specifying the path and the offset. The network point will lie at the certain distance (offset) from the start of this path
- Parameters:
source
- source pointtarget
- target pointfrom
- network starting nodeto
- network end nodedata
- output object to write into, may be null- Returns:
- the distance between two points if traveling using network
double getDistance(Point source, Point target, N from, N to, ShortestPathData<N, P> data, LengthUnits units)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
You have two options in terms of 'connecting' the source point to the network start point and the network end point to the target point, namely:
Specifying the network node. The network point will lie at the connection point of the node and the path, that will be used to calculate distance
Specifying the path and the offset. The network point will lie at the certain distance (offset) from the start of this path
- Parameters:
source
- source pointtarget
- target pointfrom
- network starting nodeto
- network end nodedata
- output object to write into, may be nullunits
- length units- Returns:
- the distance between two points if traveling using network
double getDistance(Point source, Point target, N from, P to, double toOffset, ShortestPathData<N, P> data)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
You have two options in terms of 'connecting' the source point to the network start point and the network end point to the target point, namely:
Specifying the network node. The network point will lie at the connection point of the node and the path, that will be used to calculate distance
Specifying the path and the offset. The network point will lie at the certain distance (offset) from the start of this path
- Parameters:
source
- source pointtarget
- target pointfrom
- network starting nodeto
- network end pathtoOffset
- offset on the network end pathdata
- output object to write into, may be null- Returns:
- the distance between two points if traveling using network
double getDistance(Point source, Point target, N from, P to, double toOffset, ShortestPathData<N, P> data, LengthUnits units)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
You have two options in terms of 'connecting' the source point to the network start point and the network end point to the target point, namely:
Specifying the network node. The network point will lie at the connection point of the node and the path, that will be used to calculate distance
Specifying the path and the offset. The network point will lie at the certain distance (offset) from the start of this path
- Parameters:
source
- source pointtarget
- target pointfrom
- network starting nodeto
- network end pathtoOffset
- offset on the network end pathdata
- output object to write into, may be nullunits
- length units- Returns:
- the distance between two points if traveling using network
double getDistance(Point source, Point target, P from, double fromOffset, N to, ShortestPathData<N, P> data)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
You have two options in terms of 'connecting' the source point to the network start point and the network end point to the target point, namely:
Specifying the network node. The network point will lie at the connection point of the node and the path, that will be used to calculate distance
Specifying the path and the offset. The network point will lie at the certain distance (offset) from the start of this path
- Parameters:
source
- source pointtarget
- target pointfrom
- network starting pathfromOffset
- offset on the network starting pathto
- network end nodedata
- output object to write into, may be null- Returns:
- the distance between two points if traveling using network
double getDistance(Point source, Point target, P from, double fromOffset, N to, ShortestPathData<N, P> data, LengthUnits units)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
You have two options in terms of 'connecting' the source point to the network start point and the network end point to the target point, namely:
Specifying the network node. The network point will lie at the connection point of the node and the path, that will be used to calculate distance
Specifying the path and the offset. The network point will lie at the certain distance (offset) from the start of this path
- Parameters:
source
- source pointtarget
- target pointfrom
- network starting pathfromOffset
- offset on the network starting pathto
- network end nodedata
- output object to write into, may be nullunits
- length units- Returns:
- the distance between two points if traveling using network
double getDistance(Point source, Point target, P from, double fromOffset, P to, double toOffset, ShortestPathData<N, P> data)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
You have two options in terms of 'connecting' the source point to the network start point and the network end point to the target point, namely:
Specifying the network node. The network point will lie at the connection point of the node and the path, that will be used to calculate distance
Specifying the path and the offset. The network point will lie at the certain distance (offset) from the start of this path
- Parameters:
source
- source pointtarget
- target pointfrom
- network starting pathfromOffset
- offset on the network starting pathto
- network end pathtoOffset
- offset on the network end pathdata
- output object to write into, may be null- Returns:
- the distance between two points if traveling using network
double getDistance(Point source, Point target, P from, double fromOffset, P to, double toOffset, ShortestPathData<N, P> data, LengthUnits units)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
You have two options in terms of 'connecting' the source point to the network start point and the network end point to the target point, namely:
Specifying the network node. The network point will lie at the connection point of the node and the path, that will be used to calculate distance
Specifying the path and the offset. The network point will lie at the certain distance (offset) from the start of this path
- Parameters:
source
- source pointtarget
- target pointfrom
- network starting pathfromOffset
- offset on the network starting pathto
- network end pathtoOffset
- offset on the network end pathdata
- output object to write into, may be nullunits
- length units- Returns:
- the distance between two points if traveling using network
double getDistance(Point source, Point target, ShortestPathData<N, P> data)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
Network starting and and points will be chosen as network closest points to the source and target points respectively.
- Parameters:
source
- source pointtarget
- target pointdata
- data output object to write into, may be null- Returns:
- the distance between two points if traveling using network
double getDistance(Point source, Point target, ShortestPathData<N, P> data, LengthUnits units)
Calculates the distance between two points using the network paths. Source and target points do not have to belong to the network.
Network starting and and points will be chosen as network closest points to the source and target points respectively.
- Parameters:
source
- source pointtarget
- target pointdata
- data output object to write into, may be nullunits
- length units- Returns:
- the distance between two points if traveling using network
double getPlainDistance(Point firstPoint, Point secondPoint)
Straight line distance between two points.
- Parameters:
firstPoint
-secondPoint
-- Returns:
- distance between two points
double getPlainDistance(Point firstPoint, Point secondPoint, LengthUnits units)
Straight line distance between two points in given units of length.
- Parameters:
firstPoint
-secondPoint
-units
- unit of length- Returns:
- distance between two points
Position getPosition(ShortestPathData<N, P> data, double reverseOffset, Position out)
Calculates current position on the shortest path through network by the given offset
- Parameters:
data
- shortest path data, see#getDistance(Node, Node, ShortestPathData)
methodsreverseOffset
- offset from the end of routeout
- the Position object to use for output, may benull
- Returns:
- the position on the shortest path
Position getPosition(ShortestPathData<N, P> data, double reverseOffset, LengthUnits units, Position out)
Calculates current position on the shortest path through network by the given offset
- Parameters:
data
- shortest path data, see#getDistance(Node, Node, ShortestPathData)
methodsreverseOffset
- offset from the end of routeunits
- the units of lengthout
- the Position object to use for output, may benull
- Returns:
- the position on the shortest path
- Since:
- 7.1
Agent getSpace()
Returns the space where the markup element is defined
- Returns:
- the space associated with this element
@AnyLogicInternalAPI Class<? extends ExtAgentWithSpatialMetrics> getCompatibleAgentExtensionClass()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.