public class NetworkManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
addNetworkToCache(java.lang.String networkName, Network network)
Adds a network in the network cahce
|
static Path[] |
allPaths(Network network, int startNodeID, int goalNodeID, int depthLimit, double costLimit, int noOfSolutions)
Returns all paths between the start node and the goal node.
|
static Path[] |
allPaths(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint, int noOfSolutions)
Returns all paths between the start node and the goal node.
|
static Path[] |
allPaths(Path complexPath, int depthLimit, double costLimit, int noOfSolutions)
Returns all paths between the start node and the goal node of the complex path.
|
static void |
clearNetworkCache()
Clears the network cache
|
static Network |
convertNetworkBetweenWorkspaces(java.sql.Connection conn, Network sourceNetwork, java.lang.String sourceWorkspace, java.lang.String sourceSavepoint, java.lang.String targetWorkspace, java.lang.String targetSavepoint)
Converts the source network into the network in the target workspace and savepoint based on their diffs in a workspace(version-enabled) environment.
|
static void |
createNetworkHiearchy(Network network, int numHierarchy, int[] ndNumLevel)
Creates a network hiearchy with the given number of levels.
|
static void |
createRefConstraints(java.sql.Connection conn, java.lang.String network)
Creates the referential constraints on the link and the path tables.
|
static void |
deregisterJavaObject(java.sql.Connection conn, java.lang.String name)
Deregister the given Java object from user_sdo_network_java_objects
|
static void |
deregisterNetworkConstraint(java.sql.Connection conn, java.lang.String networkConstraintName)
Deregister the given constraint from user_sdo_network_constraints
|
static void |
disableRefConstraints(java.sql.Connection conn, java.lang.String network)
Disables the referential constraints on the link and the path tables.
|
static void |
dropNetwork(java.sql.Connection conn, java.lang.String network)
Drops the network from the database.
|
static void |
dropRefConstraints(java.sql.Connection conn, java.lang.String network)
Drops the referential constraints on the link and the path tables.
|
static void |
enableRefConstraints(java.sql.Connection conn, java.lang.String network)
Enables the referential constraints on the link and the path tables.
|
static int |
findConnectedComponents(Network network)
Returns the number of connected components in the network.
|
static java.util.Vector |
findConnectedComponentVector(Network network)
Returns connected components of the network in a Vector.
|
static Link[] |
findExternalLinks(Node[] nodeArray1, Node[] nodeArray2)
Returns external links between the two arrays of nodes.
|
static Link[] |
findInternalLinks(Node[] nodeArray)
Returns the internal links of the node array.
|
static int |
findMaxNodeDegree(Network network, int degreeType)
Finds the maximum node degree of the network
|
static MBR |
findMBR(Node[] nodeArray, double expandFactor)
Returns the MBR of the node array and expanded it by the specified factor.
|
static int |
findMinNodeDegree(Network network, int degreeType)
Finds the minimum node degree of the network
|
static Node[] |
findNodesWithinDegreeBounds(Network network, int degreeType, int minDegree, int maxDegree)
Finds nodes with degree within the given degree bounds.
|
static Node[] |
findReachableNodes(Network network, int sourceNodeID)
Returns all nodes that can be reached from the source node.
|
static Node[] |
findReachableNodes(Network network, int sourceNodeID, MBR mbr)
Returns all nodes that can be reached from the source node.
|
static Node[] |
findReachableNodes(Network network, int sourceNodeID, MBR mbr, int depthLimit)
Returns all nodes that can be reached from the source node.
|
static Node[] |
findReachableNodes(Network network, int sourceNodeID, MBR mbr, int depthLimit, int maxNoOfNodes)
Returns all nodes that can be reached from the source node.
|
static Node[] |
findReachableNodes(Network network, int sourceNodeID, MBR mbr, int depthLimit, NetworkConstraint constraint, int maxNoOfNodes)
Returns all nodes that can be reached from the source node.
|
static Node[] |
findReachableNodes(Network network, int sourceNodeID, NetworkConstraint constraint)
Returns all nodes that can be reached from the source node.
|
static Node[] |
findReachingNodes(Network network, int targetNodeID)
Returns all nodes that can reach the target node.
|
static Node[] |
findReachingNodes(Network network, int targetNodeID, MBR mbr)
Returns all nodes that can reach the target node.
|
static Node[] |
findReachingNodes(Network network, int targetNodeID, MBR mbr, int depthLimit)
Returns all nodes that can reach the target node.
|
static Node[] |
findReachingNodes(Network network, int targetNodeID, MBR mbr, int depthLimit, NetworkConstraint constraint, int maxNoOfNodes)
Returns all nodes that can reach the target node.
|
static Node[] |
findReachingNodes(Network network, int targetNodeID, NetworkConstraint constraint)
Returns all nodes that can reach the target node.
|
static long |
getMaxFlow(Network network, int sourceNodeID, int sinkNodeID, java.util.Vector linkFlowVec)
Retunrs the max flow between the source node and the sink node
|
static java.util.HashMap |
getNetworkCacheMap()
Returns the network cache as a HashMap with network name (type: String) as keys and networks (type: Network) as values
|
static Network |
getNetworkFromCache(java.lang.String networkName)
Gets the network from the network cache if the specified network is not in the cache, null will be returned To add a network in the cache, use Networkmanager.putNetworkToCache(networkname, network)
|
static int |
getNetworkIDFromName(java.sql.Connection conn, java.lang.String networkName)
Returns the network ID from a given network name
|
static java.util.HashMap |
getNetworkIDs(java.sql.Connection conn)
Retunrs network names and IDs from the database.
|
static java.lang.String |
getNetworkNameFromID(java.sql.Connection conn, int networkID)
Returns the network name from a given network ID
|
static java.util.HashMap |
getNetworkNames(java.sql.Connection conn)
Retunrs network names and IDs from the database.
|
JGeometry |
getPathGeomFromDB(java.sql.Connection conn, Network network, Path path, java.lang.String linkTableName, java.lang.String linkGeomColumnName, java.lang.String nodeTableName, java.lang.String nodeGeomColumnName, double tolerance)
Gets/Computes the path geometry based on the geometries of path links and nodes in the database
|
static java.lang.String |
getVersion()
Returns the version of the SDO networkAdapter.
|
static void |
insertGeomMetadata(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName, int srid, SDODimArray dimArray)
Inserts the geometry metadata to the database.
|
static boolean |
isNetworkInCache(java.lang.String networkName)
Checks if a given network is in the cache
|
static boolean |
isNetworkPartitioned(java.sql.Connection conn, java.lang.String networkName)
Returns the partition ID of the given node
|
static boolean |
isReachable(Network network, int sourceNodeID, int targetNodeID)
Checks if the source node can reach the target node.
|
static boolean |
isReachable(Network network, int sourceNodeID, int targetNodeID, MBR mbr, int depthLimit)
Checks if the source node can reach the target node.
|
static boolean |
isReachable(Network network, int sourceNodeID, int targetNodeID, NetworkConstraint constraint)
Checks if the source node can reach the target node.
|
static void |
makeLogical(Network network)
Convert a spatial network to a logical network Note this only updates the network metadata information original spatial information remains unahcnged
|
static void |
makeSpatial(Network network, java.lang.String nodeGeomColumn, java.lang.String linkGeomColumn, java.lang.String pathGeomColumn)
Convert a logical network to a spatial network Note this only updates the network metadata information
|
static Network |
mcst(Network network)
Returns the minimum cost spanning tree (Kruskal Algorithm) as a network.
|
static Link[] |
mcstLinkArray(Network network)
Returns the minimum cost spanning tree (Kruskal Algorithm).
|
static Path[] |
nearestNeighbors(Network network, int startNodeID, int noOfNeighbors)
Returns the shortest paths of the N nearest neighbors from the start node.
|
static Path[] |
nearestNeighbors(Network network, int startNodeID, int noOfNeighbors, NetworkConstraint constraint)
Returns the shortest paths of the N nearest neighbors from the start node.
|
static Path[] |
nearestNeighbors(Network network, int startNodeID, int noOfNeighbors, NetworkConstraint constraint, GoalNode goalNodeFilter)
Returns the shortest paths of the N nearest neighbors from the specified start node.
|
static Path[] |
nearestReachingNeighbors(Network network, int startNodeID, int noOfNeighbors)
Returns the shortest paths of the N nearest reaching neighbors to the specified start node.
|
static Path[] |
nearestReachingNeighbors(Network network, int startNodeID, int noOfNeighbors, GoalNode goalNodeFilter)
Returns the shortest paths of the N nearest reaching neighbors to the specified start node.
|
static Path[] |
nearestReachingNeighbors(Network network, int startNodeID, int noOfNeighbors, NetworkConstraint constraint, GoalNode goalNodeFilter)
Returns the shortest paths of the N nearest reaching neighbors to the specified start node.
|
static boolean |
networkExists(java.sql.Connection conn, java.lang.String network)
Checks if the given network exists in the database.
|
static Path |
newPathToDestination(Network network, Path referencePath, int newStartNodeID, NetworkConstraint constraint)
Creates a new path starting from the new start node to the node on the reference path closest to the start node and to the end node of the reference path
|
static java.util.HashMap |
readGeometryFromDB(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName, java.lang.String keyColumnName, java.lang.String[] keyIDArray)
Returns Geometry from DB table in a HashaMap
|
static java.lang.Object |
readJavaObject(java.sql.Connection conn, java.lang.String name)
Reads in the given Java object from the database to memory
|
static Network |
readNetwork(java.sql.Connection conn, java.lang.String networkName)
Returns the read-only network from the database.
|
static Network |
readNetwork(java.sql.Connection conn, java.lang.String networkName, boolean readForUpdate)
Returns the network from the database.
|
static Network |
readNetwork(java.sql.Connection conn, java.lang.String networkName, boolean readForUpdate, UserDataIO ioFunction, java.lang.String sqlNodeFilter, java.lang.String sqlLinkFilter, java.lang.String sqlPathFilter)
Returns the network with regard to the given filters.
|
static Network |
readNetwork(java.sql.Connection conn, java.lang.String networkName, boolean readForUpdate, UserDataIO ioFunction, java.lang.String sqlNodeFilter, java.lang.String sqlLinkFilter, java.lang.String sqlPathFilter, boolean linksWithinNodeSet)
Returns the network with regard to the given filters.
|
static Network |
readNetwork(java.sql.Connection conn, java.lang.String networkName, int linkLevel, boolean readForUpdate)
Returns the network with the specified link level.
|
static Network |
readNetwork(java.sql.Connection conn, java.lang.String networkName, int linkLevel, boolean readForUpdate, UserDataIO ioFunction)
Returns the network with the specified link level.
|
static Network |
readNetwork(java.sql.Connection conn, java.lang.String networkName, MBR mbr, boolean readForUpdate)
Returns the network that is inside the specified MBR.
|
static Network |
readNetwork(java.sql.Connection conn, java.lang.String networkName, MBR mbr, boolean readForUpdate, UserDataIO ioFunction)
Returns the network that is inside the specified MBR.
|
static NetworkConstraint |
readNetworkConstraint(java.sql.Connection conn, java.lang.String networkConstraintName)
Reads in the given network constraint from the database to memory
|
static java.lang.Object |
readNetworkConstraintObject(java.sql.Connection conn, java.lang.String networkConstraintName)
Reads in the given network constraint from the database to memory
|
static java.util.HashMap |
readNetworkConstraints(java.sql.Connection conn)
Reads in the network constraints owned by the current schema from the database to memory
|
static java.util.HashMap |
readNetworkMetadata(java.sql.Connection conn)
Returns all network metadata from the database.
|
static NetworkMetadata |
readNetworkMetadata(java.sql.Connection conn, int networkID)
Returns the network metadata from the database by network ID.
|
static NetworkMetadata |
readNetworkMetadata(java.sql.Connection conn, java.lang.String networkName)
Returns the network metadata from the database by network name.
|
static void |
registerJavaObject(java.sql.Connection conn, java.lang.String name, java.lang.String className, java.lang.String directoryName, java.lang.String description, java.lang.String javaInterface)
Register the given Java object into user_sdo_network_java_objects
|
static void |
registerNetworkConstraint(java.sql.Connection conn, java.lang.String networkConstraintName, java.lang.String className, java.lang.String directoryName, java.lang.String description)
Register the given network constraint into user_sdo_network_constraints
|
static void |
removeNetworkFromCache(java.lang.String networkName)
Removes a network from the network cahce
|
static SubPath |
shortestPath(Network network, int startLinkID, double startPercentage, int endLinkID, double endPercentage, NetworkConstraint constraint)
Returns the shortest path as a sub path
|
static SubPath |
shortestPath(Network network, int startLinkID, double startPercentage, int endNodeID, NetworkConstraint constraint)
Returns the shortest path as a sub path
|
static Path |
shortestPath(Network network, int startNodeID, int goalNodeID)
Returns the shortest path based on the Dijkstra algorithm.
|
static SubPath |
shortestPath(Network network, int startNodeID, int endLinkID, double endPercentage, NetworkConstraint constraint)
Returns the shortest path as a sub path
|
static Path |
shortestPath(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint)
Returns the shortest path based on the Dijkstra algorithm.
|
static Path |
shortestPath(Path complexPath, NetworkConstraint constraint)
Returns the shortest path based on the Dijkstra algorithm.
|
static SubPath |
shortestPathAStar(Network network, int startLinkID, double startPercentage, int endLinkID, double endPercentage, NetworkConstraint constraint)
Returns the shortest path as a sub path using A* algorithm
|
static Path |
shortestPathAStar(Network network, int startNodeID, int goalNodeID)
Returns the shortest path based on the A* search algorithm.
|
static Path |
shortestPathAStar(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint)
Returns the shortest path based on the A* search algorithm.
|
static Path |
shortestPathAStar(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint, AStarCostFunction userCostFunction, double searchMultiplier)
Returns the shortest path based on the A* search algorithm.
|
static SubPath |
shortestPathDijkstra(Network network, int startLinkID, double startPercentage, int endLinkID, double endPercentage, NetworkConstraint constraint)
Returns the shortest path as a sub path using Dijkstra algorithm
|
static Path |
shortestPathDijkstra(Network network, int startNodeID, int goalNodeID)
Returns the shortest path based on the Dijkstra algorithm.
|
static Path |
shortestPathDijkstra(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint)
Returns the shortest path based on the Dijkstra algorithm.
|
static Path |
shortestPathDijkstra(Path complexPath, NetworkConstraint constraint)
Returns the shortest path based on the Dijkstra algorithm.
|
static Path[] |
shortestPaths(Network network, int startNodeID)
Returns all shortest paths from the given start node based on the Dijkstra algorithm.
|
static Path[] |
shortestPaths(Network network, int startNodeID, NetworkConstraint constraint)
Returns the shortest paths from the specified source node to any other nodes based on the Dijkstra algorithm.
|
static SubPath[] |
traceIn(Network network, int endLinkID, double endPercentage, double cost, NetworkConstraint constraint)
Returns trace in results in an array of SubPath
|
static SubPath[] |
traceIn(Network network, int endNodeID, double cost, NetworkConstraint constraint)
Returns trace in results in an array of SubPath
|
static SubPath[] |
traceOut(Network network, int startLinkID, double startPercentage, double cost, NetworkConstraint constraint)
Returns trace out results in an array of SubPath
|
static SubPath[] |
traceOut(Network network, int startNodeID, double cost, NetworkConstraint constraint)
Returns trace out results in an array of SubPath
|
static Path |
tspPath(Network network, int[] nodeIDArray, boolean isClosed, boolean useExactCost, NetworkConstraint constraint)
Returns a TSP tour.
|
static Path |
tspPath(Network network, int[] nodeIDArray, NetworkConstraint constraint)
Returns a TSP tour.
|
static Path |
tspPath(Node[] nodeArray, boolean isClosed, boolean useExactCost, NetworkConstraint constraint)
Returns a TSP tour.
|
static void |
updateLinks(java.sql.Connection conn, Network network, int[] linkIDArray)
Updates in-memory links from database
|
static void |
updateNetworkLinkCost(java.sql.Connection conn, Network network, java.lang.String costTableName, java.lang.String costColumnName)
Updates the cost of all network links with the value of the given cost column in the given table.
|
static void |
updateNetworkNodeCost(java.sql.Connection conn, Network network, java.lang.String costTableName, java.lang.String costColumnName)
Updates the cost of all network node with the value of the given cost column in the given table.
|
static void |
updateNodes(java.sql.Connection conn, Network network, int[] nodeIDArray)
Updates in-memory nodes from database
|
static void |
updatePaths(java.sql.Connection conn, Network network, int[] pathIDArray) |
static void |
updateSubPaths(java.sql.Connection conn, Network network, int[] subPathIDArray) |
static java.lang.String |
validateNetwork(Network network)
Validates the reference relationship of the given network return the validation result as a String
|
static java.lang.String |
validateNetworkSchema(java.sql.Connection conn, java.lang.String networkName)
Validates the network tables and reports any errors if exist.
|
static Path[] |
withinCost(Network network, int startNodeID, double cost)
Returns the shortest paths of the nodes that are within the specified cost from the given node.
|
static Path[] |
withinCost(Network network, int startNodeID, double cost, NetworkConstraint constraint)
Returns all paths that are within the specified cost.
|
static Path[] |
withinReachingCost(Network network, int startNodeID, double cost)
Returns all reaching paths that are within the specified cost.
|
static Path[] |
withinReachingCost(Network network, int startNodeID, double cost, NetworkConstraint constraint)
Returns all reaching paths that are within the specified cost.
|
static void |
writeNetwork(java.sql.Connection conn, Network network)
Writes the network to the database.
|
static void |
writeNetwork(java.sql.Connection conn, Network network, UserDataIO ioFunction)
Writes the network to the database.
|
static void |
writeNetworkMetadata(java.sql.Connection conn, NetworkMetadata metadata)
Writes the network metadata to the database.
|
public static java.lang.String getVersion()
public static Network readNetwork(java.sql.Connection conn, java.lang.String networkName) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkName
- the network namejava.sql.SQLException
NetworkDataException
public static Network readNetwork(java.sql.Connection conn, java.lang.String networkName, boolean readForUpdate) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkName
- the network namereadForUpdate
- the update mode if true or the read-only mode if falsejava.sql.SQLException
NetworkDataException
public static Network readNetwork(java.sql.Connection conn, java.lang.String networkName, MBR mbr, boolean readForUpdate) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkName
- the network namembr
- the bounding MBRreadForUpdate
- the update mode if true or the read-only mode if falsejava.sql.SQLException
NetworkDataException
public static Network readNetwork(java.sql.Connection conn, java.lang.String networkName, int linkLevel, boolean readForUpdate) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkName
- the network namelinkLevel
- the link levelreadForUpdate
- the update mode if true, read-only mode otherwisejava.sql.SQLException
NetworkDataException
public static Network readNetwork(java.sql.Connection conn, java.lang.String networkName, MBR mbr, boolean readForUpdate, UserDataIO ioFunction) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkName
- the network namembr
- the bounding MBRreadForUpdate
- the update mode if true or the read-only mode otherwiseioFunction
- the UserDataIO implementation for reading user datajava.sql.SQLException
NetworkDataException
public static Network readNetwork(java.sql.Connection conn, java.lang.String networkName, boolean readForUpdate, UserDataIO ioFunction, java.lang.String sqlNodeFilter, java.lang.String sqlLinkFilter, java.lang.String sqlPathFilter, boolean linksWithinNodeSet) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkName
- the network namereadForUpdate
- the update mode if true or the read-only mode otherwiseioFunction
- the UserDataIO implementation for reading user datasqlNodeFilter
- SQL node filtersqlLinkFilter
- SQL link filtersqlPathFilter
- SQL path filterjava.sql.SQLException
NetworkDataException
public static Network readNetwork(java.sql.Connection conn, java.lang.String networkName, boolean readForUpdate, UserDataIO ioFunction, java.lang.String sqlNodeFilter, java.lang.String sqlLinkFilter, java.lang.String sqlPathFilter) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkName
- the network namereadForUpdate
- the update mode if true or the read-only mode otherwiseioFunction
- the UserDataIO implementation for reading user datasqlNodeFilter
- SQL node filtersqlLinkFilter
- SQL link filtersqlPathFilter
- SQL path filterjava.sql.SQLException
NetworkDataException
public static Network readNetwork(java.sql.Connection conn, java.lang.String networkName, int linkLevel, boolean readForUpdate, UserDataIO ioFunction) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkName
- the network namelinkLevel
- the link levelreadForUpdate
- the update mode if true or the read-only mode otherwiseioFunction
- the UserDataIO implementation for reading user datajava.sql.SQLException
NetworkDataException
public static java.util.HashMap readNetworkMetadata(java.sql.Connection conn) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionjava.sql.SQLException
NetworkDataException
public static NetworkMetadata readNetworkMetadata(java.sql.Connection conn, java.lang.String networkName) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkName
- the network namejava.sql.SQLException
NetworkDataException
public static NetworkMetadata readNetworkMetadata(java.sql.Connection conn, int networkID) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetworkID
- the network namejava.sql.SQLException
NetworkDataException
public static void writeNetworkMetadata(java.sql.Connection conn, NetworkMetadata metadata) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionmetadata
- the network metadatajava.sql.SQLException
NetworkDataException
public static void writeNetwork(java.sql.Connection conn, Network network) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetwork
- the specified networkjava.sql.SQLException
NetworkDataException
public static void writeNetwork(java.sql.Connection conn, Network network, UserDataIO ioFunction) throws java.sql.SQLException, NetworkDataException
conn
- the database connectionnetwork
- the specified networkioFunction
- the UserDataIO implementation for writing user datajava.sql.SQLException
NetworkDataException
public static java.util.HashMap readNetworkConstraints(java.sql.Connection conn) throws java.sql.SQLException, NetworkDataException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
conn
- database connectionjava.sql.SQLException
NetworkDataException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static NetworkConstraint readNetworkConstraint(java.sql.Connection conn, java.lang.String networkConstraintName) throws java.sql.SQLException, NetworkDataException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
conn
- database connectionnetworkConstraintName
- the name of the network constraintjava.sql.SQLException
NetworkDataException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static java.lang.Object readNetworkConstraintObject(java.sql.Connection conn, java.lang.String networkConstraintName) throws java.sql.SQLException, NetworkDataException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
conn
- database connectionnetworkConstraintName
- the name of the network constraintjava.sql.SQLException
NetworkDataException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static java.lang.Object readJavaObject(java.sql.Connection conn, java.lang.String name) throws java.sql.SQLException, NetworkDataException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
conn
- database connectionname
- the name of the Java object in user_sdo_network_java_objectsjava.sql.SQLException
NetworkDataException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static void registerNetworkConstraint(java.sql.Connection conn, java.lang.String networkConstraintName, java.lang.String className, java.lang.String directoryName, java.lang.String description) throws java.sql.SQLException, NetworkDataException
conn
- database connectionnetworkConstraintName
- constraint nameclassName
- Should be given without suffix ".class"directoryName
- Must be the name of a valid Oracle directory objectdescription
-java.sql.SQLException
NetworkDataException
public static void deregisterNetworkConstraint(java.sql.Connection conn, java.lang.String networkConstraintName) throws java.sql.SQLException, NetworkDataException
conn
- database connectionnetworkConstraintName
- constraint namejava.sql.SQLException
NetworkDataException
public static void registerJavaObject(java.sql.Connection conn, java.lang.String name, java.lang.String className, java.lang.String directoryName, java.lang.String description, java.lang.String javaInterface) throws java.sql.SQLException, NetworkDataException
conn
- database connectionname
- name of object in user_sdo_network_java_classesclassName
- Should be given without suffix ".class"directoryName
- Must be the name of a valid Oracle directory objectdescription
- object descriptionjavaInterface
- Java interface implemented by this Java objectjava.sql.SQLException
NetworkDataException
public static void deregisterJavaObject(java.sql.Connection conn, java.lang.String name) throws java.sql.SQLException, NetworkDataException
conn
- database connectionname
- name of object in user_sdo_network_java_classesjava.sql.SQLException
NetworkDataException
public static Network mcst(Network network)
network
- the specified networkpublic static Link[] mcstLinkArray(Network network)
network
- the specified networkpublic static boolean isReachable(Network network, int sourceNodeID, int targetNodeID, MBR mbr, int depthLimit) throws NetworkDataException
network
- the specified networksourceNodeID
- the source node IDtargetNodeID
- the target node IDmbr
- the bounding MBRdepthLimit
- the depth limitNetworkDataException
public static boolean isReachable(Network network, int sourceNodeID, int targetNodeID) throws NetworkDataException
network
- the specified networksourceNodeID
- the source node IDtargetNodeID
- the target node IDNetworkDataException
public static boolean isReachable(Network network, int sourceNodeID, int targetNodeID, NetworkConstraint constraint) throws NetworkDataException
network
- the specified networksourceNodeID
- the source node IDtargetNodeID
- the target node IDconstraint
- the network constraintNetworkDataException
public static int findConnectedComponents(Network network)
network
- the specified networkpublic static java.util.Vector findConnectedComponentVector(Network network)
network
- the specified networkpublic static Node[] findReachableNodes(Network network, int sourceNodeID) throws NetworkDataException
network
- the specified networksourceNodeID
- the source node IDNetworkDataException
public static Node[] findReachableNodes(Network network, int sourceNodeID, MBR mbr) throws NetworkDataException
network
- the specified networksourceNodeID
- the source node IDmbr
- the bounding MBRNetworkDataException
public static Node[] findReachableNodes(Network network, int sourceNodeID, MBR mbr, int depthLimit) throws NetworkDataException
network
- the specified networksourceNodeID
- the source node IDmbr
- the MBRdepthLimit
- the depth limitNetworkDataException
public static Node[] findReachableNodes(Network network, int sourceNodeID, MBR mbr, int depthLimit, int maxNoOfNodes) throws NetworkDataException
network
- the specified networksourceNodeID
- the source node IDmbr
- the MBRdepthLimit
- the depth limitmaxNoOfNodes
- max. no of nodes returnedNetworkDataException
public static Node[] findReachableNodes(Network network, int sourceNodeID, MBR mbr, int depthLimit, NetworkConstraint constraint, int maxNoOfNodes) throws NetworkDataException
network
- the specified networksourceNodeID
- the source node IDmbr
- the MBRdepthLimit
- the depth limitconstraint
- network constraintmaxNoOfNodes
- max. no of nodes returnedNetworkDataException
public static Node[] findReachableNodes(Network network, int sourceNodeID, NetworkConstraint constraint) throws NetworkDataException
network
- the specified networksourceNodeID
- the source node IDconstraint
- the network constraintNetworkDataException
public static Node[] findReachingNodes(Network network, int targetNodeID) throws NetworkDataException
network
- the specified networktargetNodeID
- the target node IDNetworkDataException
public static Node[] findReachingNodes(Network network, int targetNodeID, MBR mbr) throws NetworkDataException
network
- the specified networktargetNodeID
- the target node IDmbr
- the MBRNetworkDataException
public static Node[] findReachingNodes(Network network, int targetNodeID, MBR mbr, int depthLimit) throws NetworkDataException
network
- the specified networktargetNodeID
- the target node IDmbr
- the MBRdepthLimit
- the depth limitNetworkDataException
public static Node[] findReachingNodes(Network network, int targetNodeID, MBR mbr, int depthLimit, NetworkConstraint constraint, int maxNoOfNodes) throws NetworkDataException
network
- the specified networktargetNodeID
- the target node IDmbr
- the MBRdepthLimit
- the depth limitconstraint
- network constraintmaxNoOfNodes
- max. no. of nodes returnedNetworkDataException
public static Node[] findReachingNodes(Network network, int targetNodeID, NetworkConstraint constraint) throws NetworkDataException
network
- the specified networktargetNodeID
- the target node IDconstraint
- the network constraintNetworkDataException
public static Path shortestPathAStar(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint, AStarCostFunction userCostFunction, double searchMultiplier) throws NetworkDataException
network
- the specified networkstartNodeID
- the start node IDgoalNodeID
- the goal node IDconstraint
- the network constraint, null if noneuserCostFunction
- a user-defined A* heuristic cost functionsearchMultiplier
- a multiplier that applied to the user cost (default = 1.0)NetworkDataException
public static Path shortestPathAStar(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint) throws NetworkDataException
network
- the specified networkstartNodeID
- the start node IDgoalNodeID
- the goal node IDconstraint
- the network constraint, null if noneNetworkDataException
public static SubPath shortestPathAStar(Network network, int startLinkID, double startPercentage, int endLinkID, double endPercentage, NetworkConstraint constraint) throws NetworkDataException
network
- target networkstartLinkID
- start link IDstartPercentage
- start percentage [0,1]endLinkID
- end link IDendPercentage
- end percentage [0,1]constraint
- network constraintNetworkDataException
public static Path shortestPathAStar(Network network, int startNodeID, int goalNodeID) throws NetworkDataException
network
- the specified networkstartNodeID
- the start node IDgoalNodeID
- the goal node IDNetworkDataException
public static Path shortestPath(Network network, int startNodeID, int goalNodeID) throws NetworkDataException
network
- the specified networkstartNodeID
- the start node IDgoalNodeID
- the goal node IDNetworkDataException
public static Path shortestPath(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDgoalNodeID
- the goal node IDconstraint
- the network constraint, null if noneNetworkDataException
public static SubPath shortestPath(Network network, int startLinkID, double startPercentage, int endLinkID, double endPercentage, NetworkConstraint constraint) throws NetworkDataException
network
- target networkstartLinkID
- start link IDstartPercentage
- start percentage [0,1]endLinkID
- end link IDendPercentage
- end percentage [0,1]constraint
- network constraintNetworkDataException
public static SubPath shortestPath(Network network, int startNodeID, int endLinkID, double endPercentage, NetworkConstraint constraint) throws NetworkDataException
network
- target networkstartNodeID
- start node IDendLinkID
- end link IDendPercentage
- end percentage [0,1]constraint
- network constraintNetworkDataException
public static SubPath shortestPath(Network network, int startLinkID, double startPercentage, int endNodeID, NetworkConstraint constraint) throws NetworkDataException
network
- target networkstartLinkID
- start link IDstartPercentage
- start percentage [0,1]endNodeID
- end node IDconstraint
- network constraintNetworkDataException
public static Path shortestPath(Path complexPath, NetworkConstraint constraint) throws NetworkDataException
complexPath
- the given complex pathconstraint
- the network constraint, null if noneNetworkDataException
public static Path shortestPathDijkstra(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDgoalNodeID
- the goal node IDconstraint
- the network constraint, null if noneNetworkDataException
public static SubPath shortestPathDijkstra(Network network, int startLinkID, double startPercentage, int endLinkID, double endPercentage, NetworkConstraint constraint) throws NetworkDataException
network
- target networkstartLinkID
- start link IDstartPercentage
- start percentage [0,1]endLinkID
- end link IDendPercentage
- end percentage [0,1]constraint
- network constraintNetworkDataException
public static Path shortestPathDijkstra(Network network, int startNodeID, int goalNodeID) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDgoalNodeID
- the goal node IDNetworkDataException
public static Path shortestPathDijkstra(Path complexPath, NetworkConstraint constraint) throws NetworkDataException
complexPath
- the given complex pathconstraint
- the network constraint, null if noneNetworkDataException
public static Path[] shortestPaths(Network network, int startNodeID, NetworkConstraint constraint) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDconstraint
- the network constraint, null if noneNetworkDataException
public static Path[] shortestPaths(Network network, int startNodeID) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDNetworkDataException
public static Path[] allPaths(Network network, int startNodeID, int goalNodeID, int depthLimit, double costLimit, int noOfSolutions) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDgoalNodeID
- the goal node IDdepthLimit
- the depth limitcostLimit
- the cost limitnoOfSolutions
- the number of solutions specifiedNetworkDataException
public static Path[] allPaths(Network network, int startNodeID, int goalNodeID, NetworkConstraint constraint, int noOfSolutions) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDgoalNodeID
- the goal node IDconstraint
- the network constraintnoOfSolutions
- the number of solutions specifiedNetworkDataException
public static Path[] allPaths(Path complexPath, int depthLimit, double costLimit, int noOfSolutions) throws NetworkDataException
complexPath
- the given complex pathdepthLimit
- the depth limitcostLimit
- the cost limitNetworkDataException
public static Path[] withinCost(Network network, int startNodeID, double cost, NetworkConstraint constraint) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDcost
- the cost limitconstraint
- the network constraint, null if noneNetworkDataException
public static Path[] withinCost(Network network, int startNodeID, double cost) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDcost
- the cost limitNetworkDataException
public static Path[] withinReachingCost(Network network, int startNodeID, double cost) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDcost
- the cost limitNetworkDataException
public static Path[] withinReachingCost(Network network, int startNodeID, double cost, NetworkConstraint constraint) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDcost
- the cost limitconstraint
- the network constraint, null if noneNetworkDataException
public static Path[] nearestNeighbors(Network network, int startNodeID, int noOfNeighbors, NetworkConstraint constraint, GoalNode goalNodeFilter) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDnoOfNeighbors
- the number of neighborsconstraint
- the network constraintgoalNodeFilter
- the goal node filterNetworkDataException
public static Path[] nearestNeighbors(Network network, int startNodeID, int noOfNeighbors, NetworkConstraint constraint) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDnoOfNeighbors
- the number of neighborsconstraint
- the network constraintNetworkDataException
public static Path[] nearestNeighbors(Network network, int startNodeID, int noOfNeighbors) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDnoOfNeighbors
- the number of neighborsNetworkDataException
public static Path[] nearestReachingNeighbors(Network network, int startNodeID, int noOfNeighbors, NetworkConstraint constraint, GoalNode goalNodeFilter) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDnoOfNeighbors
- the number of neighborsconstraint
- the network constraintgoalNodeFilter
- the goal node filterNetworkDataException
public static Path[] nearestReachingNeighbors(Network network, int startNodeID, int noOfNeighbors, GoalNode goalNodeFilter) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDnoOfNeighbors
- the number of neighborsgoalNodeFilter
- the goal node filterNetworkDataException
public static Path[] nearestReachingNeighbors(Network network, int startNodeID, int noOfNeighbors) throws NetworkDataException
network
- the given networkstartNodeID
- the start node IDnoOfNeighbors
- the number of neighborsNetworkDataException
public static java.lang.String validateNetworkSchema(java.sql.Connection conn, java.lang.String networkName)
public static boolean networkExists(java.sql.Connection conn, java.lang.String network) throws java.sql.SQLException
conn
- the database connectionnetworkName
- the network namejava.sql.SQLException
public static void dropNetwork(java.sql.Connection conn, java.lang.String network) throws java.sql.SQLException
conn
- the database connectionnetworkName
- the network to be droppedjava.sql.SQLException
public static void createNetworkHiearchy(Network network, int numHierarchy, int[] ndNumLevel) throws NetworkDataException, java.sql.SQLException
network
- the network whose hierarchy will be built. The assumption is that no hierarchy exists in this network before invoking this function.numHierarchy
- the extra number of hierarchy levels for this network. This number should be greater than one and less than the number o nodes in the given network. Since we assume the original network is at the level 1, after this operation, we will have numHierarchy+1 levels of network hierarchy. specifies the additional numHierarchy levels on top of the original network which is at the level one.ndNumLevel
- the number of nodes specified at each level. Here the node number should decrease with the increase of the level as we assume the original network is at the bottom level, i.e. level 1.NetworkDataException
java.sql.SQLException
public static void createRefConstraints(java.sql.Connection conn, java.lang.String network) throws java.sql.SQLException
conn
- the database connectionnetworkName
- the network namejava.sql.SQLException
public static void enableRefConstraints(java.sql.Connection conn, java.lang.String network) throws java.sql.SQLException
conn
- the database connectionnetworkName
- the network namejava.sql.SQLException
public static long getMaxFlow(Network network, int sourceNodeID, int sinkNodeID, java.util.Vector linkFlowVec) throws NetworkDataException, java.io.IOException
network
- network to be analyzedsourceNodeID
- source Node IDsinkNodeID
- sink node IDlinkFlowVec
- link flow returned in a VectorNetworkDataException
java.io.IOException
public static void disableRefConstraints(java.sql.Connection conn, java.lang.String network) throws java.sql.SQLException
conn
- the database connectionnetworkName
- the network namejava.sql.SQLException
public static void dropRefConstraints(java.sql.Connection conn, java.lang.String network) throws java.sql.SQLException
conn
- the database connectionnetworkName
- the network namejava.sql.SQLException
public static MBR findMBR(Node[] nodeArray, double expandFactor)
public static Path tspPath(Network network, int[] nodeIDArray, NetworkConstraint constraint) throws NetworkDataException
network
- the specified networknodeIDArray
- an array containing IDs of nodes to be visitedconstraint
- the network constraintNetworkDataException
public static Path tspPath(Network network, int[] nodeIDArray, boolean isClosed, boolean useExactCost, NetworkConstraint constraint) throws NetworkDataException
network
- the specified networknodeIDArray
- an array containing IDs of nodes to be visitedisClosed
- is the tour is closed?useExactCost
- if true, use the real cost, use the Cartesian distance otherwiseconstraint
- the network constraintNetworkDataException
public static Path tspPath(Node[] nodeArray, boolean isClosed, boolean useExactCost, NetworkConstraint constraint) throws NetworkDataException
nodeArray
- an array containing nodes to be visitedisClosed
- is the tour closed?useExactCost
- if true, use the real cost, use the Cartesian distance otherwiseconstraint
- network constraintNetworkDataException
public static Link[] findInternalLinks(Node[] nodeArray)
public static Link[] findExternalLinks(Node[] nodeArray1, Node[] nodeArray2)
public static void makeSpatial(Network network, java.lang.String nodeGeomColumn, java.lang.String linkGeomColumn, java.lang.String pathGeomColumn)
network
- network to be convertednodeGeomColumn
- geometry column name for node tablelinkGeomColumn
- geometry column name for link tablepathGeomColumn
- geometry column name for path tablepublic static void makeLogical(Network network)
network
- network to be convertedpublic static void insertGeomMetadata(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName, int srid, SDODimArray dimArray) throws java.sql.SQLException
conn
- the database connectiontableName
- the geometry table namegeomColumnName
- the geometry column namesrid
- the SRIDdimArray
- the SDODimArrayjava.sql.SQLException
public static java.lang.String getNetworkNameFromID(java.sql.Connection conn, int networkID) throws java.sql.SQLException
conn
- the database connectionnetworkID
- the network IDjava.sql.SQLException
public static int getNetworkIDFromName(java.sql.Connection conn, java.lang.String networkName) throws java.sql.SQLException
conn
- the database connectionnetworkName
- the network namejava.sql.SQLException
public static java.util.HashMap getNetworkNames(java.sql.Connection conn) throws java.sql.SQLException
conn
- the database connectionjava.sql.SQLException
public static java.util.HashMap getNetworkIDs(java.sql.Connection conn) throws java.sql.SQLException
conn
- the database connectionjava.sql.SQLException
public static boolean isNetworkPartitioned(java.sql.Connection conn, java.lang.String networkName) throws NetworkDataException, java.sql.SQLException
conn
- database connectionnetworkName
- network name in databasenodeID
- given node IDNetworkDataException
java.sql.SQLException
public static java.lang.String validateNetwork(Network network)
public static boolean isNetworkInCache(java.lang.String networkName)
networkName
- the given network namepublic static Network getNetworkFromCache(java.lang.String networkName)
networkName
- network namepublic static void addNetworkToCache(java.lang.String networkName, Network network)
networkName
- network namenetwork
- network to be cachedpublic static void removeNetworkFromCache(java.lang.String networkName)
networkName
- network namepublic static java.util.HashMap getNetworkCacheMap()
public static void clearNetworkCache()
public static Node[] findNodesWithinDegreeBounds(Network network, int degreeType, int minDegree, int maxDegree)
degreeType
- type of node degree, -1 : in-degree, 1: out-degree and 0: degreeminDegree
- minmum node degreemaxDegree
- maximum node degreepublic static int findMaxNodeDegree(Network network, int degreeType)
degreeType
- type of node degree, -1 : in-degree, 1: out-degree and 0: degreepublic static int findMinNodeDegree(Network network, int degreeType)
degreeType
- type of node degree, -1 : in-degree, 1: out-degree and 0: degreepublic static SubPath[] traceOut(Network network, int startNodeID, double cost, NetworkConstraint constraint) throws NetworkDataException
network
- target networkstartNodeID
- start node for trace outcost
- trace out cost limitconstraint
- network constraintNetworkDataException
public static SubPath[] traceOut(Network network, int startLinkID, double startPercentage, double cost, NetworkConstraint constraint) throws NetworkDataException
network
- target networkstartLinkID
- start link IDstartPercentage
- start percentage [0,1]cost
- trace out cost limitconstraint
- network constraintNetworkDataException
public static SubPath[] traceIn(Network network, int endNodeID, double cost, NetworkConstraint constraint) throws NetworkDataException
network
- target networkendNodeID
- end node for trace outcost
- trace in cost limitconstraint
- network constraintNetworkDataException
public static SubPath[] traceIn(Network network, int endLinkID, double endPercentage, double cost, NetworkConstraint constraint) throws NetworkDataException
network
- target networkendLinkID
- end link IDendPercentage
- end percentagecost
- trace in cost limitconstraint
- network constraintNetworkDataException
public static java.util.HashMap readGeometryFromDB(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName, java.lang.String keyColumnName, java.lang.String[] keyIDArray) throws java.sql.SQLException
conn
- jdbc connectiontableName
- geometry table namegeomColumnName
- geometry column namekeyColumnName
- key column namekeyIDArray
- key IDarrayjava.sql.SQLException
public static void updateNodes(java.sql.Connection conn, Network network, int[] nodeIDArray) throws java.sql.SQLException, NetworkDataException
conn
- jdbc connectionnetwork
- target networknodeIDArray
- ID array of the nodes to be updatedjava.sql.SQLException
NetworkDataException
public static void updateLinks(java.sql.Connection conn, Network network, int[] linkIDArray) throws java.sql.SQLException, NetworkDataException
conn
- jdbc connectionnetwork
- target networklinkIDArray
- ID array of the links to be updatedjava.sql.SQLException
NetworkDataException
public static void updatePaths(java.sql.Connection conn, Network network, int[] pathIDArray) throws java.sql.SQLException, NetworkDataException
java.sql.SQLException
NetworkDataException
public static void updateSubPaths(java.sql.Connection conn, Network network, int[] subPathIDArray) throws java.sql.SQLException, NetworkDataException
java.sql.SQLException
NetworkDataException
public JGeometry getPathGeomFromDB(java.sql.Connection conn, Network network, Path path, java.lang.String linkTableName, java.lang.String linkGeomColumnName, java.lang.String nodeTableName, java.lang.String nodeGeomColumnName, double tolerance) throws java.sql.SQLException, NetworkDataException
conn
- jdbc connectionnetwork
- target networkpath
- target pathlinkTableName
- link table namelinkGeomColumnName
- link geometry column namenodeTableName
- node table namenodeGeomColumnName
- node geometry column nametolerance
- tolerance for geometric connectivityjava.sql.SQLException
NetworkDataException
public static void updateNetworkLinkCost(java.sql.Connection conn, Network network, java.lang.String costTableName, java.lang.String costColumnName) throws java.sql.SQLException, NetworkDataException
conn
- databae connectionnetwork
- target networkcostTableName
- given cost table name. must have LINK_ID as primary key. if null network link table name will be usedcostColumnName
- given cost column name in the cost table. must be numeric data typejava.sql.SQLException
NetworkDataException
public static void updateNetworkNodeCost(java.sql.Connection conn, Network network, java.lang.String costTableName, java.lang.String costColumnName) throws java.sql.SQLException, NetworkDataException
conn
- databae connectionnetwork
- target networkcostTableName
- given cost table name. must have NODE_ID as primary key. if null network node table name will be usedcostColumnName
- given cost column name in the cost table. must be of numeric data typejava.sql.SQLException
NetworkDataException
public static Network convertNetworkBetweenWorkspaces(java.sql.Connection conn, Network sourceNetwork, java.lang.String sourceWorkspace, java.lang.String sourceSavepoint, java.lang.String targetWorkspace, java.lang.String targetSavepoint) throws java.sql.SQLException, NetworkDataException
conn
- database connectionsourceNetwork
- network in (sourceWorkspace,sourceSavepoint)sourceWorkspace
- source workspacesourceSavepoint
- source savepoint, "LATEST" if nulltargetWorkspace
- target workspacetargetSavepoint
- target savepoint, "LATEST" if nulljava.sql.SQLException
NetworkDataException
public static Path newPathToDestination(Network network, Path referencePath, int newStartNodeID, NetworkConstraint constraint) throws NetworkDataException
network
- target networkreferencePath
- reference pathnewStartNodeID
- new start node IDconstraint
- constraintNetworkDataException