public class NetworkBuffer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
NetworkBuffer.DoubleInterval
This class defines a double interval.
|
static class |
NetworkBuffer.Elements
This class contains elements in a network buffer.
|
static class |
NetworkBuffer.LinkInterval |
static class |
NetworkBuffer.LinkIntervals
An instance of this class contains a LogicalLink object and a list of intervals associated with the link object.
|
Constructor and Description |
---|
NetworkBuffer(double radius, int direction)
Constructs a network buffer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCentralPoint(PointOnNet centralPoint)
Add a central point to network buffer.
|
void |
addNode(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.
|
int |
getDirection()
Returns the direction (forward or backward) of the network buffer.
|
NetworkBuffer.Elements |
getElements()
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.
|
double |
getRadius()
Returns the radius (size) of the network buffer.
|
boolean |
isCovered(PointOnNet point) |
void |
removeCentralPoint(PointOnNet centralPoint)
Removes a central point.
|
void |
removeLink(long linkId)
Removes the specified link and all associated intervals from the network buffer.
|
void |
removeNode(long nodeId)
Removes the specified node from the network buffer.
|
NetworkBuffer |
subSet(double cost)
Computes the subset of the network buffer.
|
public NetworkBuffer(double radius, int direction)
public double getRadius()
public int getDirection()
public void addCentralPoint(PointOnNet centralPoint)
centralPoint
- zero cost pointpublic PointOnNet[] getCentralPoints()
public void removeCentralPoint(PointOnNet centralPoint)
centralPoint
- central point to be removedpublic boolean isCovered(PointOnNet point)
public double[] getCosts(PointOnNet point)
point
-public NetworkBuffer.DoubleInterval[] getLinkIntervalCosts(long linkId, NetworkBuffer.DoubleInterval interval)
interval
- start/end percentage on the linkpublic double[] getLinkEnteringCosts(long linkId, boolean isForward)
isForward
- true if the travel direction is from the start node to the end node; false other wise.public void addNode(LogicalNode node, double[] costs)
node
- nodecosts
- minimum costs to reach the node from a central pointpublic double[] getNodeCosts(long nodeId)
nodeId
- ID of the nodepublic NetworkBuffer.Elements getElements()
public void removeLink(long linkId)
linkId
- ID of the linkpublic void removeNode(long nodeId)
nodeId
- ID of the nodepublic NetworkBuffer subSet(double cost)
cost
- cost of the subset