org.cfpm.caves.za
Class SouthAfricaModel.EmpiricalDiscreteDist

java.lang.Object
  extended by org.cfpm.caves.za.SouthAfricaModel.EmpiricalDiscreteDist
Enclosing class:
SouthAfricaModel

 class SouthAfricaModel.EmpiricalDiscreteDist
extends java.lang.Object

This inner class defines a discrete distribution of empirical values, e.g. the marital status of females. The distribution does not store the actual values (e.g. single, married, divorced, widowed) but replaces them with integer numbers from 0 to n-1, to be used as indices into the array of values. The user has to specify the probabilities for the values and a random number generator.

Author:
Ruth

Field Summary
(package private)  double[] probabilities
           
(package private)  cern.jet.random.engine.RandomEngine randomGenerator
           
 
Constructor Summary
SouthAfricaModel.EmpiricalDiscreteDist(double[] probabilities, cern.jet.random.engine.RandomEngine randomGenerator)
           
 
Method Summary
 int nextInt()
          returns a new sample, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

randomGenerator

cern.jet.random.engine.RandomEngine randomGenerator

probabilities

double[] probabilities
Constructor Detail

SouthAfricaModel.EmpiricalDiscreteDist

public SouthAfricaModel.EmpiricalDiscreteDist(double[] probabilities,
                                              cern.jet.random.engine.RandomEngine randomGenerator)
Method Detail

nextInt

public int nextInt()
returns a new sample, i.e. index value between 0 and n-1