FT::BernouilliCheater< Engine > Class Template Reference

#include <Cheaters.h>

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

List of all members.

Public Member Functions

 BernouilliCheater (const double &p=0.5, 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_UNIFORM)
 BernouilliCheater (const uint32_t seed, const double &p=0.5, 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_UNIFORM)
virtual ~BernouilliCheater ()
double p () 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::bernoulli_distribution _dist
boost::variate_generator
< Engine
&, boost::bernoulli_distribution<> > 
_generator

Friends

template<class T >
std::ostream & operator<< (std::ostream &os, const BernouilliCheater< T > &c)

Detailed Description

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

BernouilliCheater: cheater that behave as Bernouilli process


Constructor & Destructor Documentation

template<class Engine = boost::mt19937>
FT::BernouilliCheater< Engine >::BernouilliCheater ( const double &  p = 0.5,
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_UNIFORM 
) [inline]
template<class Engine = boost::mt19937>
FT::BernouilliCheater< Engine >::BernouilliCheater ( const uint32_t  seed,
const double &  p = 0.5,
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_UNIFORM 
) [inline]
template<class Engine = boost::mt19937>
virtual FT::BernouilliCheater< Engine >::~BernouilliCheater (  )  [inline, virtual]

Member Function Documentation

template<class Engine = boost::mt19937>
bool FT::BernouilliCheater< 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::BernouilliCheater< 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::BernouilliCheater< Engine >::p (  )  const [inline]

Friends And Related Function Documentation

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

Reimplemented from FT::Cheater< Engine >.


Member Data Documentation

template<class Engine = boost::mt19937>
boost::bernoulli_distribution FT::BernouilliCheater< Engine >::_dist [protected]

distribution

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

ramdom generator


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