All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----aima.stat.rv.FiniteSampler | +----aima.stat.rv.BiasedNDie
A biased n-sided die.
This is the most trivial subclass of the class FiniteSampler
.
It essentially adds no new functionality; it wraps the FiniteSampler
with the intRV
interface.
See Also: FiniteSampler
public class BiasedNDie extends aima.stat.rv.FiniteSampler implements aima.stat.rv.intRV { // Constructors 3 public BiasedNDie(); public BiasedNDie(int); public BiasedNDie(int, double[]); // Methods 2 public int sample(); public Object sampleObject(); }
public BiasedNDie()
Constructor initializing only the random source.
public BiasedNDie(int n)
Constructor initializing the random source and the number of sides on the die.
public BiasedNDie(int n, double[] p)
Constructor initializing the random source, the number of sides, and the distribution.
public int sample()
Sample/roll the die.
- Returns:
- i with probability prob[i] (0 <= i < n.)
- Implements:
- sample in interface intRV
public Object sampleObject()
Sample/roll the die.
- Returns:
- Integer(i) with probability prob[i] (0 <= i < n.)
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4