Evocosm - A C++ Framework for Evolutionary Computing

Main Index

Created by Scott Robert Ladd at Coyote Gulch Productions.


Public Member Functions | List of all members
libevocosm::function_optimizer Class Reference

A generic function optimizer. More...

#include <function_optimizer.h>

Inheritance diagram for libevocosm::function_optimizer:
libevocosm::fopt_global libevocosm::function_listener libevocosm::null_listener< function_solution > libevocosm::listener< function_solution >

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

- Protected Types inherited from libevocosm::fopt_global
typedef vector< double > t_function(vector< double > a_args)
 Definition of a function type. More...
 
- Protected Member Functions inherited from libevocosm::function_listener
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...
 
- Protected Member Functions inherited from libevocosm::null_listener< function_solution >
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 Protected Attributes inherited from libevocosm::fopt_global
static evoreal g_evoreal
 Provides mutation and crossover services for doubles.
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

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 libevocosm::function_optimizer::~function_optimizer ( )
virtual

Cleans up resources by removing allocated objects.

Member Function Documentation

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.


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

© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.