Package oracle.spatial.network.lod
Class DefaultPairwiseCostCalculator
- java.lang.Object
-
- oracle.spatial.network.lod.DefaultPairwiseCostCalculator
-
- All Implemented Interfaces:
PairwiseCostCalculator,XMLConfigurable
public class DefaultPairwiseCostCalculator extends java.lang.Object implements PairwiseCostCalculator, XMLConfigurable
This is the default pairwise cost calculator. It calculates the pairwise costs using the input pairwise shortest path algorithm.- Since:
- 11gR2
-
-
Constructor Summary
Constructors Constructor Description DefaultPairwiseCostCalculator()DefaultPairwiseCostCalculator(PairwiseShortestPaths pwsp)Constructs a default pairwise cost calculator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancalculate(PointOnNet[][] startPoints, PointOnNet[][] endPoints, LODNetworkConstraint constraint, Matrix<java.lang.Integer> pairwiseMatrix)Computes the pairwise shortest path and the pairwise costs using the pairwise shortest paths algorithm passed in to the constructor.Matrix<double[]>getPairwiseCosts()Returns the pairwise costs.Matrix<LogicalSubPath>getPairwisePaths()Returns the pairwise shortest paths.java.lang.StringgetXMLSchema()Returns the XML schema for the input parameter.voidinit(org.w3c.dom.Element parameter)Initializes the XML configurable object with the input parameter.voidsetNetworkAnalyst(NetworkAnalyst analyst)This method allows caller to pass the network analyst object to this cost calculator implementation, so that the algorithm can call the analysis functions provided by the network analyst, or access the network explorer associated with the network analyst.
-
-
-
Constructor Detail
-
DefaultPairwiseCostCalculator
public DefaultPairwiseCostCalculator()
-
DefaultPairwiseCostCalculator
public DefaultPairwiseCostCalculator(PairwiseShortestPaths pwsp)
Constructs a default pairwise cost calculator.- Parameters:
pwsp- pairwise shortest path algorithm.
-
-
Method Detail
-
calculate
public boolean calculate(PointOnNet[][] startPoints, PointOnNet[][] endPoints, LODNetworkConstraint constraint, Matrix<java.lang.Integer> pairwiseMatrix) throws LODNetworkException
Computes the pairwise shortest path and the pairwise costs using the pairwise shortest paths algorithm passed in to the constructor.- Specified by:
calculatein interfacePairwiseCostCalculator- Parameters:
startPoints-endPoints-constraint-pairwiseMatrix- a matrix that specifies for which pairs the costs need to be computed. If the matrix element for pair (i, j) is set to 0, then the cost from i to j does not need to be computed; otherwise it must be computed. If this parameter is set to null, then the costs for all pairs must be computed.- Returns:
- Throws:
LODNetworkException
-
getPairwisePaths
public Matrix<LogicalSubPath> getPairwisePaths()
Returns the pairwise shortest paths.- Specified by:
getPairwisePathsin interfacePairwiseCostCalculator- Returns:
-
getPairwiseCosts
public Matrix<double[]> getPairwiseCosts()
Returns the pairwise costs.- Specified by:
getPairwiseCostsin interfacePairwiseCostCalculator- Returns:
-
setNetworkAnalyst
public void setNetworkAnalyst(NetworkAnalyst analyst)
Description copied from interface:PairwiseCostCalculatorThis method allows caller to pass the network analyst object to this cost calculator implementation, so that the algorithm can call the analysis functions provided by the network analyst, or access the network explorer associated with the network analyst. If network analyst is not needed by the cost calculator, the calculator can choose to do nothing with this method.- Specified by:
setNetworkAnalystin interfacePairwiseCostCalculator
-
init
public void init(org.w3c.dom.Element parameter)
Description copied from interface:XMLConfigurableInitializes the XML configurable object with the input parameter.- Specified by:
initin interfaceXMLConfigurable- Parameters:
parameter- an XML element containing the necessary information to initialize the object.
-
getXMLSchema
public java.lang.String getXMLSchema()
Description copied from interface:XMLConfigurableReturns the XML schema for the input parameter.- Specified by:
getXMLSchemain interfaceXMLConfigurable- Returns:
-
-