00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Jeff Lait 00008 * Side Effects Software Inc. 00009 * 477 Richmond Street West, Suite 1001 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 */ 00014 00015 #ifndef __SIM_RandomTwister_h__ 00016 #define __SIM_RandomTwister_h__ 00017 00018 #include "SIM_API.h" 00019 #include <UT/UT_MTwister.h> 00020 #include "SIM_Random.h" 00021 00022 /// This class defines a bunch of useful tools for random number 00023 /// generation. It is designed to be attached as subdata to objects 00024 /// or solvers that need a stream of random numbers. 00025 class SIM_API SIM_RandomTwister : public SIM_Random 00026 { 00027 protected: 00028 explicit SIM_RandomTwister(const SIM_DataFactory *factory); 00029 virtual ~SIM_RandomTwister(); 00030 00031 virtual void initializeSubclass(); 00032 virtual void makeEqualSubclass(const SIM_Data *source); 00033 virtual void saveSubclass(ostream &os) const; 00034 virtual bool loadSubclass(UT_IStream &is); 00035 00036 virtual uint urandomSubclass(); 00037 virtual void setSeedSubclass(uint seed); 00038 00039 private: 00040 DECLARE_STANDARD_GETCASTTOTYPE(); 00041 DECLARE_DATAFACTORY(SIM_RandomTwister, 00042 SIM_Random, 00043 "Random Stream", 00044 getEmptyDopDescription()); 00045 00046 UT_MersenneTwister myTwister; 00047 }; 00048 00049 #endif
1.5.9