|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.mathutil.randomize.RandomChoice
public class RandomChoice
Generate random choices unevenly. This class is used to select random choices from a list, with a probability weight places on each item in the list. This is often called a Roulette Wheel in Machine Learning texts. How it differs from a Roulette Wheel that you might find in Las Vegas or Monte Carlo is that the areas that can be selected are not of uniform size. However, you can be sure that one will be picked. http://en.wikipedia.org/wiki/Fitness_proportionate_selection
Constructor Summary | |
---|---|
RandomChoice(double[] theProbabilities)
Construct a list of probabilities. |
Method Summary | |
---|---|
int |
generate(Random theGenerator)
Generate a random choice, based on the probabilities provided to the constructor. |
int |
generate(Random theGenerator,
int skip)
Generate a random choice, but skip one of the choices. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomChoice(double[] theProbabilities)
theProbabilities
- The probability of each item in the list.Method Detail |
---|
public int generate(Random theGenerator)
public int generate(Random theGenerator, int skip)
skip
- The choice to skip.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |