OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Variator< ind_t, CrossoverOperator, MutationOperator > Class Template Reference

#include <Variator.h>

Inherits CrossoverOperator< ind_t >, and MutationOperator< ind_t >.

Public Member Functions

 Variator (std::vector< std::string > dNames, Optimizer::bounds_t dVarBounds, Expressions::Named_t constraints, CmdArguments_t args)
 
 ~Variator ()
 
boost::shared_ptr< Population
< ind_t > > 
population ()
 
void initial_population (size_t sizeInitial, std::string fname)
 create an initial population More...
 
void infeasible (boost::shared_ptr< ind_t > ind)
 set an individual as infeasible: replace with a new individual More...
 
bool hasMoreIndividualsToEvaluate ()
 returns false if all individuals have been evaluated More...
 
boost::shared_ptr< ind_t > popIndividualToEvaluate ()
 return next individual to evaluate More...
 
void variate (std::vector< unsigned int > parents)
 

Protected Member Functions

void new_individual (Individual::genes_t &dvars)
 create a new individual More...
 
void new_individual ()
 create a new individual More...
 
void new_individual (boost::shared_ptr< ind_t > ind)
 copy an individual More...
 

Private Member Functions

double drand (double range)
 

Private Attributes

boost::shared_ptr< Population
< ind_t > > 
population_m
 population of individuals More...
 
CmdArguments_t args_
 user specified command line arguments More...
 
std::queue< unsigned int > individualsToEvaluate_m
 keep a queue of individuals that have to be evaluated More...
 
std::vector< std::string > dNames_m
 names of the design variables More...
 
Optimizer::bounds_t dVarBounds_m
 bounds on design variables More...
 
Expressions::Named_t constraints_m
 constraints More...
 
double mutationProbability_m
 probability of applying the mutation operator More...
 
double recombinationProbability_m
 probability of applying the recombination operator More...
 

Detailed Description

template<class ind_t, template< class > class CrossoverOperator, template< class > class MutationOperator>
class Variator< ind_t, CrossoverOperator, MutationOperator >

Definition at line 24 of file Variator.h.

Constructor & Destructor Documentation

template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
Variator< ind_t, CrossoverOperator, MutationOperator >::Variator ( std::vector< std::string >  dNames,
Optimizer::bounds_t  dVarBounds,
Expressions::Named_t  constraints,
CmdArguments_t  args 
)
inline
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
Variator< ind_t, CrossoverOperator, MutationOperator >::~Variator ( )
inline

Definition at line 65 of file Variator.h.

Member Function Documentation

template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
double Variator< ind_t, CrossoverOperator, MutationOperator >::drand ( double  range)
inlineprivate

Get a random double between [0, range]

Parameters
[in]rangeof random number
Returns
random double value between [0, range]

Definition at line 300 of file Variator.h.

Referenced by Variator< ind_t, CrossoverOperator, MutationOperator >::variate().

template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
bool Variator< ind_t, CrossoverOperator, MutationOperator >::hasMoreIndividualsToEvaluate ( )
inline

returns false if all individuals have been evaluated

Definition at line 144 of file Variator.h.

References Variator< ind_t, CrossoverOperator, MutationOperator >::individualsToEvaluate_m.

template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
void Variator< ind_t, CrossoverOperator, MutationOperator >::infeasible ( boost::shared_ptr< ind_t >  ind)
inline

set an individual as infeasible: replace with a new individual

Definition at line 138 of file Variator.h.

References Variator< ind_t, CrossoverOperator, MutationOperator >::new_individual(), and Variator< ind_t, CrossoverOperator, MutationOperator >::population_m.

Referenced by Variator< ind_t, CrossoverOperator, MutationOperator >::variate().

Here is the call graph for this function:

template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
void Variator< ind_t, CrossoverOperator, MutationOperator >::initial_population ( size_t  sizeInitial,
std::string  fname 
)
inline
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
void Variator< ind_t, CrossoverOperator, MutationOperator >::new_individual ( Individual::genes_t dvars)
inlineprotected
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
void Variator< ind_t, CrossoverOperator, MutationOperator >::new_individual ( )
inlineprotected
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
void Variator< ind_t, CrossoverOperator, MutationOperator >::new_individual ( boost::shared_ptr< ind_t >  ind)
inlineprotected
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
boost::shared_ptr<ind_t> Variator< ind_t, CrossoverOperator, MutationOperator >::popIndividualToEvaluate ( )
inline
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
boost::shared_ptr< Population<ind_t> > Variator< ind_t, CrossoverOperator, MutationOperator >::population ( )
inline
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
void Variator< ind_t, CrossoverOperator, MutationOperator >::variate ( std::vector< unsigned int >  parents)
inline

Member Data Documentation

template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
CmdArguments_t Variator< ind_t, CrossoverOperator, MutationOperator >::args_
private
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
Expressions::Named_t Variator< ind_t, CrossoverOperator, MutationOperator >::constraints_m
private
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
std::vector<std::string> Variator< ind_t, CrossoverOperator, MutationOperator >::dNames_m
private
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
Optimizer::bounds_t Variator< ind_t, CrossoverOperator, MutationOperator >::dVarBounds_m
private
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
std::queue<unsigned int> Variator< ind_t, CrossoverOperator, MutationOperator >::individualsToEvaluate_m
private
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
double Variator< ind_t, CrossoverOperator, MutationOperator >::mutationProbability_m
private

probability of applying the mutation operator

Definition at line 291 of file Variator.h.

Referenced by Variator< ind_t, CrossoverOperator, MutationOperator >::variate(), and Variator< ind_t, CrossoverOperator, MutationOperator >::Variator().

template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
boost::shared_ptr< Population<ind_t> > Variator< ind_t, CrossoverOperator, MutationOperator >::population_m
private
template<class ind_t , template< class > class CrossoverOperator, template< class > class MutationOperator>
double Variator< ind_t, CrossoverOperator, MutationOperator >::recombinationProbability_m
private

probability of applying the recombination operator

Definition at line 293 of file Variator.h.

Referenced by Variator< ind_t, CrossoverOperator, MutationOperator >::variate(), and Variator< ind_t, CrossoverOperator, MutationOperator >::Variator().


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