public class NearestEntryEvaluation extends Object implements org.jamesframework.core.problems.objectives.evaluations.Evaluation
AverageEntryToNearestEntry
and
AverageAccessionToNearestEntry
.Constructor and Description |
---|
NearestEntryEvaluation(double emptyValue) |
NearestEntryEvaluation(NearestEntryEvaluation toCopy)
Deep copy constructor
|
Modifier and Type | Method and Description |
---|---|
void |
add(int itemId,
NearestEntry nearestEntry)
Register the closest entry of a given item.
|
NearestEntry |
getClosest(int itemId)
Get the id of and distance to the closest selected item for an item with given id.
|
double |
getValue()
Compute average distance from each registered item to closest selected item.
|
boolean |
remove(int itemId)
Remove item and the registered closest entry (if any).
|
boolean |
update(int itemId,
NearestEntry nearestEntry)
Update the closest entry of a previously registered item.
|
public NearestEntryEvaluation(double emptyValue)
public NearestEntryEvaluation(NearestEntryEvaluation toCopy)
toCopy
- evaluation to copypublic void add(int itemId, NearestEntry nearestEntry)
itemId
- id of the itemnearestEntry
- id of and distance to the closest (other) selected itempublic boolean remove(int itemId)
itemId
- id of the itemtrue
if the item had been registered and is now removedpublic boolean update(int itemId, NearestEntry nearestEntry)
itemId
- id of the itemnearestEntry
- id of and distance to the closest (other) selected itemtrue
if the item had been registered and is now updatedpublic NearestEntry getClosest(int itemId)
itemId
- id of the itemnull
if no nearest entry has been registeredpublic double getValue()
getValue
in interface org.jamesframework.core.problems.objectives.evaluations.Evaluation
Copyright © 2017. All rights reserved.