FT::ExponentialCheater< Engine > Class Template Reference

#include <Cheaters.h>

Inheritance diagram for FT::ExponentialCheater< Engine >:
Inheritance graph
[legend]
Collaboration diagram for FT::ExponentialCheater< Engine >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ExponentialCheater (const double &lambda=1.0, const size_t nb_generations=200, const task_level_t tl=NO_TASK_LEVEL, const task_type_t tt=ALL_TASKS, const cheat_mode_t cm=CHEAT_OVER_GENERATIONS)
 ExponentialCheater (const uint32_t seed, const double &lambda=1.0, const size_t nb_generations=200, const task_level_t tl=NO_TASK_LEVEL, const task_type_t tt=ALL_TASKS, const cheat_mode_t cm=CHEAT_OVER_GENERATIONS)
virtual ~ExponentialCheater ()
double lambda () const
bool cheat (const size_t age=0, const task_type_t tt=ALL_TASKS)
bool cheatAtLevel (const task_level_t tl=NO_TASK_LEVEL, const size_t age=0, const task_type_t tt=ALL_TASKS)

Protected Attributes

boost::exponential_distribution _dist
boost::variate_generator
< Engine
&, boost::exponential_distribution<> > 
_generator

Friends

template<class T >
std::ostream & operator<< (std::ostream &os, const ExponentialCheater< T > &f)

Detailed Description

template<class Engine = boost::mt19937>
class FT::ExponentialCheater< Engine >

ExponentialCheater : a cheater that cheat using an exponential distribution based either on the age of the current generation or the position in the sequential order depending on the cheat_mode.
Reminder: cheat are distributed with probability density function p(x) = lambda * exp(-lambda * x), where lambda is the parameter of the constructor.


Constructor & Destructor Documentation

template<class Engine = boost::mt19937>
FT::ExponentialCheater< Engine >::ExponentialCheater ( const double &  lambda = 1.0,
const size_t  nb_generations = 200,
const task_level_t  tl = NO_TASK_LEVEL,
const task_type_t  tt = ALL_TASKS,
const cheat_mode_t  cm = CHEAT_OVER_GENERATIONS 
) [inline]
template<class Engine = boost::mt19937>
FT::ExponentialCheater< Engine >::ExponentialCheater ( const uint32_t  seed,
const double &  lambda = 1.0,
const size_t  nb_generations = 200,
const task_level_t  tl = NO_TASK_LEVEL,
const task_type_t  tt = ALL_TASKS,
const cheat_mode_t  cm = CHEAT_OVER_GENERATIONS 
) [inline]
template<class Engine = boost::mt19937>
virtual FT::ExponentialCheater< Engine >::~ExponentialCheater (  )  [inline, virtual]

Member Function Documentation

template<class Engine = boost::mt19937>
bool FT::ExponentialCheater< Engine >::cheat ( const size_t  age = 0,
const task_type_t  tt = ALL_TASKS 
) [inline, virtual]

decide is a cheat should be performed

Parameters:
age age of the current generation
tt type of the current task that call cheat
Returns:
true if a cheat should be done

Implements FT::Cheater< Engine >.

template<class Engine = boost::mt19937>
bool FT::ExponentialCheater< Engine >::cheatAtLevel ( const task_level_t  tl = NO_TASK_LEVEL,
const size_t  age = 0,
const task_type_t  tt = ALL_TASKS 
) [inline, virtual]

decide is a cheat should be performed

Parameters:
tl task level of the current task
age age of the current generation
tt type of the current task that call cheat
Returns:
true if a cheat should be done

Implements FT::Cheater< Engine >.

template<class Engine = boost::mt19937>
double FT::ExponentialCheater< Engine >::lambda (  )  const [inline]

Friends And Related Function Documentation

template<class Engine = boost::mt19937>
template<class T >
std::ostream& operator<< ( std::ostream &  os,
const ExponentialCheater< T > &  f 
) [friend]

Reimplemented from FT::Cheater< Engine >.


Member Data Documentation

template<class Engine = boost::mt19937>
boost::exponential_distribution FT::ExponentialCheater< Engine >::_dist [protected]

distribution

template<class Engine = boost::mt19937>
boost::variate_generator<Engine&, boost::exponential_distribution<> > FT::ExponentialCheater< Engine >::_generator [protected]

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

Generated on Fri Dec 11 22:28:17 2009 for LibGEP by  doxygen 1.6.1