public class DefaultPairwiseCostCalculator extends java.lang.Object implements PairwiseCostCalculator, XMLConfigurable
Constructor and Description |
---|
DefaultPairwiseCostCalculator() |
DefaultPairwiseCostCalculator(PairwiseShortestPaths pwsp)
Constructs a default pairwise cost calculator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
calculate(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.String |
getXMLSchema()
Returns the XML schema for the input parameter.
|
void |
init(org.w3c.dom.Element parameter)
Initializes the XML configurable object with the input parameter.
|
void |
setNetworkAnalyst(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.
|
public DefaultPairwiseCostCalculator()
public DefaultPairwiseCostCalculator(PairwiseShortestPaths pwsp)
pwsp
- pairwise shortest path algorithm.public boolean calculate(PointOnNet[][] startPoints, PointOnNet[][] endPoints, LODNetworkConstraint constraint, Matrix<java.lang.Integer> pairwiseMatrix) throws LODNetworkException
calculate
in interface PairwiseCostCalculator
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.LODNetworkException
public Matrix<LogicalSubPath> getPairwisePaths()
getPairwisePaths
in interface PairwiseCostCalculator
public Matrix<double[]> getPairwiseCosts()
getPairwiseCosts
in interface PairwiseCostCalculator
public void setNetworkAnalyst(NetworkAnalyst analyst)
PairwiseCostCalculator
setNetworkAnalyst
in interface PairwiseCostCalculator
public void init(org.w3c.dom.Element parameter)
XMLConfigurable
init
in interface XMLConfigurable
parameter
- an XML element containing the necessary information to initialize the object.public java.lang.String getXMLSchema()
XMLConfigurable
getXMLSchema
in interface XMLConfigurable