Menge
Modular Pedestrian Simulation Framework for Research and Development
|
Generates a 2D float value uniformly distributed in an axis-aligned box (AAB). More...
#include <RandGenerator.h>
Public Member Functions | |
AABBUniformPosGenerator (const Vector2 &minPt, const Vector2 &maxPt, int seed=0) | |
Constructor. More... | |
AABBUniformPosGenerator (const AABBUniformPosGenerator &aabbGen) | |
Copy constructor. More... | |
virtual Vector2 | getValue () const |
Return a value based on the 2D float generation rules. More... | |
virtual Vector2 | getValueConcurrent () const |
Return a value based on the 2D float generation rules - performed in a thread-safe manner. More... | |
virtual Vec2DGenerator * | copy () const |
Create a copy of itself. More... | |
virtual void | print (Logger &out) const |
Function for converting the generator to a string on a output stream. More... | |
Public Member Functions inherited from Menge::Math::Vec2DGenerator | |
Vec2DGenerator () | |
Constructor. | |
virtual | ~Vec2DGenerator () |
Virtual destructor. | |
Protected Attributes | |
UniformFloatGenerator | _xRand |
The random selector for the x-position of the return value. | |
UniformFloatGenerator | _yRand |
The random selector for the y-position of the return value. | |
SimpleLock | _lock |
The lock for guaranteeing threadsafe random number generation. | |
Friends | |
Logger & | operator<< (Logger &out, const AABBUniformPosGenerator &gen) |
Friend function for writing string representation to an output stream. More... | |
Generates a 2D float value uniformly distributed in an axis-aligned box (AAB).
Menge::Math::AABBUniformPosGenerator::AABBUniformPosGenerator | ( | const Vector2 & | minPt, |
const Vector2 & | maxPt, | ||
int | seed = 0 |
||
) |
Constructor.
minPt | The minimum extent of the AAB. |
maxPt | The maximum extent of the AAB. |
seed | If the seed is zero, the global seed will be used otherwise the particular seed will be used. |
Menge::Math::AABBUniformPosGenerator::AABBUniformPosGenerator | ( | const AABBUniformPosGenerator & | aabbGen | ) |
Copy constructor.
aabbGen | The generator to copy its values from. |
|
virtual |
Create a copy of itself.
Implements Menge::Math::Vec2DGenerator.
|
virtual |
Return a value based on the 2D float generation rules.
Implements Menge::Math::Vec2DGenerator.
|
virtual |
Return a value based on the 2D float generation rules - performed in a thread-safe manner.
This is the basic functionality that must be overwridden by derived classes.
Implements Menge::Math::Vec2DGenerator.
|
virtual |
Function for converting the generator to a string on a output stream.
out | The output stream to write the string representation to. |
Implements Menge::Math::Vec2DGenerator.
|
friend |
Friend function for writing string representation to an output stream.
out | The output stream. |
gen | An instance of the generator to represent as a string. |