Package com.anylogic.engine.markup
- Method Summary
- Methods inherited from interface com.anylogic.engine.IRouteProvider
- Method Detail
- 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>>
,java.io.Serializable
- All Known Implementing Classes:
AbstractNetwork
,ConveyorNetwork
,GISNetwork
,Network
public interface INetwork<N extends INode<N,P>,P extends IPath<N>> extends IRouteProvider<ShortestPathData<N,P>>
Basic interface of network for agent movement based on markup elements.
- Author:
- AnyLogic North America, LLC https://anylogic.com
void |
add(N n) |
Adds node to network.
|
void |
add(P p) |
Adds relation to network.
|
java.lang.Class<? extends ExtAgentWithSpatialMetrics> |
getCompatibleAgentExtensionClass() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
double |
getDistance(Point source,
Point target,
ShortestPathData<N,P> data) |
Calculates the distance between two points using the network paths.
|
double |
getDistance(Point source,
Point target,
ShortestPathData<N,P> data,
LengthUnits units) |
Calculates the distance between two points using the network paths.
|
double |
getDistance(Point source,
Point target,
N from,
N to,
ShortestPathData<N,P> data) |
Calculates the distance between two points using the network paths.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
double |
getDistance(N from,
N to,
ShortestPathData<N,P> data) |
Calculates the distance from source object in the network to the target object.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
INetworkMarkupElement |
getNearestNetworkElement(double x,
double y,
double z,
Point out) |
Looking for the closest markup element in this network to the given coordinates.
|
INetworkMarkupElement |
getNearestNetworkElement(Point givenPoint,
Point out) |
Looking for the closest markup element in this network to the given point.
|
N |
getNearestNode(Point p) |
Looking for the closest node in this network to the given point.
|
N |
getNode(int index) |
|
int |
getNodeCount() |
Amount of nodes in this network.
|
P |
getPath(int index) |
|
int |
getPathCount() |
Amount of paths in this network.
|
double |
getPlainDistance(Point firstPoint,
Point secondPoint) |
Straight line distance between two points.
|
double |
getPlainDistance(Point firstPoint,
Point secondPoint,
LengthUnits units) |
Straight line distance between two points in given units of length.
|
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
|
Position |
getPosition(ShortestPathData<N,P> data,
double reverseOffset,
Position out) |
Calculates current position on the shortest path through network by the given offset
|
java.util.List<INetwork<?,?>> |
getRelatedNetworks() |
|
Agent |
getSpace() |
Returns the space where the markup element is defined
|
java.util.List<N> |
nodes() |
|
java.util.List<P> |
paths() |
|
java.util.List<NetworkPort> |
ports() |
|
Modifier and Type | Method | Description |
---|
getDistance, getLength, getPathData, getPositionAtOffset
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
java.util.List<NetworkPort> ports()
- Returns:
- all ports of this network
java.util.List<N> nodes()
- Returns:
- all nodes of this network
java.util.List<P> paths()
- Returns:
- all paths of this network
@AnyLogicInternalAPI java.util.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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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 java.lang.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.
-
How can we improve this article?
-