|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.util.obj.ChooseObject<T>
T - The type of object to choose from.public class ChooseObject<T>
This class is used to choose between several objects with a specified probability.
| Constructor Summary | |
|---|---|
ChooseObject()
|
|
| Method Summary | |
|---|---|
void |
add(double probability,
T opp)
Add an object. |
void |
clear()
CLear all objects from the collection. |
void |
finalizeStructure()
Finalize the structure and set the probabilities. |
List<ObjectHolder<T>> |
getList()
|
T |
pick(Random theGenerator)
Choose a random object. |
T |
pickFirst()
|
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChooseObject()
| Method Detail |
|---|
public void finalizeStructure()
public void add(double probability,
T opp)
probability - The probability to choose this object.opp - The object to add.public int size()
public T pick(Random theGenerator)
theGenerator -
public List<ObjectHolder<T>> getList()
public void clear()
public T pickFirst()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||