public abstract class StepGenerator extends Object
Modifier and Type | Field and Description |
---|---|
protected BaseCalc.distribution_t |
mode |
static int |
NMAX_STOCHASTIC |
static int |
NP |
protected RandomGenerator |
random |
Constructor and Description |
---|
StepGenerator(BaseCalc.distribution_t mode,
RandomGenerator random) |
Modifier and Type | Method and Description |
---|---|
protected int |
_calculate_ngo(String where,
int n,
double p) |
int |
gaussianStep(int n,
double p)
Generate a random number from the normal distribution np±√(np(1-p)).
|
int |
nGo(int n,
double lnp) |
protected abstract int |
nGo(int n,
double lnp,
double r) |
int |
poissonStep(double np)
Generate a number form the approximate Poisson distribution with
average np.
|
int |
versatile_ngo(String descr,
int n,
double p)
Return a random variate from one of the distributions
appropriate for first-order reactions (binomial, gaussian,
poisson, or something in between, based on how large n is,
and also distribution_t mode specified when this object
was created.
|
protected final BaseCalc.distribution_t mode
protected final RandomGenerator random
public static final int NMAX_STOCHASTIC
public static final int NP
public StepGenerator(BaseCalc.distribution_t mode, RandomGenerator random)
protected abstract int nGo(int n, double lnp, double r)
public int nGo(int n, double lnp)
public int gaussianStep(int n, double p)
public int poissonStep(double np)
public int versatile_ngo(String descr, int n, double p)
protected int _calculate_ngo(String where, int n, double p)
Copyright © 2016. All rights reserved.