35static 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);
82double Normal(
double mi,
double sigma)
86 for (i=0; i<12; i++) SUM +=
Random();
87 return (SUM-6.0)*sigma + mi;
94double 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) { }
141double 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));
210double 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) { }
Internal header file for SIMLIB/C++.
Implementation of class CalendarList interface is static - using global functions in SQS namespace.
double Gamma(double alfa, double beta)
Gamma distribution generator.
double Rayle(double delta)
void SIMLIB_error(const enum _ErrEnum N)
print error message and abort program
double Triag(double mod, double min, double max)
double Beta(double th, double fi, double min, double max)
Beta distribution generator.
double Uniform(double l, double h)
Uniform distribution generator.
int NegBinM(double p, int m)
double Weibul(double lambda, double alfa)
Weibul distribution generator.
double min(double a, double b)
int NegBin(double q, int k)
double max(double a, double b)
double Erlang(double alfa, int beta)
Erlang distribution generator.
double Normal(double mi, double sigma)
Gauss distribution generator.
int HyperGeom(double p, int n, int m)
static double _gam(double AK)
double Exponential(double mv)
Exponential distribution generator.
int Poisson(double lambda)
Poisson distribution generator.
double Random()
base uniform generator (range 0-0.999999...) the default implementation is simple LCG 32bit
double Logar(double mi, double delta)
Main SIMLIB/C++ interface.