dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
ParGABuilder< S > Class Template Reference

Parallel Genetic Algorithm Builder. This class creates a unique_ptr to a Parallel Genetic Algorithm. More...

#include <ParGABuilder.h>

Public Member Functions

 operator unique_ptr< ParallelGeneticAlgorithm< S >> ()
 Builds the actual Parallel Genetic Algorithm using the specified components and parameters. More...
 
ParGABuilder< S > & usingCores (const int &cores)
 Defines the number of cores that the Parallel Genetic Algorithm will be using. More...
 
ParGABuilder< S > & toSolve (unique_ptr< Problem< S >> problem)
 Defines the problem to solve with the Genetic Algorithm. Receives a unique_ptr and takes the ownership of it. More...
 
ParGABuilder< S > & with ()
 This method only returns *this and it is used to make the building process more natural. Completely optional. More...
 
ParGABuilder< S > & crossover (CXType cxType)
 Defines the crossover operator type to use with this Genetic Algorithm. Variants are available at CXType. More...
 
ParGABuilder< S > & crossover (unique_ptr< Crossover< S >>)
 Defines the crossover operator type to use with this Genetic Algorithm. Receives a unique_ptr and takes the ownership of it. More...
 
ParGABuilder< S > & withCrossRate (const float &crossRate)
 Defines the crossover rate to apply the crossover operator. More...
 
ParGABuilder< S > & mutation (MutType mutation)
 Defines the mutation operator type to use with this Genetic Algorithm. Variants are available at MutType. More...
 
ParGABuilder< S > & withMutRate (const float &mutRate)
 Defines the mutation rate to apply in the mutation operator. More...
 
ParGABuilder< S > & selection (SelType selType)
 Defines the selection operator to use with this Genetic Algorithm. Variants are available at SelType. More...
 
ParGABuilder< S > & populationOf (const int &popsize)
 Defines the number of individuals in the population of the Genetic Algorithm. More...
 
ParGABuilder< S > & runDuring (const int &maxEvals)
 Sets the number of evaluations to perform. More...
 

Static Public Member Functions

static ParGABuilder< S > create ()
 Creates a ParGABuilder object. More...
 

Detailed Description

template<class S>
class ParGABuilder< S >

Parallel Genetic Algorithm Builder. This class creates a unique_ptr to a Parallel Genetic Algorithm.

Template Parameters
S

Member Function Documentation

◆ create()

template<class S >
ParGABuilder< S > ParGABuilder< S >::create
static

Creates a ParGABuilder object.

Template Parameters
S
Returns
ParGABuilder

◆ crossover() [1/2]

template<class S >
ParGABuilder< S > & ParGABuilder< S >::crossover ( CXType  cx)

Defines the crossover operator type to use with this Genetic Algorithm. Variants are available at CXType.

Template Parameters
S
Parameters
cx
Returns
ParGABuilder&

◆ crossover() [2/2]

template<class S >
ParGABuilder< S > & ParGABuilder< S >::crossover ( unique_ptr< Crossover< S >>  cx)

Defines the crossover operator type to use with this Genetic Algorithm. Receives a unique_ptr and takes the ownership of it.

Template Parameters
S
Parameters
cx
Returns
ParGABuilder&

◆ mutation()

template<class S >
ParGABuilder< S > & ParGABuilder< S >::mutation ( MutType  mutation)

Defines the mutation operator type to use with this Genetic Algorithm. Variants are available at MutType.

Template Parameters
S
Parameters
mutation
Returns
ParGABuilder&

◆ operator unique_ptr< ParallelGeneticAlgorithm< S >>()

template<class S >
ParGABuilder< S >::operator unique_ptr< ParallelGeneticAlgorithm< S >>

Builds the actual Parallel Genetic Algorithm using the specified components and parameters.

Template Parameters
S
Returns
unique_ptr<ParallelGeneticAlgorithm>

◆ populationOf()

template<class S >
ParGABuilder< S > & ParGABuilder< S >::populationOf ( const int &  popsize)

Defines the number of individuals in the population of the Genetic Algorithm.

Template Parameters
S
Parameters
popsize
Returns
ParGABuilder&

◆ runDuring()

template<class S >
ParGABuilder< S > & ParGABuilder< S >::runDuring ( const int &  maxEvals)

Sets the number of evaluations to perform.

Template Parameters
S
Parameters
maxEvals
Returns
ParGABuilder&

◆ selection()

template<class S >
ParGABuilder< S > & ParGABuilder< S >::selection ( SelType  selType)

Defines the selection operator to use with this Genetic Algorithm. Variants are available at SelType.

Template Parameters
S
Parameters
selType
Returns
ParGABuilder&

◆ toSolve()

template<class S >
ParGABuilder< S > & ParGABuilder< S >::toSolve ( unique_ptr< Problem< S >>  problem)

Defines the problem to solve with the Genetic Algorithm. Receives a unique_ptr and takes the ownership of it.

Template Parameters
S
Parameters
problem
Returns
ParGABuilder&

◆ usingCores()

template<class S >
ParGABuilder< S > & ParGABuilder< S >::usingCores ( const int &  cores)

Defines the number of cores that the Parallel Genetic Algorithm will be using.

Template Parameters
S
Parameters
cores
Returns
ParGABuilder&

◆ with()

template<class S >
ParGABuilder<S>& ParGABuilder< S >::with ( )
inline

This method only returns *this and it is used to make the building process more natural. Completely optional.

Returns
ParGABuilder&

◆ withCrossRate()

template<class S >
ParGABuilder< S > & ParGABuilder< S >::withCrossRate ( const float &  crossRate)

Defines the crossover rate to apply the crossover operator.

Template Parameters
S
Parameters
crossRate
Returns
ParGABuilder&

◆ withMutRate()

template<class S >
ParGABuilder< S > & ParGABuilder< S >::withMutRate ( const float &  mutRate)

Defines the mutation rate to apply in the mutation operator.

Template Parameters
S
Parameters
mutRate
Returns
ParGABuilder&

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