SimObjectVariationFactory Class Reference

Randomized generation of SimObjects. More...

#include <SimObjectVariationFactory.h>

Inheritance diagram for SimObjectVariationFactory:

Inheritance graph
[legend]
Collaboration diagram for SimObjectVariationFactory:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SimObjectVariationFactory (SimObjectFactory const &model)
 Creates a variation factory by using the model argument as a basis.
 SimObjectVariationFactory (SimObjectVariationFactory const &model)
virtual ~SimObjectVariationFactory ()
 Destruct me.
void set (string const &fieldname, RandomDistribution const &rd)
 Set the specified RandomDistribution for the given field.
virtual SimObjectcreate (void) const
 Return a pointer to a newly created SimObject using the factories number engine (use setRandomEngine to specify).
virtual SimObjectcreate (RandomEngine *eng) const
 Return a pointer to a newly created SimObject using the random number engine.
virtual object_type_t getObjectTypeID () const
 Return te object type of the objects generated by this factory.
void setRandomEngine (RandomEngine *eng)
 Explicitly specifies a random engine to be used with the RandomDistribution objects inside the factory.
void unsetRandomEngine (void)
 Tells the SimObjectVariationFactory to use the default random number engine.

Protected Types

typedef map< string,
FieldRngPair * > 
var_fields_t

Protected Attributes

SimObjectm_base
RandomEnginernd_eng
var_fields_t m_var_fields

Classes

struct  FieldRngPair


Detailed Description

Randomized generation of SimObjects.

Allows for specification of random distribution objects associated with each field of the SimObject class that is produced by the factory.

Definition at line 32 of file SimObjectVariationFactory.h.


Member Typedef Documentation

typedef map< string, FieldRngPair* > SimObjectVariationFactory::var_fields_t [protected]

Definition at line 79 of file SimObjectVariationFactory.h.


Constructor & Destructor Documentation

SimObjectVariationFactory::SimObjectVariationFactory ( SimObjectFactory const &  sof  ) 

Creates a variation factory by using the model argument as a basis.

Creates a variation factory by using the factory argument

Definition at line 28 of file SimObjectVariationFactory.cpp.

References SimObjectFactory::create(), ThreadSpecificRandomEngine::get(), ThreadSpecificRandomEngine::init(), m_base, rnd_eng, and theThreadSpecificRandomEngine.

Here is the call graph for this function:

SimObjectVariationFactory::SimObjectVariationFactory ( SimObjectVariationFactory const &  model  ) 

SimObjectVariationFactory::~SimObjectVariationFactory (  )  [virtual]

Destruct me.

Definition at line 48 of file SimObjectVariationFactory.cpp.

References m_base, and m_var_fields.


Member Function Documentation

void SimObjectVariationFactory::set ( string const &  fieldname,
RandomDistribution const &  rd 
)

Set the specified RandomDistribution for the given field.

Associates the field named fieldname of the SimObject with the RandomDistribution object, such that values for this parameter are generated from the RandomDistribution.

Reimplemented in ConnObjectFactory, and PopObjectFactory.

Definition at line 65 of file SimObjectVariationFactory.cpp.

References RandomDistribution::clone(), SimObject::findField(), m_base, and m_var_fields.

Referenced by PopObjectFactory::set(), and ConnObjectFactory::set().

Here is the call graph for this function:

SimObject * SimObjectVariationFactory::create ( void   )  const [virtual]

Return a pointer to a newly created SimObject using the factories number engine (use setRandomEngine to specify).

Reimplemented from SimObjectFactory.

Reimplemented in ConnObjectFactory, and PopObjectFactory.

Definition at line 86 of file SimObjectVariationFactory.cpp.

References rnd_eng.

Referenced by PopObjectFactory::create(), and ConnObjectFactory::create().

SimObject * SimObjectVariationFactory::create ( RandomEngine eng  )  const [virtual]

Return a pointer to a newly created SimObject using the random number engine.

  • eng

Reimplemented from SimObjectFactory.

Reimplemented in ConnObjectFactory, and PopObjectFactory.

Definition at line 75 of file SimObjectVariationFactory.cpp.

References SimObjectFactory::create(), m_base, m_var_fields, and SimObject::setScalarField().

Here is the call graph for this function:

object_type_t SimObjectVariationFactory::getObjectTypeID (  )  const [virtual]

Return te object type of the objects generated by this factory.

Reimplemented from SimObjectFactory.

Definition at line 91 of file SimObjectVariationFactory.cpp.

References SimObjectFactory::getObjectTypeID(), and m_base.

Here is the call graph for this function:

void SimObjectVariationFactory::setRandomEngine ( RandomEngine eng  )  [inline]

Explicitly specifies a random engine to be used with the RandomDistribution objects inside the factory.

This is actually not necessary since it is automatically and properly done

Definition at line 58 of file SimObjectVariationFactory.h.

References rnd_eng.

void SimObjectVariationFactory::unsetRandomEngine ( void   ) 

Tells the SimObjectVariationFactory to use the default random number engine.

Definition at line 56 of file SimObjectVariationFactory.cpp.

References ThreadSpecificRandomEngine::get(), ThreadSpecificRandomEngine::init(), rnd_eng, and theThreadSpecificRandomEngine.

Here is the call graph for this function:


Member Data Documentation


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

Generated on Wed Jul 9 16:34:53 2008 for PCSIM by  doxygen 1.5.5