35 static double _gam(
double AK)
38 double FK,PROD,DG,G,W;
40 FK = K = (int) floor(AK);
45 for(i=1; i<=K; i++) PROD *=
Random();
50 if (DG <= 0.015)
return (G);
82 double Normal(
double mi,
double sigma)
86 for (i=0; i<12; i++) SUM +=
Random();
87 return (SUM-6.0)*sigma + mi;
94 double Weibul(
double lambda,
double alfa)
100 while ((R=
Random()) == 0 || R == 1) { }
101 W= pow (-1.0/lambda*log(1.0-R), 1.0/alfa);
114 for (i=0; i<beta; i++) ER *=
Random();
115 return -alfa*log(ER);
132 while ((R=
Random()) == 0) { }
141 double Gamma(
double alfa,
double beta)
154 double exp = -mv * std::log(1.0-
Random());
195 double RN,BMA,CMA,TR;
201 TR=min+sqrt(BMA*CMA*RN);
203 TR=max-sqrt(CMA*(1.0-RN)*(max-mod));
210 double Logar(
double mi,
double delta)
212 double VA =
Normal(mi, delta);
222 while ((R=
Random()) == 0) { }
223 return delta * sqrt(-log(R));
246 double sl=sqrt(lambda);
248 PSSN = (int) (
Normal(lambda, sl) + 0.5);
262 while ((R=
Random()) == 0) { }
static double _gam(double AK)
double Random()
base uniform generator (range 0-0.999999...) the default implementation is simple LCG 32bit ...
double Rayle(double delta)
void SIMLIB_error(const enum _ErrEnum N)
print error message and abort program
double Exponential(double mv)
Exponential distribution generator.
int Poisson(double lambda)
Poisson distribution generator.
int NegBin(double q, int k)
double Weibul(double lambda, double alfa)
Weibul distribution generator.
double Triag(double mod, double min, double max)
double Beta(double th, double fi, double min, double max)
Beta distribution generator.
Implementation of class CalendarList interface is static - using global functions in SQS namespace...
double max(double a, double b)
double Normal(double mi, double sigma)
Gauss distribution generator.
double min(double a, double b)
double Gamma(double alfa, double beta)
Gamma distribution generator.
Internal header file for SIMLIB/C++.
int HyperGeom(double p, int n, int m)
double Erlang(double alfa, int beta)
Erlang distribution generator.
Main SIMLIB/C++ interface.
double Uniform(double l, double h)
Uniform distribution generator.
int NegBinM(double p, int m)
double Logar(double mi, double delta)