public class ArgMin<T,V extends Comparable<V>> extends Object
V: type of value over which the max decision is made. T: type of the objects which generate the values
In case of ties, if randomTieBreak
is false
the first object is chosen;
otherwise it's a random choice.
Example:
Suppose we have a list of strings that can be scored and we wish to track the maximum.
ArgMax<Double, String> argmax = new Argmax<Double, String>(Double.NEGATIVE_INFINITY, ""); for (String str : stringList) // stringList is probably an array of Strings { argmax.update(str, getScore(str)); } double maxValue = argmax.getMaxValue(); String argmaxString = argmax.getArgMax();
Constructor and Description |
---|
ArgMin(T initialObject,
V initialValue) |
ArgMin(T initialObject,
V initialValue,
boolean randomTieBreak) |
Modifier and Type | Method and Description |
---|---|
T |
getArgmin() |
V |
getMinValue() |
String |
toString() |
void |
update(T object,
V value) |
Copyright © 2017. All rights reserved.