Package oracle.spatial.network.lod
Class NetworkBuffer
- java.lang.Object
-
- oracle.spatial.network.lod.NetworkBuffer
-
public class NetworkBuffer extends java.lang.ObjectA NetworkBuffer is defined by central points and the set of nodes and link intervals within certain radius from the cental points. A NetworkBuffer can return the minimum cost from a central point to any node or link interval covered by this NetworkBuffer.- Since:
- 11gR2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNetworkBuffer.DoubleIntervalThis class defines a double interval.static classNetworkBuffer.ElementsThis class contains elements in a network buffer.static classNetworkBuffer.LinkIntervalstatic classNetworkBuffer.LinkIntervalsAn instance of this class contains a LogicalLink object and a list of intervals associated with the link object.
-
Constructor Summary
Constructors Constructor Description NetworkBuffer(double radius, int direction)Constructs a network buffer instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCentralPoint(PointOnNet centralPoint)Add a central point to network buffer.voidaddLinkIntervals(NetworkBuffer.LinkIntervals linkIntervals, boolean flipped, double[] currNodeCost, double[] nextLinkCost)Adds the intervals of a link.protected voidaddLinkIntervals(NetworkBuffer.LinkIntervals linkIntervals, double[] startNodeCost, double[] forwardLinkCost, double[] endNodeCost, double[] backwardLinkCost)voidaddNode(LogicalNode node, double[] costs)Adds a node to the network buffer.PointOnNet[]getCentralPoints()Returns the central points.double[]getCosts(PointOnNet point)Returns the costs from a buffer center to the input point.intgetDirection()Returns the direction (forward or backward) of the network buffer.NetworkBuffer.ElementsgetElements()Returns the elements in this network buffer.double[]getLinkEnteringCosts(long linkId, boolean isForward)Returns the cost before entering the link.NetworkBuffer.DoubleInterval[]getLinkIntervalCosts(long linkId, NetworkBuffer.DoubleInterval interval)Returns the cost range to reach the input interval.double[]getNodeCosts(long nodeId)Returns the minimum costs to reach the node from a central point.doublegetRadius()Returns the radius (size) of the network buffer.booleanisCovered(PointOnNet point)voidremoveCentralPoint(PointOnNet centralPoint)Removes a central point.voidremoveLink(long linkId)Removes the specified link and all associated intervals from the network buffer.voidremoveNode(long nodeId)Removes the specified node from the network buffer.NetworkBuffersubSet(double cost)Computes the subset of the network buffer.
-
-
-
Method Detail
-
getRadius
public double getRadius()
Returns the radius (size) of the network buffer.- Returns:
-
getDirection
public int getDirection()
Returns the direction (forward or backward) of the network buffer.- Returns:
-
addCentralPoint
public void addCentralPoint(PointOnNet centralPoint)
Add a central point to network buffer. Costs of central points are zero.- Parameters:
centralPoint- zero cost point
-
getCentralPoints
public PointOnNet[] getCentralPoints()
Returns the central points.- Returns:
- central points
-
removeCentralPoint
public void removeCentralPoint(PointOnNet centralPoint)
Removes a central point.- Parameters:
centralPoint- central point to be removed
-
addLinkIntervals
public void addLinkIntervals(NetworkBuffer.LinkIntervals linkIntervals, boolean flipped, double[] currNodeCost, double[] nextLinkCost)
Adds the intervals of a link.- Parameters:
linkIntervals- intervals of a linkcurrNodeCost- current node costsnextLinkCost- next link costs
-
addLinkIntervals
protected void addLinkIntervals(NetworkBuffer.LinkIntervals linkIntervals, double[] startNodeCost, double[] forwardLinkCost, double[] endNodeCost, double[] backwardLinkCost)
-
isCovered
public boolean isCovered(PointOnNet point)
-
getCosts
public double[] getCosts(PointOnNet point)
Returns the costs from a buffer center to the input point. The array of costs corresponds to the array of link and node cost calculators passed to network buffer analysis. Returns null if the point in not covered by this network buffer.- Parameters:
point-- Returns:
-
getLinkIntervalCosts
public NetworkBuffer.DoubleInterval[] getLinkIntervalCosts(long linkId, NetworkBuffer.DoubleInterval interval)
Returns the cost range to reach the input interval. If the network buffer does not cover any portion of the link in the direction the input interval indicated, then this method returns null.- Parameters:
interval- start/end percentage on the link- Returns:
- costs range to reach the input interval`
-
getLinkEnteringCosts
public double[] getLinkEnteringCosts(long linkId, boolean isForward)Returns the cost before entering the link.- Parameters:
isForward- true if the travel direction is from the start node to the end node; false other wise.- Returns:
- costs range to reach the input interval`
-
addNode
public void addNode(LogicalNode node, double[] costs)
Adds a node to the network buffer.- Parameters:
node- nodecosts- minimum costs to reach the node from a central point
-
getNodeCosts
public double[] getNodeCosts(long nodeId)
Returns the minimum costs to reach the node from a central point.- Parameters:
nodeId- ID of the node- Returns:
- costs to reach the node
-
getElements
public NetworkBuffer.Elements getElements()
Returns the elements in this network buffer.- Returns:
- elements in the network buffer
-
removeLink
public void removeLink(long linkId)
Removes the specified link and all associated intervals from the network buffer.- Parameters:
linkId- ID of the link
-
removeNode
public void removeNode(long nodeId)
Removes the specified node from the network buffer.- Parameters:
nodeId- ID of the node
-
subSet
public NetworkBuffer subSet(double cost)
Computes the subset of the network buffer.- Parameters:
cost- cost of the subset- Returns:
- a network buffer, which is a subset of this network buffer
-
-