K - public class DefaultCostMatrixCreator<K extends Comparable<K>,J extends Comparable<J>> extends Object implements CostMatrixCreator<K,J>
CostMatrixCreator that build a cost matrix from 3 lists containing
the sources, the targets and the associated costs.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultCostMatrixCreator.Assignment |
| Constructor and Description |
|---|
DefaultCostMatrixCreator(List<K> rows,
List<J> cols,
double[] costs,
double alternativeCostFactor,
double percentile) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkInput() |
protected double |
computeAlternativeCosts() |
double |
getAlternativeCostForSource(K source)
Returns the value of the no-linking alternative cost for the specified
source.
|
double |
getAlternativeCostForTarget(J target)
Returns the value of the no-linking alternative cost for the specified
target.
|
String |
getErrorMessage() |
long |
getProcessingTime() |
SparseCostMatrix |
getResult() |
List<K> |
getSourceList()
Returns the list of sources in the generated cost matrix.
|
List<J> |
getTargetList()
Returns the list of targets in the generated cost matrix.
|
boolean |
process() |
public long getProcessingTime()
getProcessingTime in interface Benchmarkpublic SparseCostMatrix getResult()
getResult in interface OutputAlgorithm<SparseCostMatrix>public boolean checkInput()
checkInput in interface Algorithmprotected double computeAlternativeCosts()
public String getErrorMessage()
getErrorMessage in interface Algorithmpublic List<K> getSourceList()
CostMatrixCreatorgetSourceList in interface CostMatrixCreator<K extends Comparable<K>,J extends Comparable<J>>sourceList.get( i ) is
the source corresponding to the row i in the
generated cost matrix.CostMatrixCreator.getTargetList(),
OutputAlgorithm.getResult()public List<J> getTargetList()
CostMatrixCreatorgetTargetList in interface CostMatrixCreator<K extends Comparable<K>,J extends Comparable<J>>targetList.get( j )
is the target corresponding to the column j in the
generated cost matrix.CostMatrixCreator.getSourceList(),
OutputAlgorithm.getResult()public double getAlternativeCostForSource(K source)
CostMatrixCreatorgetAlternativeCostForSource in interface CostMatrixCreator<K extends Comparable<K>,J extends Comparable<J>>source - the source object.CostMatrixCreator.getSourceList().public double getAlternativeCostForTarget(J target)
CostMatrixCreatorgetAlternativeCostForTarget in interface CostMatrixCreator<K extends Comparable<K>,J extends Comparable<J>>target - the target object. Belongs to the list returned by
CostMatrixCreator.getTargetList().Copyright © 2015–2021 Fiji. All rights reserved.