FT::Cheater< Engine > Class Template Reference

This class modelize a generic cheater and is used as a base class for specialized cheaters. A cheat interviene at different granularity of tasks. More...

#include <Cheaters.h>

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

List of all members.

Public Member Functions

 Cheater (const edistribution_t d=UNDEFINED, 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)
 Cheater (const uint32_t seed, const edistribution_t d=UNDEFINED, 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 ~Cheater ()
Engine getEngine () const
edistribution_t getDistType () const
size_t getNbGenerations () const
task_level_t getTaskLevelToCheat () const
task_type_t getTaskTypeToCheat () const
cheat_mode_t getCheatMode () const
size_t getNbCheated () const
size_t getNbLevelTasks () const
double getCheatedTasksRatio () const
void setDistType (const edistribution_t &dist_type)
void seed (const uint32_t value=42u)
void setNbGenerations (const size_t &nb_generations)
void setCheatMode (const cheat_mode_t &cheat_mode)
void setTaskTypeToCheat (const task_type_t &task_type_to_cheat)
virtual bool cheat (const size_t age=0, const task_type_t tt=ALL_TASKS)=0
virtual bool cheatAtLevel (const task_level_t tl=NO_TASK_LEVEL, const size_t age=0, const task_type_t tt=ALL_TASKS)=0

Protected Attributes

Engine _prng
edistribution_t _dist_type
size_t _nb_generations
task_level_t _task_level_to_cheat
task_type_t _task_type_to_cheat
cheat_mode_t _cheat_mode
size_t _nb_cheated
size_t _nb_tasks

Friends

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

Detailed Description

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

This class modelize a generic cheater and is used as a base class for specialized cheaters. A cheat interviene at different granularity of tasks.


Constructor & Destructor Documentation

template<class Engine = boost::mt19937>
FT::Cheater< Engine >::Cheater ( const edistribution_t  d = UNDEFINED,
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]

Default constructor that initialize the cheater. The random generator is seeded with the current time.

Parameters:
d kind of distribution
nb_generations maximum number of generations to be run on which cheat can happen
tl granularity of the tasks to affect
tt type of task to cheat
cm cheat mode (useful for distribution that are not uniform)
template<class Engine = boost::mt19937>
FT::Cheater< Engine >::Cheater ( const uint32_t  seed,
const edistribution_t  d = UNDEFINED,
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]

Another constructor that initialize the cheater where the seed for the random generator is given

Parameters:
seed 
d kind of distribution
nb_generations maximum number of generations to be run on which cheat can happen
tl granularity of the tasks to affect
tt type of task to cheat
cm cheat mode (useful for distribution that are not uniform)
template<class Engine = boost::mt19937>
virtual FT::Cheater< Engine >::~Cheater (  )  [inline, virtual]

Member Function Documentation

template<class Engine = boost::mt19937>
virtual bool FT::Cheater< Engine >::cheat ( const size_t  age = 0,
const task_type_t  tt = ALL_TASKS 
) [pure 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

Implemented in FT::BernouilliCheater< Engine >, and FT::ExponentialCheater< Engine >.

template<class Engine = boost::mt19937>
virtual bool FT::Cheater< Engine >::cheatAtLevel ( const task_level_t  tl = NO_TASK_LEVEL,
const size_t  age = 0,
const task_type_t  tt = ALL_TASKS 
) [pure 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

Implemented in FT::BernouilliCheater< Engine >, and FT::ExponentialCheater< Engine >.

template<class Engine = boost::mt19937>
double FT::Cheater< Engine >::getCheatedTasksRatio (  )  const [inline]
template<class Engine = boost::mt19937>
cheat_mode_t FT::Cheater< Engine >::getCheatMode (  )  const [inline]
template<class Engine = boost::mt19937>
edistribution_t FT::Cheater< Engine >::getDistType (  )  const [inline]
template<class Engine = boost::mt19937>
Engine FT::Cheater< Engine >::getEngine (  )  const [inline]
template<class Engine = boost::mt19937>
size_t FT::Cheater< Engine >::getNbCheated (  )  const [inline]
template<class Engine = boost::mt19937>
size_t FT::Cheater< Engine >::getNbGenerations (  )  const [inline]
template<class Engine = boost::mt19937>
size_t FT::Cheater< Engine >::getNbLevelTasks (  )  const [inline]
template<class Engine = boost::mt19937>
task_level_t FT::Cheater< Engine >::getTaskLevelToCheat (  )  const [inline]
template<class Engine = boost::mt19937>
task_type_t FT::Cheater< Engine >::getTaskTypeToCheat (  )  const [inline]
template<class Engine = boost::mt19937>
void FT::Cheater< Engine >::seed ( const uint32_t  value = 42u  )  [inline]
template<class Engine = boost::mt19937>
void FT::Cheater< Engine >::setCheatMode ( const cheat_mode_t cheat_mode  )  [inline]
template<class Engine = boost::mt19937>
void FT::Cheater< Engine >::setDistType ( const edistribution_t dist_type  )  [inline]
template<class Engine = boost::mt19937>
void FT::Cheater< Engine >::setNbGenerations ( const size_t &  nb_generations  )  [inline]
template<class Engine = boost::mt19937>
void FT::Cheater< Engine >::setTaskTypeToCheat ( const task_type_t task_type_to_cheat  )  [inline]

Friends And Related Function Documentation

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

Member Data Documentation

template<class Engine = boost::mt19937>
cheat_mode_t FT::Cheater< Engine >::_cheat_mode [protected]

current cheat mode

template<class Engine = boost::mt19937>
edistribution_t FT::Cheater< Engine >::_dist_type [protected]

type if distribution

template<class Engine = boost::mt19937>
size_t FT::Cheater< Engine >::_nb_cheated [protected]

number of cheated tasks

template<class Engine = boost::mt19937>
size_t FT::Cheater< Engine >::_nb_generations [protected]

maximum number of generations to be run

template<class Engine = boost::mt19937>
size_t FT::Cheater< Engine >::_nb_tasks [protected]

total number of tasks considered at the level mentioned in _task_level_to_cheat

template<class Engine = boost::mt19937>
Engine FT::Cheater< Engine >::_prng [protected]

random number generators (boost::mt19937 by default)

template<class Engine = boost::mt19937>
task_level_t FT::Cheater< Engine >::_task_level_to_cheat [protected]

task level where the cheat should interviene

template<class Engine = boost::mt19937>
task_type_t FT::Cheater< Engine >::_task_type_to_cheat [protected]

task type to cheat


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