public class EnforceUniqueByScore<A extends Associate> extends java.lang.Object implements Associate
Ensures that the source and/or destination features are uniquely associated by resolving ambiguity using association score and preferring matches with better scores.
NOTE: Unassociated matches are recomputed from scratch. It could potentially add to the list created by the original algorithm for a bit more efficiency.
AssociateUniqueByScoreAlg| Modifier and Type | Class and Description |
|---|---|
static class |
EnforceUniqueByScore.Describe<Desc>
Implementation of
EnforceUniqueByScore for AssociateDescription. |
static class |
EnforceUniqueByScore.Describe2D<Desc>
Implementation of
EnforceUniqueByScore for AssociateDescription2D. |
| Modifier and Type | Field and Description |
|---|---|
protected A |
association |
protected int |
numDestination |
protected int |
numSource |
protected FindUnassociated |
unassociated |
protected AssociateUniqueByScoreAlg |
uniqueByScore |
| Constructor and Description |
|---|
EnforceUniqueByScore(A association,
boolean checkSource,
boolean checkDestination)
Configures the algorithm to ensure source and/or destination features are unique.
|
| Modifier and Type | Method and Description |
|---|---|
void |
associate()
Finds the best match for each item in the source list with an item in the destination list.
|
org.ddogleg.struct.FastQueue<AssociatedIndex> |
getMatches()
List of associated features.
|
MatchScoreType |
getScoreType()
Specifies the type of score which is returned.
|
org.ddogleg.struct.GrowQueue_I32 |
getUnassociatedDestination()
Indexes of features in the destination set which are not associated.
|
org.ddogleg.struct.GrowQueue_I32 |
getUnassociatedSource()
Indexes of features in the source set which are not associated.
|
void |
setThreshold(double score)
Associations are only considered if their score is less than or equal to the specified threshold.
|
boolean |
uniqueDestination()
If at most one match is returned for each destination feature.
|
boolean |
uniqueSource()
If at most one match is returned for each source feature.
|
protected AssociateUniqueByScoreAlg uniqueByScore
protected FindUnassociated unassociated
protected int numSource
protected int numDestination
public EnforceUniqueByScore(A association, boolean checkSource, boolean checkDestination)
association - The association algorithm which is being wrappedcheckSource - Should source features be uniquecheckDestination - Should destination features be uniquepublic void associate()
Associatepublic org.ddogleg.struct.FastQueue<AssociatedIndex> getMatches()
AssociategetMatches in interface Associatepublic org.ddogleg.struct.GrowQueue_I32 getUnassociatedSource()
AssociategetUnassociatedSource in interface Associatepublic org.ddogleg.struct.GrowQueue_I32 getUnassociatedDestination()
AssociategetUnassociatedDestination in interface Associatepublic void setThreshold(double score)
AssociatesetThreshold in interface Associatescore - The threshold.public MatchScoreType getScoreType()
AssociategetScoreType in interface Associatepublic boolean uniqueSource()
AssociateuniqueSource in interface Associatepublic boolean uniqueDestination()
AssociateuniqueDestination in interface Associate