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 Benchmark
public SparseCostMatrix getResult()
getResult
in interface OutputAlgorithm<SparseCostMatrix>
public boolean checkInput()
checkInput
in interface Algorithm
protected double computeAlternativeCosts()
public String getErrorMessage()
getErrorMessage
in interface Algorithm
public List<K> getSourceList()
CostMatrixCreator
getSourceList
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()
CostMatrixCreator
getTargetList
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)
CostMatrixCreator
getAlternativeCostForSource
in interface CostMatrixCreator<K extends Comparable<K>,J extends Comparable<J>>
source
- the source object.CostMatrixCreator.getSourceList()
.public double getAlternativeCostForTarget(J target)
CostMatrixCreator
getAlternativeCostForTarget
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.