dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
EIGBuilder< IP, IS, OP, S > Class Template Reference

Class which represents a Builder for the EIG. Creates a EIG step by step from all the different components. More...

#include <EIGBuilder.h>

Public Member Functions

 operator unique_ptr< EIG< IP, IS, OP, S >> ()
 Builds a EIG object with all the components specified and returns a unique_ptr. More...
 
EIGBuilder< IP, IS, OP, S > & toSolve (unique_ptr< IP > problem)
 Defines the AbstractDomain to solve. More...
 
EIGBuilder< IP, IS, OP, S > & weights (const float &fW, const float &mW)
 Sets the weights that will be used in the Weighted Fitness Function. Notice that fW + nW = 1.0. More...
 
EIGBuilder< IP, IS, OP, S > & with ()
 This method only returns *this and it is used to make the building process more natural. Completely optional. More...
 
EIGBuilder< IP, IS, OP, S > & portfolio (vector< EA > &configs)
 Defines the portfolio of solvers to evaluate the instances during the evolutionary process. The first algorithm in the vector will be considered as the target for the instances. More...
 
EIGBuilder< IP, IS, OP, S > & withSearch (NSType nsType, unique_ptr< Distance< float >> dist, const float &thres, const float &finalThresh, const int k, bool warmUp=false)
 Novelty search configuration for the EIG. Here we define the Novelty Approach (Features, Performance), the distance Metric, the threshold to include a solution in the NS archive and the 'k' value to use in the KNN method during the NS execution. More...
 
EIGBuilder< IP, IS, OP, S > & evalWith (unique_ptr< InstanceFitness > evalMethod)
 Evaluation approach for generating instances. The instances must be considered easy to solve for the target or hard. More...
 
EIGBuilder< IP, IS, OP, S > & repeating (const int &reps)
 Defines how many repetitions the algorithms in the portfolio must perform over each instance in each generation of the EIG. More...
 
EIGBuilder< IP, IS, OP, S > & crossover (CXType cxType)
 Defines the crossover operator type to use with this Genetic Algorithm. Variants are available at CXType. More...
 
EIGBuilder< IP, IS, OP, S > & withCrossRate (const float &crSsRate)
 Defines the crossover rate to apply the crossover operator. More...
 
EIGBuilder< IP, IS, OP, S > & mutation (MutType mutation)
 Defines the mutation operator type to use with this Genetic Algorithm. Variants are available at MutType. More...
 
EIGBuilder< IP, IS, OP, S > & withMutRate (const float &mutRate)
 Defines the mutation rate to apply in the mutation operator. More...
 
EIGBuilder< IP, IS, OP, S > & selection (SelType selType)
 Defines the selection operator to use. Variants are available at SelType. More...
 
EIGBuilder< IP, IS, OP, S > & replacement (ReplacementTypes reType)
 
EIGBuilder< IP, IS, OP, S > & populationOf (const int &popsize)
 Defines the population of instances to use. This is the number of instances that the EIG will be evolving at each generation. More...
 
EIGBuilder< IP, IS, OP, S > & runDuring (const int &generations)
 Defines the number of generations to perform by EIG. Notice that the EIG works by generations instead of evaluations as others algorithms in dignea do. More...
 
EIGBuilder< IP, IS, OP, S > & setFeatures (const Features &f)
 Defines the Feature information for MapElites. More...
 

Static Public Member Functions

static EIGBuilder< IP, IS, OP, S > create (GeneratorType type)
 Creates a EIGBuilder object. More...
 

Detailed Description

template<typename IP, typename IS, typename OP, typename S>
class EIGBuilder< IP, IS, OP, S >

Class which represents a Builder for the EIG. Creates a EIG step by step from all the different components.

Template Parameters
IP
IS
OP
S

Member Function Documentation

◆ create()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > EIGBuilder< IP, IS, OP, S >::create ( GeneratorType  t)
static

Creates a EIGBuilder object.

Template Parameters
IP
IS
OP
S
Returns
EIGBuilder<IP, IS, OP, S>

◆ crossover()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::crossover ( CXType  cxType)

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

Template Parameters
IP
IS
OP
S
Parameters
cxType
Returns
EIGBuilder<IP, IS, OP, S>&

◆ evalWith()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::evalWith ( unique_ptr< InstanceFitness evalMethod)

Evaluation approach for generating instances. The instances must be considered easy to solve for the target or hard.

Template Parameters
IP
IS
OP
S
Parameters
evalMethod
Returns
EIGBuilder<IP, IS, OP, S>&

◆ mutation()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::mutation ( MutType  mutation)

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

Template Parameters
IP
IS
OP
S
Parameters
mutation
Returns
EIGBuilder<IP, IS, OP, S>&

◆ operator unique_ptr< EIG< IP, IS, OP, S >>()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S >::operator unique_ptr< EIG< IP, IS, OP, S >>

Builds a EIG object with all the components specified and returns a unique_ptr.

Template Parameters
IP
IS
OP
S
Returns
unique_ptr<EIG<IP, IS, OP, S>>

◆ populationOf()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::populationOf ( const int &  popsize)

Defines the population of instances to use. This is the number of instances that the EIG will be evolving at each generation.

Template Parameters
IP
IS
OP
S
Parameters
popsize
Returns
EIGBuilder<IP, IS, OP, S>&

◆ portfolio()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::portfolio ( vector< EA > &  configs)

Defines the portfolio of solvers to evaluate the instances during the evolutionary process. The first algorithm in the vector will be considered as the target for the instances.

Template Parameters
IP
IS
OP
S
Parameters
configs
Returns
EIGBuilder<IP, IS, OP, S>&

◆ repeating()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::repeating ( const int &  reps)

Defines how many repetitions the algorithms in the portfolio must perform over each instance in each generation of the EIG.

Template Parameters
IP
IS
OP
S
Parameters
reps
Returns
EIGBuilder<IP, IS, OP, S>&

◆ runDuring()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::runDuring ( const int &  generations)

Defines the number of generations to perform by EIG. Notice that the EIG works by generations instead of evaluations as others algorithms in dignea do.

Template Parameters
IP
IS
OP
S
Parameters
generations
Returns
EIGBuilder<IP, IS, OP, S>&

◆ selection()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::selection ( SelType  selType)

Defines the selection operator to use. Variants are available at SelType.

Template Parameters
IP
IS
OP
S
Parameters
selType
Returns
EIGBuilder<IP, IS, OP, S>&

◆ setFeatures()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::setFeatures ( const Features f)

Defines the Feature information for MapElites.

Template Parameters
IP
IS
OP
S
Parameters
generations
Returns
EIGBuilder<IP, IS, OP, S>&

◆ toSolve()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::toSolve ( unique_ptr< IP >  problem)

Defines the AbstractDomain to solve.

Template Parameters
IP
IS
OP
S
Parameters
problem
Returns
EIGBuilder<IP, IS, OP, S>&

◆ weights()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::weights ( const float &  fW,
const float &  nW 
)

Sets the weights that will be used in the Weighted Fitness Function. Notice that fW + nW = 1.0.

Template Parameters
IP
IS
OP
S
Parameters
fW
nW
Returns
EIGBuilder<IP, IS, OP, S>&

◆ with()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder<IP, IS, OP, S>& EIGBuilder< IP, IS, OP, S >::with ( )
inline

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

Returns
EIGBuilder<IP, IS, OP, S>&

◆ withCrossRate()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::withCrossRate ( const float &  crSsRate)

Defines the crossover rate to apply the crossover operator.

Template Parameters
IP
IS
OP
S
Parameters
crSsRate
Returns
EIGBuilder<IP, IS, OP, S>&

◆ withMutRate()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::withMutRate ( const float &  mutRate)

Defines the mutation rate to apply in the mutation operator.

Template Parameters
IP
IS
OP
S
Parameters
mutRate
Returns
EIGBuilder<IP, IS, OP, S>&

◆ withSearch()

template<typename IP , typename IS , typename OP , typename S >
EIGBuilder< IP, IS, OP, S > & EIGBuilder< IP, IS, OP, S >::withSearch ( NSType  nsType,
unique_ptr< Distance< float >>  dist,
const float &  thres,
const float &  finalThresh,
const int  k,
bool  warmUp = false 
)

Novelty search configuration for the EIG. Here we define the Novelty Approach (Features, Performance), the distance Metric, the threshold to include a solution in the NS archive and the 'k' value to use in the KNN method during the NS execution.

Template Parameters
IP
IS
OP
S
Parameters
nsType
dist
thres
k
Returns
EIGBuilder<IP, IS, OP, S>&

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