Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

crng.h

00001 //==========================================================================
00002 //   CRNG.H  - part of
00003 //                     OMNeT++/OMNEST
00004 //            Discrete System Simulation in C++
00005 //
00006 //
00007 //  cRNG: interface for random number generator classes
00008 //
00009 //==========================================================================
00010 
00011 /*--------------------------------------------------------------*
00012   Copyright (C) 1992-2005 Andras Varga
00013 
00014   This file is distributed WITHOUT ANY WARRANTY. See the file
00015   `license' for details on this and other legal matters.
00016 *--------------------------------------------------------------*/
00017 
00018 #ifndef __CRNG_H
00019 #define __CRNG_H
00020 
00021 #include "defs.h"
00022 #include "cpolymorphic.h"
00023 
00024 class cConfiguration;
00025 
00026 
00048 class SIM_API cRNG : public cPolymorphic
00049 {
00050   protected:
00051     unsigned long numDrawn;
00052 
00053   public:
00054     cRNG() {numDrawn=0;}
00055     virtual ~cRNG() {}
00056 
00061     virtual void initialize(int runNumber, int id, int numRngs, cConfiguration *cfg) = 0;
00062 
00069     virtual void selfTest() = 0;
00070 
00075     virtual unsigned long numbersDrawn() {return numDrawn;}
00076 
00080     virtual unsigned long intRand() = 0;
00081 
00085     virtual unsigned long intRandMax() = 0;
00086 
00090     virtual unsigned long intRand(unsigned long n) = 0;
00091 
00095     virtual double doubleRand() = 0;
00096 
00100     virtual double doubleRandNonz() = 0;
00101 
00105     virtual double doubleRandIncl1() = 0;
00106 
00110     double doubleRandNonzIncl1() {return 1-doubleRand();}
00111 };
00112 
00113 #endif
00114 

Generated on Thu Jan 12 16:01:40 2006 for OMNeT++/OMNEST Simulation Library by  doxygen 1.4.1