57 #ifndef __RAND_GENERATOR_H__
58 #define __RAND_GENERATOR_H__
87 MENGE_API
void setDefaultGeneratorSeed(
int seed );
94 MENGE_API
int getDefaultSeed();
130 virtual void print(
Logger & out )
const = 0;
139 virtual float getValue()
const = 0;
149 virtual float getValueConcurrent()
const = 0;
201 virtual void print(
Logger & out )
const;
276 void set(
float mean,
float stddev,
float minVal,
float maxVal );
283 virtual float getValue()
const;
293 virtual float getValueConcurrent()
const;
300 virtual void print(
Logger & out )
const;
401 virtual float getValue()
const;
411 virtual float getValueConcurrent()
const;
418 virtual void print(
Logger & out )
const;
450 float getMax()
const {
return _min + _size; }
505 virtual int getValue()
const = 0;
515 virtual int getValueConcurrent()
const = 0;
525 virtual void print(
Logger & out )
const = 0;
575 virtual void print(
Logger & out )
const;
632 void setRange(
int minVal,
int maxVal ) { _min = minVal; _size = maxVal - minVal + 1; }
639 virtual int getValue()
const;
649 virtual int getValueConcurrent()
const;
656 virtual void print(
Logger & out )
const;
725 virtual Vector2 getValue()
const = 0;
735 virtual Vector2 getValueConcurrent()
const = 0;
745 virtual void print(
Logger & out )
const = 0;
797 virtual void print(
Logger & out )
const;
845 virtual void print(
Logger & out )
const;
901 virtual Vector2 getValue()
const;
911 virtual Vector2 getValueConcurrent()
const;
927 virtual void print(
Logger & out )
const;
984 virtual Vector2 getValue()
const;
994 virtual Vector2 getValueConcurrent()
const;
1001 virtual void print(
Logger & out )
const;
1117 virtual int getValue()
const;
1127 virtual int getValueConcurrent()
const;
1135 void addValue(
int value,
float weight );
1142 virtual void print(
Logger & out )
const;
1206 MENGE_API
FloatGenerator * createFloatGenerator( TiXmlElement * node,
float scale=1.f,
const std::string & prefix=
"" );
1219 MENGE_API
IntGenerator * createIntGenerator( TiXmlElement * node,
const std::string & prefix=
"" );
1234 MENGE_API
Vec2DGenerator * create2DGenerator( TiXmlElement * node,
float scale=1.f );
1239 #endif // __RAND_GENERATOR_H__
SimpleLock _lock
The lock for guaranteeing threadsafe random number generation.
Definition: RandGenerator.h:363
unsigned int _calls
The number of calls to the generator. Every second call requires a new call to the random number gene...
Definition: RandGenerator.h:353
float _wt
The weight of the value.
Definition: RandGenerator.h:1076
SimpleLock _lock
The lock for guaranteeing threadsafe random number generation.
Definition: RandGenerator.h:1189
The definition of a simple thrading lock.
Const2DGenerator(const Vector2 &val)
Constructor.
Definition: RandGenerator.h:821
std::vector< WeightedInt > _pairs
The weighted values to select from.
Definition: RandGenerator.h:1184
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
Logger & operator<<(Logger &out, const BFSM::PropertyOperand op)
Friend function for printing string versions of the PropertyOperand enum.
Definition: FSMEnumeration.cpp:43
Generic abstract class which generates a scalar float value.
Definition: RandGenerator.h:99
virtual Vector2 getValue() const
Return a value based on the 2D float generation rules.
Definition: RandGenerator.h:828
Sets up the proper compiler directives for platform and dll export/import.
FloatGenerator()
Constructor.
Definition: RandGenerator.h:104
int _value
The generator's constant value.
Definition: RandGenerator.h:602
An IntGenerator which returns a constant value.
Definition: RandGenerator.h:544
The definition of a simple mutex-style lock.
Definition: SimpleLock.h:62
virtual Vec2DGenerator * copy() const
Create a copy of itself.
Definition: RandGenerator.h:854
virtual float getValue() const
Return a value based on the float generation rules.
Definition: RandGenerator.h:184
virtual Vector2 getValue() const
Return a value based on the 2D float generation rules.
Definition: RandGenerator.h:771
Generic abstract class which generates a 2D vector float values.
Definition: RandGenerator.h:706
virtual ~IntGenerator()
Virtual destructor.
Definition: RandGenerator.h:496
virtual float getValueConcurrent() const
Return a value based on the float generation rules - performed in a thread-safe manner.
Definition: RandGenerator.h:194
UniformFloatGenerator _dice
A uniform float generator for "rolling the dice".
Definition: RandGenerator.h:1179
float _std
The standard deviation of the value.
Definition: RandGenerator.h:329
An html logger - writes messages to a formatted html file.
Definition: Logger.h:59
ConstFloatGenerator(float value)
Constructor.
Definition: RandGenerator.h:177
int _val
The value of the entry.
Definition: RandGenerator.h:1071
virtual ~Vec2DGenerator()
Virtual destructor.
Definition: RandGenerator.h:716
The namespace for math primitives for simulation and visualization.
float _min
The lower clamped value, such that all values returned will be greater than or equal to minVal...
Definition: RandGenerator.h:336
float _max
The upper clamped value, such that all values returned will be less than or equal to maxVal...
Definition: RandGenerator.h:342
A number generator based on a weighted probability of a discrete value set.
Definition: RandGenerator.h:1096
virtual Vector2 getValueConcurrent() const
Return a value based on the 2D float generation rules - performed in a thread-safe manner...
Definition: RandGenerator.h:781
A 2D float generator which always returns a constant 2D vector.
Definition: RandGenerator.h:814
Generic abstract class which generates a scalar integer value.
Definition: RandGenerator.h:486
Vector2 _value
The constant value to return.
Definition: RandGenerator.h:869
ConstIntGenerator(int value)
Constructor.
Definition: RandGenerator.h:551
virtual ~FloatGenerator()
Virtual destructor.
Definition: RandGenerator.h:109
Collection of Vector2, Vector3, and constants for simple inclusion.
A weighted integer value. Used with WeightedIntGenerator.
Definition: RandGenerator.h:1058
virtual Vector2 getValueConcurrent() const
Return a value based on the 2D float generation rules - performed in a thread-safe manner...
Definition: RandGenerator.h:838
float _value
The generator's constant value.
Definition: RandGenerator.h:225
float _mean
The mean value of the distribution.
Definition: RandGenerator.h:324
virtual int getValueConcurrent() const
Return a value based on the integer generation rules - performed in a thread-safe manner...
Definition: RandGenerator.h:568
virtual Vec2DGenerator * copy() const
Create a copy of itself.
Definition: RandGenerator.h:790
int _seed
A seed for the random number generator.
Definition: RandGenerator.h:358
A FloatGenerator which returns a constant value.
Definition: RandGenerator.h:170
virtual int getValue() const
Return a value based on the integer generation rules.
Definition: RandGenerator.h:558
float _second
The second random number generated (see Math::r4_normalR).
Definition: RandGenerator.h:347
A FloatGenerator which returns a normally distributed value.
Definition: RandGenerator.h:243
A 2D float generator which always returns a zero.
Definition: RandGenerator.h:764
Vec2DGenerator()
Constructor.
Definition: RandGenerator.h:711
WeightedInt(int value, float weight)
Constructor.
Definition: RandGenerator.h:1066
IntGenerator()
Constructor.
Definition: RandGenerator.h:491