Class NetworkBuffer


  • public class NetworkBuffer
    extends java.lang.Object
    A 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
    • Constructor Detail

      • NetworkBuffer

        public NetworkBuffer​(double radius,
                             int direction)
        Constructs a network buffer instance.
    • 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 link
        currNodeCost - current node costs
        nextLinkCost - 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 - node
        costs - 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