Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
Menge::Math::AABBUniformPosGenerator Class Reference

Generates a 2D float value uniformly distributed in an axis-aligned box (AAB). More...

#include <RandGenerator.h>

Inheritance diagram for Menge::Math::AABBUniformPosGenerator:
Menge::Math::Vec2DGenerator

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 Vec2DGeneratorcopy () 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

Loggeroperator<< (Logger &out, const AABBUniformPosGenerator &gen)
 Friend function for writing string representation to an output stream. More...
 

Detailed Description

Generates a 2D float value uniformly distributed in an axis-aligned box (AAB).

Constructor & Destructor Documentation

Menge::Math::AABBUniformPosGenerator::AABBUniformPosGenerator ( const Vector2 minPt,
const Vector2 maxPt,
int  seed = 0 
)

Constructor.

Parameters
minPtThe minimum extent of the AAB.
maxPtThe maximum extent of the AAB.
seedIf 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.

Parameters
aabbGenThe generator to copy its values from.

Member Function Documentation

Vec2DGenerator * Menge::Math::AABBUniformPosGenerator::copy ( ) const
virtual

Create a copy of itself.

Returns
A pointer to a new generator which is a copy of this one. The caller of this function is responsible for freeing up the memory for the copy.

Implements Menge::Math::Vec2DGenerator.

Vector2 Menge::Math::AABBUniformPosGenerator::getValue ( ) const
virtual

Return a value based on the 2D float generation rules.

Returns
A constat position uniformly samples from an AAB.

Implements Menge::Math::Vec2DGenerator.

Vector2 Menge::Math::AABBUniformPosGenerator::getValueConcurrent ( ) const
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.

Returns
A 2D float value.

Implements Menge::Math::Vec2DGenerator.

void Menge::Math::AABBUniformPosGenerator::print ( Logger out) const
virtual

Function for converting the generator to a string on a output stream.

Parameters
outThe output stream to write the string representation to.

Implements Menge::Math::Vec2DGenerator.

Friends And Related Function Documentation

Logger& operator<< ( Logger out,
const AABBUniformPosGenerator gen 
)
friend

Friend function for writing string representation to an output stream.

Parameters
outThe output stream.
genAn instance of the generator to represent as a string.
Returns
Reference to the input output stream.

The documentation for this class was generated from the following files: