00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __RANDOM_H
00019 #define __RANDOM_H
00020
00021 #include "defs.h"
00022 #include "csimul.h"
00023 #include "cmodule.h"
00024 #include "crng.h"
00025
00026
00027
00028 inline cRNG *__contextModuleRNG(int k) {
00029 return simulation.contextModule() ? simulation.contextModule()->rng(k) : ev.rng(k);
00030 }
00031
00038
00042 inline long intrand(long r) {return __contextModuleRNG(0)->intRand(r);}
00043
00047 inline double dblrand() {return __contextModuleRNG(0)->doubleRand();}
00048
00052 inline long genk_intrand(int k,long r) {return __contextModuleRNG(k)->intRand(r);}
00053
00057 inline double genk_dblrand(int k) {return __contextModuleRNG(k)->doubleRand();}
00059
00060 #endif
00061
00062