#include <EvolutionaryAlgorithm.h>
Public Types | |
enum | FitnessAssignmentMethod { LinearRanking } |
enum | SelectionMethod { RouletteWheel, StochasticUniversalSampling } |
enum | RecombinationMethod { Line, Intermediate } |
enum | MutationMethod { Normal, Uniform } |
Public Member Functions | |
EvolutionaryAlgorithm (ObjectiveFunctional *) | |
EvolutionaryAlgorithm (void) | |
virtual | ~EvolutionaryAlgorithm (void) |
int | get_population_size (void) |
Matrix< double > & | get_population (void) |
FitnessAssignmentMethod & | get_fitness_assignment_method (void) |
std::string | get_fitness_assignment_method_name (void) |
SelectionMethod & | get_selection_method (void) |
std::string | get_selection_method_name (void) |
RecombinationMethod & | get_recombination_method (void) |
std::string | get_recombination_method_name (void) |
MutationMethod & | get_mutation_method (void) |
std::string | get_mutation_method_name (void) |
Vector< double > & | get_evaluation (void) |
Vector< double > & | get_fitness (void) |
Vector< bool > & | get_selection (void) |
bool | get_elitism (void) |
double | get_selective_pressure (void) |
double | get_recombination_size (void) |
double | get_mutation_rate (void) |
double | get_mutation_range (void) |
double | get_maximum_generations_number (void) |
double | get_mean_evaluation_goal (void) |
double | get_standard_deviation_evaluation_goal (void) |
bool | get_reserve_population_history (void) |
bool | get_reserve_best_individual_history (void) |
bool | get_reserve_mean_norm_history (void) |
bool | get_reserve_standard_deviation_norm_history (void) |
bool | get_reserve_best_norm_history (void) |
bool | get_reserve_mean_evaluation_history (void) |
bool | get_reserve_standard_deviation_evaluation_history (void) |
bool | get_reserve_best_evaluation_history (void) |
Vector< Matrix< double > > & | get_population_history (void) |
Vector< Vector< double > > & | get_best_individual_history (void) |
Vector< double > & | get_mean_norm_history (void) |
Vector< double > & | get_standard_deviation_norm_history (void) |
Vector< double > & | get_best_norm_history (void) |
Vector< double > & | get_mean_evaluation_history (void) |
Vector< double > & | get_standard_deviation_evaluation_history (void) |
Vector< double > & | get_best_evaluation_history (void) |
void | set (void) |
void | set (ObjectiveFunctional *) |
void | set_default (void) |
void | set_fitness_assignment_method (const FitnessAssignmentMethod &) |
void | set_fitness_assignment_method (const std::string &) |
void | set_selection_method (const SelectionMethod &) |
void | set_selection_method (const std::string &) |
void | set_recombination_method (const RecombinationMethod &) |
void | set_recombination_method (const std::string &) |
void | set_mutation_method (const MutationMethod &) |
void | set_mutation_method (const std::string &) |
void | set_population_size (int) |
void | set_population (const Matrix< double > &) |
void | set_evaluation (const Vector< double > &) |
void | set_fitness (const Vector< double > &) |
void | set_selection (const Vector< bool > &) |
void | set_elitism (bool) |
void | set_selective_pressure (double) |
void | set_recombination_size (double) |
void | set_mutation_rate (double) |
void | set_mutation_range (double) |
void | set_maximum_generations_number (int) |
void | set_mean_evaluation_goal (double) |
void | set_standard_deviation_evaluation_goal (double) |
void | set_reserve_population_history (bool) |
void | set_reserve_best_individual_history (bool) |
void | set_reserve_mean_norm_history (bool) |
void | set_reserve_standard_deviation_norm_history (bool) |
void | set_reserve_best_norm_history (bool) |
void | set_reserve_mean_evaluation_history (bool) |
void | set_reserve_standard_deviation_evaluation_history (bool) |
void | set_reserve_best_evaluation_history (bool) |
void | set_reserve_all_training_history (bool) |
void | set_population_history (const Vector< Matrix< double > > &) |
void | set_best_individual_history (const Vector< Vector< double > > &) |
void | set_mean_norm_history (const Vector< double > &) |
void | set_standard_deviation_norm_history (const Vector< double > &) |
void | set_best_norm_history (const Vector< double > &) |
void | set_mean_evaluation_history (const Vector< double > &) |
void | set_standard_deviation_evaluation_history (const Vector< double > &) |
void | set_best_evaluation_history (const Vector< double > &) |
Vector< double > | get_individual (int) |
void | set_individual (int, const Vector< double > &) |
Vector< double > | get_best_individual (void) |
double | calculate_mean_evaluation (void) |
double | calculate_standard_deviation_evaluation (void) |
void | initialize_population (double) |
void | initialize_population_uniform (void) |
void | initialize_population_uniform (double, double) |
void | initialize_population_uniform (const Vector< double > &, const Vector< double > &) |
void | initialize_population_uniform (const Matrix< double > &) |
void | initialize_population_normal (void) |
void | initialize_population_normal (double, double) |
void | initialize_population_normal (const Vector< double > &, const Vector< double > &) |
void | initialize_population_normal (const Matrix< double > &) |
Vector< double > | calculate_population_norm (void) |
void | perform_fitness_assignment (void) |
void | perform_selection (void) |
void | perform_recombination (void) |
void | perform_mutation (void) |
void | evolve_population (void) |
void | evaluate_population (void) |
void | perform_linear_ranking_fitness_assignment (void) |
void | perform_roulette_wheel_selection (void) |
void | perform_stochastic_universal_sampling_selection (void) |
void | perform_intermediate_recombination (void) |
void | perform_line_recombination (void) |
void | perform_normal_mutation (void) |
void | perform_uniform_mutation (void) |
void | train (void) |
void | resize_training_history (int) |
std::string | get_training_history_XML (bool) |
std::string | to_XML (bool) |
void | load (const char *) |
Definition at line 30 of file EvolutionaryAlgorithm.h.
Enumeration of the available training operators for fitness assignment.
Definition at line 39 of file EvolutionaryAlgorithm.h.
Enumeration of the available training operators for mutation.
Definition at line 51 of file EvolutionaryAlgorithm.h.
Enumeration of the available training operators for recombination.
Definition at line 47 of file EvolutionaryAlgorithm.h.
Enumeration of the available training operators for selection.
Definition at line 43 of file EvolutionaryAlgorithm.h.
Flood::EvolutionaryAlgorithm::EvolutionaryAlgorithm | ( | ObjectiveFunctional * | new_objective_functional_pointer | ) | [explicit] |
General constructor. It creates a evolutionary training algorithm object associated to an objective functional object. It also initializes the class members to their default values: Training operators:
new_objective_functional_pointer | Pointer to an objective functional object. |
Definition at line 80 of file EvolutionaryAlgorithm.cpp.
Flood::EvolutionaryAlgorithm::EvolutionaryAlgorithm | ( | void | ) | [explicit] |
Default constructor. It creates a evolutionary training algorithm object not associated to any objective functional object. It also initializes the class members to their default values: Training operators:
Definition at line 131 of file EvolutionaryAlgorithm.cpp.
Flood::EvolutionaryAlgorithm::~EvolutionaryAlgorithm | ( | void | ) | [virtual] |
Vector< double > Flood::EvolutionaryAlgorithm::calculate_population_norm | ( | void | ) |
This method returns a vector containing the norm of each individual in the population.
Definition at line 1341 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::evaluate_population | ( | void | ) |
This method evaluates the objective functional of all individuals in the population. Results are stored in the evaluation vector.
Definition at line 1985 of file EvolutionaryAlgorithm.cpp.
Vector< double > & Flood::EvolutionaryAlgorithm::get_best_evaluation_history | ( | void | ) |
This method returns a history with the evaluation value of the best individual ever during training.
Definition at line 502 of file EvolutionaryAlgorithm.cpp.
Vector< double > & Flood::EvolutionaryAlgorithm::get_best_norm_history | ( | void | ) |
This method returns the best norm history.
Definition at line 472 of file EvolutionaryAlgorithm.cpp.
Vector< double > & Flood::EvolutionaryAlgorithm::get_evaluation | ( | void | ) |
This method returns the actual evaluation value of all individuals in the population.
Definition at line 339 of file EvolutionaryAlgorithm.cpp.
Vector< double > & Flood::EvolutionaryAlgorithm::get_fitness | ( | void | ) |
This method returns the actual fitness value of all individuals in the population.
Definition at line 349 of file EvolutionaryAlgorithm.cpp.
EvolutionaryAlgorithm::FitnessAssignmentMethod & Flood::EvolutionaryAlgorithm::get_fitness_assignment_method | ( | void | ) |
This method returns the fitness assignment method used for training.
Definition at line 153 of file EvolutionaryAlgorithm.cpp.
std::string Flood::EvolutionaryAlgorithm::get_fitness_assignment_method_name | ( | void | ) |
This method returns a string with the name of the method used for fitness assignment.
Definition at line 163 of file EvolutionaryAlgorithm.cpp.
Vector< double > Flood::EvolutionaryAlgorithm::get_individual | ( | int | i | ) |
This method returns the Vector of parameters corresponding to the individual i in the population.
i | Index of individual in the population. |
Definition at line 1262 of file EvolutionaryAlgorithm.cpp.
double Flood::EvolutionaryAlgorithm::get_maximum_generations_number | ( | void | ) |
This method returns the maximum number of generations to train.
Definition at line 1427 of file EvolutionaryAlgorithm.cpp.
Vector< double > & Flood::EvolutionaryAlgorithm::get_mean_evaluation_history | ( | void | ) |
This method returns a history with the mean evaluation of the population during training.
Definition at line 482 of file EvolutionaryAlgorithm.cpp.
Vector< double > & Flood::EvolutionaryAlgorithm::get_mean_norm_history | ( | void | ) |
This method returns the mean norm history.
Definition at line 452 of file EvolutionaryAlgorithm.cpp.
EvolutionaryAlgorithm::MutationMethod & Flood::EvolutionaryAlgorithm::get_mutation_method | ( | void | ) |
This method returns the mutation method used for training.
Definition at line 276 of file EvolutionaryAlgorithm.cpp.
std::string Flood::EvolutionaryAlgorithm::get_mutation_method_name | ( | void | ) |
This method returns a string with the name of the method used for mutation.
Definition at line 286 of file EvolutionaryAlgorithm.cpp.
double Flood::EvolutionaryAlgorithm::get_mutation_range | ( | void | ) |
This method returns the mutation range value.
Definition at line 1417 of file EvolutionaryAlgorithm.cpp.
double Flood::EvolutionaryAlgorithm::get_mutation_rate | ( | void | ) |
This method returns the mutation rate value.
Definition at line 1407 of file EvolutionaryAlgorithm.cpp.
Matrix< double > & Flood::EvolutionaryAlgorithm::get_population | ( | void | ) |
This method returns the population Matrix.
Definition at line 329 of file EvolutionaryAlgorithm.cpp.
This method returns the population history over the training epochs, which is a vector of matrices.
Definition at line 442 of file EvolutionaryAlgorithm.cpp.
int Flood::EvolutionaryAlgorithm::get_population_size | ( | void | ) |
This method returns the number of individuals in the population.
Definition at line 319 of file EvolutionaryAlgorithm.cpp.
EvolutionaryAlgorithm::RecombinationMethod & Flood::EvolutionaryAlgorithm::get_recombination_method | ( | void | ) |
This method returns the recombination method used for training.
Definition at line 233 of file EvolutionaryAlgorithm.cpp.
std::string Flood::EvolutionaryAlgorithm::get_recombination_method_name | ( | void | ) |
This method returns a string with the name of the method used for recombination.
Definition at line 243 of file EvolutionaryAlgorithm.cpp.
double Flood::EvolutionaryAlgorithm::get_recombination_size | ( | void | ) |
This method returns the recombination size value.
Definition at line 1397 of file EvolutionaryAlgorithm.cpp.
bool Flood::EvolutionaryAlgorithm::get_reserve_best_evaluation_history | ( | void | ) |
This method returns true if the best evaluation history vector is to be reserved, and false otherwise.
Definition at line 432 of file EvolutionaryAlgorithm.cpp.
bool Flood::EvolutionaryAlgorithm::get_reserve_best_norm_history | ( | void | ) |
This method returns true if the norm of the best individual in the population history vector is to be reserved, and false otherwise.
Definition at line 401 of file EvolutionaryAlgorithm.cpp.
bool Flood::EvolutionaryAlgorithm::get_reserve_mean_evaluation_history | ( | void | ) |
This method returns true if the mean evaluation history vector is to be reserved, and false otherwise.
Definition at line 411 of file EvolutionaryAlgorithm.cpp.
bool Flood::EvolutionaryAlgorithm::get_reserve_mean_norm_history | ( | void | ) |
This method returns true if the mean population norm history vector is to be reserved, and false otherwise.
Definition at line 379 of file EvolutionaryAlgorithm.cpp.
bool Flood::EvolutionaryAlgorithm::get_reserve_population_history | ( | void | ) |
This method returns true if the population history vector of matrices is to be reserved, and false otherwise.
Definition at line 369 of file EvolutionaryAlgorithm.cpp.
bool Flood::EvolutionaryAlgorithm::get_reserve_standard_deviation_evaluation_history | ( | void | ) |
This method returns true if the standard deviation of the evaluation history vector is to be reserved, and false otherwise.
Definition at line 422 of file EvolutionaryAlgorithm.cpp.
bool Flood::EvolutionaryAlgorithm::get_reserve_standard_deviation_norm_history | ( | void | ) |
This method returns true if the standard deviation of the population norm history vector is to be reserved, and false otherwise.
Definition at line 390 of file EvolutionaryAlgorithm.cpp.
Vector< bool > & Flood::EvolutionaryAlgorithm::get_selection | ( | void | ) |
This method returns the actual selection value of all individuals in the population.
Definition at line 359 of file EvolutionaryAlgorithm.cpp.
EvolutionaryAlgorithm::SelectionMethod & Flood::EvolutionaryAlgorithm::get_selection_method | ( | void | ) |
This method returns the selection method used for training.
Definition at line 190 of file EvolutionaryAlgorithm.cpp.
std::string Flood::EvolutionaryAlgorithm::get_selection_method_name | ( | void | ) |
This method returns a string with the name of the method used for selection.
Definition at line 200 of file EvolutionaryAlgorithm.cpp.
Vector< double > & Flood::EvolutionaryAlgorithm::get_standard_deviation_evaluation_history | ( | void | ) |
This method returns a history with the standard deviation of the population evaluation during training.
Definition at line 492 of file EvolutionaryAlgorithm.cpp.
Vector< double > & Flood::EvolutionaryAlgorithm::get_standard_deviation_norm_history | ( | void | ) |
This method returns the standard deviation norm history.
Definition at line 462 of file EvolutionaryAlgorithm.cpp.
std::string Flood::EvolutionaryAlgorithm::get_training_history_XML | ( | bool | show_declaration | ) | [virtual] |
This method returns a string representation of the training history in XML-type format.
show_declaration | True if an XML-type declaration is to be included at the beginning of the string. |
Reimplemented from Flood::TrainingAlgorithm.
Definition at line 3783 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::initialize_population_normal | ( | const Vector< double > & | mean, | |
const Vector< double > & | standard_deviation | |||
) |
This method initializes the parameters of all the individuals in the population with random values chosen from normal distributions with different mean and standard deviation for each free parameter.
Definition at line 1800 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::initialize_population_normal | ( | double | mean, | |
double | standard_deviation | |||
) |
This method initializes the parameters of all the individuals in the population with random values chosen from a normal distribution with a given mean and a given standard deviation.
mean | Mean of normal distribution. | |
standard_deviation | Standard deviation of normal distribution. |
Definition at line 1785 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::initialize_population_normal | ( | void | ) |
This method initializes the parameters of all the individuals in the population with random values chosen from a normal distribution with mean 0 and standard deviation 1.
Definition at line 1771 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::initialize_population_uniform | ( | const Vector< double > & | minimum, | |
const Vector< double > & | maximum | |||
) |
This method initializes the parameters of all the individuals in the population at random, with values comprised between different minimum and maximum values for each variable.
minimum | Vector of minimum initialization values. | |
maximum | Vector of maximum initialization values. |
Definition at line 1728 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::initialize_population_uniform | ( | double | minimum, | |
double | maximum | |||
) |
This method initializes the parameters of all the individuals in the population at random, with values comprised between a minimum and a maximum value.
minimum | Minimum initialization value. | |
maximum | Maximum initialization value. |
Definition at line 1713 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::initialize_population_uniform | ( | void | ) |
This method initializes the parameters of all the individuals in the population at random, with values comprised between -1 and 1.
Definition at line 1699 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::load | ( | const char * | filename | ) | [virtual] |
This method loads a evolutionary algorithm object from a XML-type file. Please mind about the file format, wich is specified in the User's Guide.
Training operators:
Training parameters:
Stopping criteria:
User stuff:
filename | Filename. |
Reimplemented from Flood::TrainingAlgorithm.
Definition at line 3137 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::perform_intermediate_recombination | ( | void | ) |
This method performs inediate recombination between pairs of selected individuals to generate a new population. Each selected individual is to be recombined with two other selected individuals chosen at random. Results are stored in the population matrix.
Definition at line 2282 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::perform_line_recombination | ( | void | ) |
This method performs line recombination between pairs of selected individuals to generate a new population. Each selected individual is to be recombined with two other selected individuals chosen at random. Results are stored in the population matrix.
Definition at line 2395 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::perform_linear_ranking_fitness_assignment | ( | void | ) |
This method ranks all individuals in the population by their objective evaluation, so that the least fit individual has rank 1 and the fittest individual has rank [population size]. It then assigns them a fitness value linearly proportional to their rank. Results are stored in the fitness vector.
Definition at line 2055 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::perform_normal_mutation | ( | void | ) |
This method performs normal mutation to all individuals in order to generate a new population. Results are stored in the population matrix.
Definition at line 2504 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::perform_roulette_wheel_selection | ( | void | ) |
This metod performs selection with roulette wheel selection. It selects half of the individuals from the population. Results are stored in the selection vector.
Definition at line 2107 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::perform_stochastic_universal_sampling_selection | ( | void | ) |
This metod performs selection with stochastic universal sampling. It selects half of the individuals from the population. Results are stored in the selection vector.
Definition at line 2192 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::perform_uniform_mutation | ( | void | ) |
This method performs uniform mutation to all individuals in order to generate a new population. Results are stored in the population matrix.
Definition at line 2540 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::resize_training_history | ( | int | new_size | ) | [virtual] |
This method resizes the vectors or matrices containing training history information to a new size:
new_size | Size of training history. |
Reimplemented from Flood::TrainingAlgorithm.
Definition at line 3710 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set | ( | ObjectiveFunctional * | new_objective_functional_pointer | ) |
This method sets a new objective functional pointer to the evolutionary algorithm object. It also sets the rest of members to their default values.
Reimplemented from Flood::TrainingAlgorithm.
Definition at line 526 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set | ( | void | ) |
This method sets the objective functional pointer of this object to NULL. It also sets the rest of members to their default values.
Reimplemented from Flood::TrainingAlgorithm.
Definition at line 513 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_best_evaluation_history | ( | const Vector< double > & | new_best_evaluation_history | ) |
This method sets a new vector containing the best evaluation history over the training epochs. Each element in the vector must contain the best evaluation of one single generation.
new_best_evaluation_history | Best evaluation history vector. |
Definition at line 1250 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_best_norm_history | ( | const Vector< double > & | new_best_norm_history | ) |
This method sets a new vector containing the best norm history over the training epochs. Each element in the vector must contain the best norm of one single generation.
new_best_norm_history | Best norm history vector. |
Definition at line 1210 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_default | ( | void | ) | [virtual] |
This method sets the members of the evolutionary algorithm object to their default values. Training operators:
Reimplemented from Flood::TrainingAlgorithm.
Definition at line 577 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_evaluation | ( | const Vector< double > & | new_evaluation | ) |
This method sets a new population evaluation vector.
new_evaluation | Population evaluation values. |
Definition at line 953 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_fitness | ( | const Vector< double > & | new_fitness | ) |
This method sets a new population fitness vector.
new_fitness | Population fitness values. |
Definition at line 984 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_fitness_assignment_method | ( | const std::string & | new_fitness_assignment_method_name | ) |
This method sets a new method for fitness assignment from a string containing the name. Possible values are:
new_fitness_assignment_method_name | String with name of method for fitness assignment. |
Definition at line 776 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_fitness_assignment_method | ( | const FitnessAssignmentMethod & | new_fitness_assignment_method | ) |
This method sets a new fitness assignment method to be used for training.
new_fitness_assignment_method | Fitness assignment method chosen for training. |
Definition at line 1639 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_individual | ( | int | i, | |
const Vector< double > & | individual | |||
) |
This method sets a new Vector of parameters to the individual i in the population.
i | Index of individual in the population. | |
individual | Vector of parameters to be assigned to individual i. |
Definition at line 1297 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_maximum_generations_number | ( | int | new_maximum_generations_number | ) |
This method sets a new value for the maximum number of generations to train. The maximum number of generations value must be a positive number.
new_maximum_generations_number | Maximum number of generations value. |
Definition at line 1575 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_mean_evaluation_history | ( | const Vector< double > & | new_mean_evaluation_history | ) |
This method sets a new vector containing the mean evaluation history over the training epochs. Each element in the vector must contain the mean evaluation of one single generation.
new_mean_evaluation_history | Mean evaluation history vector. |
Definition at line 1223 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_mean_norm_history | ( | const Vector< double > & | new_mean_norm_history | ) |
This method sets a new vector containing the mean norm history over the training epochs. Each element in the vector must contain the mean norm of one single generation.
new_mean_norm_history | Mean norm history vector. |
Definition at line 1183 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_mutation_method | ( | const std::string & | new_mutation_method_name | ) |
This method sets a new method for mutation from a string containing the name. Possible values are:
new_mutation_method_name | String with name of method for mutation. |
Definition at line 865 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_mutation_method | ( | const MutationMethod & | new_mutation_method | ) |
This method sets a new mutation method to be used for training.
new_mutation_method | Mutation method chosen for training. |
Definition at line 1677 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_mutation_range | ( | double | new_mutation_range | ) |
This method sets a new value for the mutation range parameter. The mutation range value must be 0 or a positive number.
new_mutation_range | Mutation range value. This must be equal or greater than 0. |
Definition at line 1549 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_mutation_rate | ( | double | new_mutation_rate | ) |
This method sets a new value for the mutation rate parameter. The mutation rate value must be between 0 and 1.
new_mutation_rate | Mutation rate value. This value must lie in the interval [0,1]. |
Definition at line 1523 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_population | ( | const Matrix< double > & | new_population | ) |
This method sets a new population.
new_population | Population Matrix. |
Definition at line 892 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_population_history | ( | const Vector< Matrix< double > > & | new_population_history | ) |
This method sets a new matrix containing the training direction history over the training epochs. Each element in the vector must contain the population matrix of one single generation.
new_population_history | Population history vector of matrices. |
Definition at line 1170 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_population_size | ( | int | new_population_size | ) |
This method sets a new population with a new number of individuals. The new population size must be an even number equal or greater than four.
new_population_size | Number of individuals in the population. This must be an even number equal or greater than four. |
Definition at line 693 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_recombination_method | ( | const std::string & | new_recombination_method_name | ) |
This method sets a new method for recombination from a string containing the name. Possible values are:
new_recombination_method_name | String with name of method for recombination. |
Definition at line 834 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_recombination_method | ( | const RecombinationMethod & | new_recombination_method | ) |
This method sets a new recombination method to be used for training.
new_recombination_method | Recombination method chosen for training. |
Definition at line 1665 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_recombination_size | ( | double | new_recombination_size | ) |
This method sets a new value for the recombination size parameter. The recombination size value must be equal or greater than 0.
new_recombination_size | Recombination size value. This must be equal or greater than 0. |
Definition at line 1499 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_reserve_all_training_history | ( | bool | new_reserve_all_training_history | ) | [virtual] |
This method makes the training history of all variables to reseved or not in memory.
new_reserve_all_training_history | True if the training history of all variables is to be reserved, false otherwise. |
Reimplemented from Flood::TrainingAlgorithm.
Definition at line 1139 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_reserve_best_evaluation_history | ( | bool | new_reserve_best_evaluation_history | ) |
This method makes the best evaluation history vector to be reseved or not in memory.
new_reserve_best_evaluation_history | True if the best evaluation history vector is to be reserved, false otherwise. |
Definition at line 1126 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_reserve_best_norm_history | ( | bool | new_reserve_best_norm_history | ) |
This method makes the best norm history vector to be reseved or not in memory.
new_reserve_best_norm_history | True if the best norm history vector is to be reserved, false otherwise. |
Definition at line 1086 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_reserve_mean_evaluation_history | ( | bool | new_reserve_mean_evaluation_history | ) |
This method makes the mean evaluation history vector to be reseved or not in memory.
new_reserve_mean_evaluation_history | True if the mean evaluation history vector is to be reserved, false otherwise. |
Definition at line 1099 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_reserve_mean_norm_history | ( | bool | new_reserve_mean_norm_history | ) |
This method makes the mean norm history vector to be reseved or not in memory.
new_reserve_mean_norm_history | True if the mean norm history vector is to be reserved, false otherwise. |
Definition at line 1060 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_reserve_population_history | ( | bool | new_reserve_population_history | ) |
This method makes the population history vector of matrices to be reseved or not in memory.
new_reserve_population_history | True if the population history vector of matrices is to be reserved, false otherwise. |
Definition at line 1048 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_reserve_standard_deviation_evaluation_history | ( | bool | new_reserve_standard_deviation_evaluation_history | ) |
This method makes the standard deviation evaluation history vector to be reseved or not in memory.
new_reserve_standard_deviation_evaluation_history | True if the standard deviation evaluation history vector is to be reserved, false otherwise. |
Definition at line 1113 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_reserve_standard_deviation_norm_history | ( | bool | new_reserve_standard_deviation_norm_history | ) |
This method makes the standard deviation norm history vector to be reseved or not in memory.
new_reserve_standard_deviation_norm_history | True if the standard deviation norm history vector is to be reserved, false otherwise. |
Definition at line 1074 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_selection | ( | const Vector< bool > & | new_selection | ) |
This method sets a new population selection vector.
new_selection | Population selection values. |
Definition at line 1015 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_selection_method | ( | const std::string & | new_selection_method_name | ) |
This method sets a new method for selection from a string containing the name. Possible values are:
new_selection_method_name | String with name of method for selection. |
Definition at line 803 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_selection_method | ( | const SelectionMethod & | new_selection_method | ) |
This method sets a new selection method to be used for training.
new_selection_method | Selection method chosen for training. |
Definition at line 1652 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_selective_pressure | ( | double | new_selective_pressure | ) |
This method sets a new value for the selective pressure parameter. Linear ranking allows values for the selective pressure between 1 and 2.
new_selective_pressure | Selective pressure value. This must be between 1 and 2 for linear ranking fitness assignment. |
Definition at line 1467 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_standard_deviation_evaluation_history | ( | const Vector< double > & | new_standard_evaluation_evaluation_history | ) |
This method sets a new vector containing the standard deviation evaluation history over the training epochs. Each element in the vector must contain the standard deviation evaluation of one single generation.
new_standard_evaluation_evaluation_history | Standard deviation evaluation history vector. |
Definition at line 1237 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::set_standard_deviation_norm_history | ( | const Vector< double > & | new_standard_deviation_norm_history | ) |
This method sets a new vector containing the standard deviation norm history over the training epochs. Each element in the vector must contain the standard deviation norm of one single generation.
new_standard_deviation_norm_history | Standard deviation norm history vector. |
Definition at line 1197 of file EvolutionaryAlgorithm.cpp.
std::string Flood::EvolutionaryAlgorithm::to_XML | ( | bool | show_declaration | ) | [virtual] |
This method prints to the screen the members of the evolutionary algorithm object.
Training operators:
Training parameters:
Stopping criteria:
User stuff:
Population matrix.
Reimplemented from Flood::TrainingAlgorithm.
Definition at line 2929 of file EvolutionaryAlgorithm.cpp.
void Flood::EvolutionaryAlgorithm::train | ( | void | ) | [virtual] |
This method trains a multilayer perceptron with an associated objective function according to the evolutionary algorithm. Training occurs according to the training operators and their related parameters.
Implements Flood::TrainingAlgorithm.
Definition at line 2585 of file EvolutionaryAlgorithm.cpp.