Skip navigation links

Oracle® Spatial Java API Reference
11g Release 1 (11.1)
B28401-01


oracle.spatial.network.lod
Class NetworkAnalyst

java.lang.Object
  extended by oracle.spatial.network.lod.NetworkAnalyst


public class NetworkAnalyst
extends java.lang.Object

This class is the single entry point to all the network analysis operations supported by NDM LOD. To get an instance of this class, use NetworkAnalyst analyst = LODNetworkManager.getNetworkAnalyst(networkIO); where networkIO is an NetworkIO object for the network of interest.

Since:
11g

Field Summary
static int BREADTH_FIRST_SEARCH
           
static int DEPTH_FIRST_SEARCH
           

 

Method Summary
 OrderedLongSet[] findConnectedComponents(int linkLevel)
          Finds the connected components for the specified link level.
 OrderedLongSet findConnectedNodes(int searchMethod, long nodeId, int linkLevel, LODNetworkConstraint constraint, LODGoalNode goalNode)
          Finds the nodes connected to the specified node.
 OrderedLongSet findReachableNodes(int searchMethod, long startNodeId, int linkLevel, LODNetworkConstraint constraint, LODGoalNode goalNode)
          Finds the nodes reachable from the specified node.
 OrderedLongSet findReachingNodes(int searchMethod, long endNodeId, int linkLevel, LODNetworkConstraint constraint, LODGoalNode goalNode)
          Finds the nodes that can reach the specified node.
 LinkCostCalculator getLinkCostCalculator()
          Returns the link cost calculator.
 NodeCostCalculator getNodeCostCalculator()
          Returns the node cost calculator.
 boolean isReachable(long startNodeId, long endNodeId, int linkLevel, LODNetworkConstraint constraint)
          Checks whether there is a path from the start node to the end node using the specified link level for long-haul search.
 LogicalSubPath[] nearestNeighbors(PointOnNet startPoint, int numberOfNeighbors, int searchLinkLevel, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nearest neighbors from the specified start point.
 LogicalSubPath[] nearestNeighbors(PointOnNet startPoint, int numberOfNeighbors, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nearest neighbors from the specified start point.
 LogicalSubPath[] nearestNeighbors(PointOnNet startPoint, int numberOfNeighbors, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nearest neighbors from the specified start point.
 LogicalSubPath[] nearestReachingNeighbors(PointOnNet endPoint, int numberOfNeighbors, int searchLinkLevel, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nearest reaching neighbors to the specified end point.
 LogicalSubPath[] nearestReachingNeighbors(PointOnNet endPoint, int numberOfNeighbors, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nearest reaching neighbors to the specified end point.
 LogicalSubPath[] nearestReachingNeighbors(PointOnNet endPoint, int numberOfNeighbors, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nearest reaching neighbors to the specified end point.
 void resetCostCalculators()
          Restores the default settings of link cost calculator and node cost calculator.
 void setLinkCostCalculator(LinkCostCalculator calculator)
          Sets the link cost calculator.
 void setNetworkUpdate(java.util.HashMap<java.lang.Integer,NetworkUpdate> networkUpdates)
          Sets the network update objects.
 void setNodeCostCalculator(NodeCostCalculator calculator)
          Sets the node cost calculator.
 LogicalSubPath shortestPathDijkstra(PointOnNet startPoint, PointOnNet endPoint, int searchLinkLevel, LODNetworkConstraint constraint)
          Finds the shortest path from a point on the start link to the end node.
 LogicalSubPath shortestPathDijkstra(PointOnNet startPoint, PointOnNet endPoint, LODNetworkConstraint constraint)
          Finds the shortest path from the start point to the end point.
 LogicalSubPath shortestPathDijkstraMaxLevel(PointOnNet startPoint, PointOnNet endPoint, LODNetworkConstraint constraint)
          Finds the shortest path from the start node to the end node using the highest possible link level.
 LogicalSubPath[] traceIn(PointOnNet endPoint, double cost, int searchLinkLevel, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes and partial links within the specified cost to the end point.
 LogicalSubPath[] traceIn(PointOnNet endPoint, double cost, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes and partial links within the specified cost to the end point.
 LogicalSubPath[] traceIn(PointOnNet endPoint, double cost, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes and partial links within the specified cost to the end point.
 LogicalSubPath[] traceOut(PointOnNet startPoint, double cost, int searchLinkLevel, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes and partial links within the specified cost from the start point.
 LogicalSubPath[] traceOut(PointOnNet startPoint, double cost, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes and partial links within the specified cost from the start point.
 LogicalSubPath[] traceOut(PointOnNet startPoint, double cost, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes and partial links within the specified cost from the start point.
 LogicalSubPath[] withinCost(PointOnNet startPoint, double cost, int searchLinkLevel, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes within the specified cost from the start point.
 LogicalSubPath[] withinCost(PointOnNet startPoint, double cost, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes within the specified cost from the start point.
 LogicalSubPath[] withinCost(PointOnNet startPoint, double cost, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes within the specified cost from the start point.
 LogicalSubPath[] withinReachingCost(PointOnNet endPoint, double cost, int searchLinkLevel, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes within the specified cost to the end point.
 LogicalSubPath[] withinReachingCost(PointOnNet endPoint, double cost, int targetLinkLevel, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes within the specified cost to the end point.
 LogicalSubPath[] withinReachingCost(PointOnNet endPoint, double cost, LODNetworkConstraint constraint, LODGoalNode goalNodeFilter)
          Finds the nodes within the specified cost to the end point.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

BREADTH_FIRST_SEARCH

public static final int BREADTH_FIRST_SEARCH
See Also:
Constant Field Values

DEPTH_FIRST_SEARCH

public static final int DEPTH_FIRST_SEARCH
See Also:
Constant Field Values

Method Detail

resetCostCalculators

public void resetCostCalculators()
Restores the default settings of link cost calculator and node cost calculator.

setLinkCostCalculator

public void setLinkCostCalculator(LinkCostCalculator calculator)
Sets the link cost calculator.
Parameters:
calculator - link cost calculator

getLinkCostCalculator

public LinkCostCalculator getLinkCostCalculator()
Returns the link cost calculator.
Returns:
link cost calculator

setNodeCostCalculator

public void setNodeCostCalculator(NodeCostCalculator calculator)
Sets the node cost calculator.
Parameters:
calculator - node cost calculator

getNodeCostCalculator

public NodeCostCalculator getNodeCostCalculator()
Returns the node cost calculator.
Returns:
node cost calculator

shortestPathDijkstra

public LogicalSubPath shortestPathDijkstra(PointOnNet startPoint,
                                           PointOnNet endPoint,
                                           LODNetworkConstraint constraint)
                                    throws LODNetworkException
Finds the shortest path from the start point to the end point.
Parameters:
startPoint - start point on the network
endPoint - end point on the network
constraint - network constraint
Returns:
shortest path from the start point to the end point
Throws:
LODNetworkException

shortestPathDijkstraMaxLevel

public LogicalSubPath shortestPathDijkstraMaxLevel(PointOnNet startPoint,
                                                   PointOnNet endPoint,
                                                   LODNetworkConstraint constraint)
                                            throws LODNetworkException
Finds the shortest path from the start node to the end node using the highest possible link level.
Parameters:
startPoint - start point
endPoint - end point
constraint - network constraint
Returns:
shortest path from the start node to the end node
Throws:
LODNetworkException

shortestPathDijkstra

public LogicalSubPath shortestPathDijkstra(PointOnNet startPoint,
                                           PointOnNet endPoint,
                                           int searchLinkLevel,
                                           LODNetworkConstraint constraint)
                                    throws LODNetworkException
Finds the shortest path from a point on the start link to the end node.
Parameters:
startPoint - start point on the network
endPoint - end point on the network
constraint - network constraint
Returns:
shortest path from the start point to the end point
Throws:
LODNetworkException

nearestNeighbors

public LogicalSubPath[] nearestNeighbors(PointOnNet startPoint,
                                         int numberOfNeighbors,
                                         LODNetworkConstraint constraint,
                                         LODGoalNode goalNodeFilter)
                                  throws LODNetworkException
Finds the nearest neighbors from the specified start point. The search uses the lowest link level.
Parameters:
startPoint - start point on the network
numberOfNeighbors - number of neighbors to be returned
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths to the nearest neighbors from the specified node ID
Throws:
LODNetworkException

nearestNeighbors

public LogicalSubPath[] nearestNeighbors(PointOnNet startPoint,
                                         int numberOfNeighbors,
                                         int targetLinkLevel,
                                         LODNetworkConstraint constraint,
                                         LODGoalNode goalNodeFilter)
                                  throws LODNetworkException
Finds the nearest neighbors from the specified start point.
Parameters:
startPoint - start point on the network
numberOfNeighbors - number of neighbors to be returned
targetLinkLevel - maximum outgoing link level of the neighbors
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths to the nearest neighbors from the specified node ID
Throws:
LODNetworkException

nearestNeighbors

public LogicalSubPath[] nearestNeighbors(PointOnNet startPoint,
                                         int numberOfNeighbors,
                                         int searchLinkLevel,
                                         int targetLinkLevel,
                                         LODNetworkConstraint constraint,
                                         LODGoalNode goalNodeFilter)
                                  throws LODNetworkException
Finds the nearest neighbors from the specified start point.
Parameters:
startPoint - start point on the network
numberOfNeighbors - number of neighbors to be returned
searchLinkLevel - the link level to search for neighbors
targetLinkLevel - maximum outgoing link level of the neighbors
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths to the nearest neighbors from the specified node ID
Throws:
LODNetworkException

nearestReachingNeighbors

public LogicalSubPath[] nearestReachingNeighbors(PointOnNet endPoint,
                                                 int numberOfNeighbors,
                                                 LODNetworkConstraint constraint,
                                                 LODGoalNode goalNodeFilter)
                                          throws LODNetworkException
Finds the nearest reaching neighbors to the specified end point. Both the search and the target link levels are set to the lowest link level.
Parameters:
endPoint - end point on the network
numberOfNeighbors - number of neighbors to be returned
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths from the nearest reaching neighbors to the specified node ID
Throws:
LODNetworkException

nearestReachingNeighbors

public LogicalSubPath[] nearestReachingNeighbors(PointOnNet endPoint,
                                                 int numberOfNeighbors,
                                                 int targetLinkLevel,
                                                 LODNetworkConstraint constraint,
                                                 LODGoalNode goalNodeFilter)
                                          throws LODNetworkException
Finds the nearest reaching neighbors to the specified end point. The search uses the lowest link level.
Parameters:
endPoint - end point on the network
numberOfNeighbors - number of neighbors to be returned
targetLinkLevel - maximum incoming link level of the neighbors
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths from the nearest reaching neighbors to the specified node ID
Throws:
LODNetworkException

nearestReachingNeighbors

public LogicalSubPath[] nearestReachingNeighbors(PointOnNet endPoint,
                                                 int numberOfNeighbors,
                                                 int searchLinkLevel,
                                                 int targetLinkLevel,
                                                 LODNetworkConstraint constraint,
                                                 LODGoalNode goalNodeFilter)
                                          throws LODNetworkException
Finds the nearest reaching neighbors to the specified end point. The search uses the lowest link level.
Parameters:
endPoint - end point on the network
numberOfNeighbors - number of neighbors to be returned
searchLinkLevel - the link level to search for neighbors
targetLinkLevel - maximum incoming link level of the neighbors
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths from the nearest reaching neighbors to the specified node ID
Throws:
LODNetworkException

withinCost

public LogicalSubPath[] withinCost(PointOnNet startPoint,
                                   double cost,
                                   LODNetworkConstraint constraint,
                                   LODGoalNode goalNodeFilter)
                            throws LODNetworkException
Finds the nodes within the specified cost from the start point. Both the search and the target link levels are set to the lowest link level.
Parameters:
startPoint - start point
cost - cost bound
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths to the target nodes from the start point
Throws:
LODNetworkException

withinCost

public LogicalSubPath[] withinCost(PointOnNet startPoint,
                                   double cost,
                                   int targetLinkLevel,
                                   LODNetworkConstraint constraint,
                                   LODGoalNode goalNodeFilter)
                            throws LODNetworkException
Finds the nodes within the specified cost from the start point. The search uses the lowest link level.
Parameters:
startPoint - start point
cost - cost bound
targetLinkLevel - maximum outgoing link level of the targets
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths to the target nodes from the start point
Throws:
LODNetworkException

withinCost

public LogicalSubPath[] withinCost(PointOnNet startPoint,
                                   double cost,
                                   int searchLinkLevel,
                                   int targetLinkLevel,
                                   LODNetworkConstraint constraint,
                                   LODGoalNode goalNodeFilter)
                            throws LODNetworkException
Finds the nodes within the specified cost from the start point.
Parameters:
startPoint - start point
cost - cost bound
searchLinkLevel - the link level to search for targets
targetLinkLevel - maximum outgoing link level of the targets
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths to the target nodes from the start point
Throws:
LODNetworkException

withinReachingCost

public LogicalSubPath[] withinReachingCost(PointOnNet endPoint,
                                           double cost,
                                           LODNetworkConstraint constraint,
                                           LODGoalNode goalNodeFilter)
                                    throws LODNetworkException
Finds the nodes within the specified cost to the end point. Both the search and the target link levels are set to the lowest link level.
Parameters:
endPoint - end point
cost - cost bound
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths from the target nodes to the start point
Throws:
LODNetworkException

withinReachingCost

public LogicalSubPath[] withinReachingCost(PointOnNet endPoint,
                                           double cost,
                                           int targetLinkLevel,
                                           LODNetworkConstraint constraint,
                                           LODGoalNode goalNodeFilter)
                                    throws LODNetworkException
Finds the nodes within the specified cost to the end point. The search uses the lowest link level.
Parameters:
endPoint - end point
cost - cost bound
targetLinkLevel - maximum incoming link level of the targets
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths from the target nodes to the start point
Throws:
LODNetworkException

withinReachingCost

public LogicalSubPath[] withinReachingCost(PointOnNet endPoint,
                                           double cost,
                                           int searchLinkLevel,
                                           int targetLinkLevel,
                                           LODNetworkConstraint constraint,
                                           LODGoalNode goalNodeFilter)
                                    throws LODNetworkException
Finds the nodes within the specified cost to the end point.
Parameters:
endPoint - end point
cost - cost bound
searchLinkLevel - the link level to search for targets
targetLinkLevel - maximum incoming link level of the targets
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths from the target nodes to the start point
Throws:
LODNetworkException

traceOut

public LogicalSubPath[] traceOut(PointOnNet startPoint,
                                 double cost,
                                 LODNetworkConstraint constraint,
                                 LODGoalNode goalNodeFilter)
                          throws LODNetworkException
Finds the nodes and partial links within the specified cost from the start point. Both the search and the target link levels are set to the lowest link level.
Parameters:
startPoint - start point
cost - cost bound
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths to the target nodes and links from the start point
Throws:
LODNetworkException

traceOut

public LogicalSubPath[] traceOut(PointOnNet startPoint,
                                 double cost,
                                 int targetLinkLevel,
                                 LODNetworkConstraint constraint,
                                 LODGoalNode goalNodeFilter)
                          throws LODNetworkException
Finds the nodes and partial links within the specified cost from the start point. The search uses the lowest link level.
Parameters:
startPoint - start point
cost - cost bound
targetLinkLevel - maximum outgoing link level of the targets
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths to the target nodes and links from the start point
Throws:
LODNetworkException

traceOut

public LogicalSubPath[] traceOut(PointOnNet startPoint,
                                 double cost,
                                 int searchLinkLevel,
                                 int targetLinkLevel,
                                 LODNetworkConstraint constraint,
                                 LODGoalNode goalNodeFilter)
                          throws LODNetworkException
Finds the nodes and partial links within the specified cost from the start point.
Parameters:
startPoint - start point
cost - cost bound
searchLinkLevel - the link level to search for neighbors
targetLinkLevel - maximum outgoing link level of the targets
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths to the target nodes and links from the start point
Throws:
LODNetworkException

traceIn

public LogicalSubPath[] traceIn(PointOnNet endPoint,
                                double cost,
                                LODNetworkConstraint constraint,
                                LODGoalNode goalNodeFilter)
                         throws LODNetworkException
Finds the nodes and partial links within the specified cost to the end point. Both the search and the target link levels are set to the lowest link level.
Parameters:
endPoint - end point
cost - cost bound
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths from the target nodes and links to the start point
Throws:
LODNetworkException

traceIn

public LogicalSubPath[] traceIn(PointOnNet endPoint,
                                double cost,
                                int targetLinkLevel,
                                LODNetworkConstraint constraint,
                                LODGoalNode goalNodeFilter)
                         throws LODNetworkException
Finds the nodes and partial links within the specified cost to the end point. The search uses the lowest link level.
Parameters:
endPoint - end point
cost - cost bound
targetLinkLevel - maximum incoming link level of the targets
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths from the target nodes and links to the start point
Throws:
LODNetworkException

traceIn

public LogicalSubPath[] traceIn(PointOnNet endPoint,
                                double cost,
                                int searchLinkLevel,
                                int targetLinkLevel,
                                LODNetworkConstraint constraint,
                                LODGoalNode goalNodeFilter)
                         throws LODNetworkException
Finds the nodes and partial links within the specified cost to the end point.
Parameters:
endPoint - end point
cost - cost bound
searchLinkLevel - the link level to search for neighbors
targetLinkLevel - maximum incoming link level of the targets
constraint - network constraint
goalNodeFilter - goal node implementation
Returns:
paths from the target nodes and links to the start point
Throws:
LODNetworkException

findConnectedNodes

public OrderedLongSet findConnectedNodes(int searchMethod,
                                         long nodeId,
                                         int linkLevel,
                                         LODNetworkConstraint constraint,
                                         LODGoalNode goalNode)
                                  throws LODNetworkException
Finds the nodes connected to the specified node.
Parameters:
searchMethod - search method. It can take the following values:
  • NetworkAnalyst.BREADTH_FIRST_SEARCH, or
  • NetworkAnalyst.DEPTH_FIRST_SEARCH.
    nodeId - node ID
    linkLevel - maximum link level to search on
    Returns:
    node IDs connected to the specified node ID
    Throws:
    LODNetworkException

findReachableNodes

public OrderedLongSet findReachableNodes(int searchMethod,
                                         long startNodeId,
                                         int linkLevel,
                                         LODNetworkConstraint constraint,
                                         LODGoalNode goalNode)
                                  throws LODNetworkException
Finds the nodes reachable from the specified node.
Parameters:
searchMethod - search method. It can take the following values:
  • NetworkAnalyst.BREADTH_FIRST_SEARCH, or
  • NetworkAnalyst.DEPTH_FIRST_SEARCH.
    startNodeId - start node ID
    linkLevel - maximum link level to search on
    Returns:
    node IDs reachable from the specified node ID
    Throws:
    LODNetworkException

findReachingNodes

public OrderedLongSet findReachingNodes(int searchMethod,
                                        long endNodeId,
                                        int linkLevel,
                                        LODNetworkConstraint constraint,
                                        LODGoalNode goalNode)
                                 throws LODNetworkException
Finds the nodes that can reach the specified node.
Parameters:
searchMethod - search method. It can take the following values:
  • NetworkAnalyst.BREADTH_FIRST_SEARCH, or
  • NetworkAnalyst.DEPTH_FIRST_SEARCH.
    endNodeId - end node ID
    linkLevel - maximum link level to search on
    Returns:
    node IDs that can reach the specified node ID
    Throws:
    LODNetworkException

isReachable

public boolean isReachable(long startNodeId,
                           long endNodeId,
                           int linkLevel,
                           LODNetworkConstraint constraint)
                    throws LODNetworkException
Checks whether there is a path from the start node to the end node using the specified link level for long-haul search.
Parameters:
startNodeId - start node ID
endNodeId - end node ID
linkLevel - maximum link level to search on
Returns:
true, if there exists a path from the start node to the end node; false, otherwise.
Throws:
LODNetworkException

findConnectedComponents

public OrderedLongSet[] findConnectedComponents(int linkLevel)
                                         throws LODNetworkException
Finds the connected components for the specified link level.
Parameters:
linkLevel - maximum link level to search on
Returns:
the connected components
Throws:
LODNetworkException

setNetworkUpdate

public void setNetworkUpdate(java.util.HashMap<java.lang.Integer,NetworkUpdate> networkUpdates)
Sets the network update objects. These objects will be super imposed to the static network information during network analysis.
Parameters:
networkUpdates - network update objects for different link levels

Oracle® Spatial Java API Reference
11g Release 1 (11.1)
B28401-01

Copyright © 2007, Oracle. All Rights Reserved.