Package com.anylogic.engine.markup
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- add
- add
- 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
- getPosition
- getPosition
- getNearestNetworkElement
- getNearestNetworkElement
- getNearestNetworkElement
- getNearestNode
- getNearestNode
- getNearestNode
- getNearestNode
- getNearestPath
- getNearestPath
- getNearestPath
- getPlainDistance
- getPlainDistance
- getDistance
- getPathData
- getPositionAtOffset
- getLength
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkupAggregator<Owner>
- com.anylogic.engine.markup.AbstractNetwork<N,
- All Implemented Interfaces:
IRouteProvider<ShortestPathData<N,
,P>> INetwork<N,
,P> Serializable
- Direct Known Subclasses:
ConveyorNetwork
,GISNetwork
,Network
@AnyLogicInternalAPI public abstract class AbstractNetwork<N extends INode<N,P>, extends AbstractMarkupAggregator<Owner> implements INetwork<N,P extends IPath<N>, Owner> P>
- See Also:
- Serialized Form
Constructor | Description |
---|---|
AbstractNetwork | |
AbstractNetwork |
Modifier and Type | Method | Description |
---|---|---|
void | add |
Adds node to network.
|
void | add |
Adds relation to network.
|
double | getDistance |
Creates a route from one point to another and calculates its length.
|
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.
|
double | getLength |
Retrieves length of the specified route.
|
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 agent.
|
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 coordinates.
|
N | getNearestNode |
Looking for the closest node in this network to the given agent.
|
N | getNearestNode |
Looking for the closest node in this network to the given point.
|
N | getNearestNode |
Looking for the closest node in this network to the given point.
|
P | getNearestPath |
Looking for the closest path in this network to the given coordinates.
|
P | getNearestPath |
Looking for the closest path in this network to the given agent.
|
P | getNearestPath |
Looking for the closest path 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.
|
ShortestPathData<N, | getPathData |
Retrieves the route data an agent will use to calculate
the route length and determine its position on the route
by calling
IRouteProvider.getLength(IPathData) and
IRouteProvider.getPositionAtOffset(IPathData, double, Position) respectively. |
abstract 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
|
Position | getPositionAtOffset |
Retrieves agent's position on the route.
|
List<INetwork<?, | getRelatedNetworks() | |
List<N> | nodes() | |
List<P> | paths() | |
List<NetworkPort> | ports() |
elementsInternal, error, getName, getOwner, initializeInternal, isVisible, onAggregatorVisibilityChanged, setVisible
public AbstractNetwork(Owner owner, String name)
public AbstractNetwork(Owner owner, String name, boolean isPublic, boolean visible)
public void add(N n)
Description copied from interface:
INetwork
Adds node to network. Don't call this method when network has been initialized.
public void add(P p)
Description copied from interface:
INetwork
Adds relation to network. Don't call this method when network has been initialized.
public N getNode(int index)
public int getNodeCount()
Description copied from interface:
INetwork
Amount of nodes in this network.
public P getPath(int index)
public int getPathCount()
Description copied from interface:
INetwork
Amount of paths in this network.
public List<NetworkPort> ports()
public List<N> nodes()
public List<P> paths()
@AnyLogicInternalAPI public List<INetwork<?,?>> getRelatedNetworks()
public double getDistance(N from, N to, ShortestPathData<N, P> data)
Description copied from interface:
INetwork
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
public double getDistance(N from, N to, ShortestPathData<N, P> data, LengthUnits units)
Description copied from interface:
INetwork
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
public double getDistance(N from, P to, double toOffset, ShortestPathData<N, P> data)
Description copied from interface:
INetwork
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
public double getDistance(N from, P to, double toOffset, ShortestPathData<N, P> data, LengthUnits units)
Description copied from interface:
INetwork
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
public double getDistance(P from, double fromOffset, N to, ShortestPathData<N, P> data)
Description copied from interface:
INetwork
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
public double getDistance(P from, double fromOffset, N to, ShortestPathData<N, P> data, LengthUnits units)
Description copied from interface:
INetwork
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
public double getDistance(P from, double fromOffset, P to, double toOffset, ShortestPathData<N, P> data)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(P from, double fromOffset, P to, double toOffset, ShortestPathData<N, P> data, LengthUnits units)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(Point source, Point target, N from, N to, ShortestPathData<N, P> data)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(Point source, Point target, N from, N to, ShortestPathData<N, P> data, LengthUnits units)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(Point source, Point target, N from, P to, double toOffset, ShortestPathData<N, P> data)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(Point source, Point target, N from, P to, double toOffset, ShortestPathData<N, P> data, LengthUnits units)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(Point source, Point target, P from, double fromOffset, N to, ShortestPathData<N, P> data)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(Point source, Point target, P from, double fromOffset, N to, ShortestPathData<N, P> data, LengthUnits units)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(Point source, Point target, P from, double fromOffset, P to, double toOffset, ShortestPathData<N, P> data)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(Point source, Point target, P from, double fromOffset, P to, double toOffset, ShortestPathData<N, P> data, LengthUnits units)
Description copied from interface:
INetwork
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
- Specified by:
getDistance
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - 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
public double getDistance(Point source, Point target, ShortestPathData<N, P> data)
Description copied from interface:
INetwork
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.
public double getDistance(Point source, Point target, ShortestPathData<N, P> data, LengthUnits units)
Description copied from interface:
INetwork
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.
public Position getPosition(ShortestPathData<N, P> data, double offset, Position out)
Description copied from interface:
INetwork
Calculates current position on the shortest path through network by the given offset
- Specified by:
getPosition
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - Parameters:
data
- shortest path data, see#getDistance(Node, Node, ShortestPathData)
methodsoffset
- offset from the end of routeout
- the Position object to use for output, may benull
- Returns:
- the position on the shortest path
public Position getPosition(ShortestPathData<N, P> data, double offset, LengthUnits units, Position out)
Description copied from interface:
INetwork
Calculates current position on the shortest path through network by the given offset
- Specified by:
getPosition
in interfaceINetwork<N extends INode<N,
P>, P extends IPath<N>> - Parameters:
data
- shortest path data, see#getDistance(Node, Node, ShortestPathData)
methodsoffset
- 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
public INetworkMarkupElement getNearestNetworkElement(double x, double y, double z, Point out)
Looking for the closest markup element in this network to the given coordinates.
public INetworkMarkupElement getNearestNetworkElement(Agent agent, Point out)
Looking for the closest markup element in this network to the given agent.
- Parameters:
agent
- the given agentout
- the point in this markup element nearest to the given agent- Returns:
- nearest markup element
public INetworkMarkupElement getNearestNetworkElement(Point givenPoint, Point out)
Looking for the closest markup element in this network to the given point.
public N getNearestNode(Agent agent, Point out)
Looking for the closest node in this network to the given agent.
- Parameters:
agent
- the given agentout
- the point in this node nearest to the given agent- Returns:
- nearest node
public N getNearestNode(double x, double y, double z, Point out)
Looking for the closest node in this network to the given coordinates.
- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinateout
- the point in this node nearest to the given coordinates- Returns:
- nearest node
public N getNearestNode(Point givenPoint)
Looking for the closest node in this network to the given point.
public N getNearestNode(Point givenPoint, Point out)
Looking for the closest node in this network to the given point.
- Parameters:
givenPoint
- the given pointout
- the point in this node nearest to the given point- Returns:
- nearest node
public P getNearestPath(Agent agent, Point out)
Looking for the closest path in this network to the given agent.
- Parameters:
agent
- the given agentout
- the point in this path nearest to the given agent- Returns:
- nearest path
public P getNearestPath(double x, double y, double z, Point out)
Looking for the closest path in this network to the given coordinates.
- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinateout
- the point in this path nearest to the given coordinates- Returns:
- the nearest path
public P getNearestPath(Point givenPoint, Point out)
Looking for the closest path in this network to the given point.
- Parameters:
givenPoint
- the given agentout
- the point in this path nearest to the given point- Returns:
- the nearest path
public abstract double getPlainDistance(Point firstPoint, Point secondPoint)
Description copied from interface:
INetwork
Straight line distance between two points.
public double getPlainDistance(Point firstPoint, Point secondPoint, LengthUnits units)
Description copied from interface:
INetwork
Straight line distance between two points in given units of length.
public double getDistance(Point startPoint, Point endPoint)
Description copied from interface:
IRouteProvider
Creates a route from one point to another and calculates its length.
Uses route provider to create a route.
- Specified by:
getDistance
in interfaceIRouteProvider<N extends INode<N,
P>> - Parameters:
startPoint
- Start point of a routeendPoint
- End point of a route- Returns:
- length of a route from one point to another
public ShortestPathData<N,P> getPathData(Point startPoint, Point endPoint, ShortestPathData<N, P> out)
Description copied from interface:
IRouteProvider
Retrieves the route data an agent will use to calculate
the route length and determine its position on the route
by calling
IRouteProvider.getLength(IPathData)
and
IRouteProvider.getPositionAtOffset(IPathData, double, Position)
respectively.- Specified by:
getPathData
in interfaceIRouteProvider<N extends INode<N,
P>> - Parameters:
startPoint
- Start point of the routeendPoint
- End point of the routeout
- This parameter was added to prevent creating additional instances of route data objects; could benull
- Returns:
- the route data to move an agent between specified points;
- See Also:
-
IPathData
public Position getPositionAtOffset(ShortestPathData<N, P> pathData, double offset, Position out)
Description copied from interface:
IRouteProvider
Retrieves agent's position on the route.
- Specified by:
getPositionAtOffset
in interfaceIRouteProvider<N extends INode<N,
P>> - Parameters:
pathData
- The route data of moving agentoffset
- The distance that agent should pass to reach the end of the routeout
- This parameter was added to prevent creating additional instances; could benull
- Returns:
- Agent's position on the route
- See Also:
-
Position
IPathData
public double getLength(ShortestPathData<N, P> pathData)
Description copied from interface:
IRouteProvider
Retrieves length of the specified route.