Created by Scott Robert Ladd at Coyote Gulch Productions.
A generic function optimizer. More...
#include <function_optimizer.h>
Public Member Functions | |
function_optimizer (t_function *a_function, size_t a_nargs, double a_minarg, double a_maxarg, size_t a_norgs, double a_mutation_rate, size_t a_iterations) | |
Constructor. More... | |
virtual | ~function_optimizer () |
Destructor. More... | |
void | run () |
Performs optimization. More... | |
Additional Inherited Members | |
![]() | |
typedef vector< double > | t_function(vector< double > a_args) |
Definition of a function type. More... | |
![]() | |
virtual void | ping_generation_begin (size_t a_iteration) |
Ping that a generation begins. More... | |
virtual void | ping_generation_end (const vector< function_solution > &a_population, size_t a_iteration) |
Ping that a generation ends. More... | |
![]() | |
virtual void | ping_generation_begin (const std::vector< function_solution > &a_population, size_t a_iteration) |
Ping that a generation begins. More... | |
virtual void | ping_generation_end (const std::vector< function_solution > &a_population, size_t a_iteration) |
Ping that a generation ends. More... | |
virtual void | ping_fitness_test_begin (const function_solution &a_organism_number) |
Ping that a test run begins. More... | |
virtual void | ping_fitness_test_end (const function_solution &a_organism_number) |
Ping that a test run ends. More... | |
virtual void | report (const std::string &a_text) |
Report non-specific text. More... | |
virtual void | report_error (const std::string &a_text) |
Send error message. More... | |
virtual void | run_complete (const std::vector< function_solution > &a_population) |
Evocosm is finished. More... | |
![]() | |
static evoreal | g_evoreal |
Provides mutation and crossover services for doubles. | |
Using instances of the other classes, this class binds together the pieces to create a complete function optimizer. A user of this class defines two functions – a solution initializer and a fitness test – that define the target problem.
libevocosm::function_optimizer::function_optimizer | ( | t_function * | a_function, |
size_t | a_nargs, | ||
double | a_minarg, | ||
double | a_maxarg, | ||
size_t | a_norgs, | ||
double | a_mutation_rate, | ||
size_t | a_iterations | ||
) |
Creates a new function_optimizer with the given set of parameters.
a_function | - Address of the function to be optimized. |
a_nargs | - number of arguments per solution |
a_minarg | - minimum argument value |
a_maxarg | - maximum argument value |
a_norgs | - The size of the solution population. |
a_mutation_rate | - Mutation rate in the range [0,1]. |
a_iterations | - Number of iterations to perform when doing a run. |
|
virtual |
Cleans up resources by removing allocated objects.
void libevocosm::function_optimizer::run | ( | ) |
This is where the work gets done; run iterates the number of times specificed when creating this function_optimizer, reporting via a function_analyzer object on the progress of optimization.
© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.