Evocosm - A C++ Framework for Evolutionary Computing

Main Index

Created by Scott Robert Ladd at Coyote Gulch Productions.


Public Member Functions | Public Attributes | Protected Member Functions
libevocosm::function_solution Class Reference

A potential solution to the problem at hand. More...

#include <function_optimizer.h>

Inheritance diagram for libevocosm::function_solution:
libevocosm::organism< vector< double > > libevocosm::fopt_global libevocosm::globals

List of all members.

Public Member Functions

Public Attributes

Protected Member Functions


Detailed Description

To support a wide variety of applications, I defined a function solution as a vector of doubles. This allows functions of any dimension to be optimized (within platform limits, of course). Note that the solution begins with an empty vector; this is because the number of elements and their initialization is application specific. Initialization of the genes takes place in the constructor for function_optimizer through a pointer to a user-supplied function.


Constructor & Destructor Documentation

Creates an empty solution.

libevocosm::function_solution::function_solution ( int  a_nargs,
double  a_minarg,
double  a_maxarg 
) [inline]
libevocosm::function_solution::function_solution ( const vector< double > &  a_source) [inline]

Constructs a new function solution from a set of genes

libevocosm::function_solution::function_solution ( const organism< vector< double > > &  a_source) [inline]

Constructs a function solution from a base-class object.

Parameters:
a_source- The source object

Duplicates an existing object.

Parameters:
a_source- The source object

Satisfies the requirements of the base class; does nothing


Member Function Documentation

virtual void libevocosm::function_solution::child_copy ( const organism a_source) [inline, protected, virtual]

used to cast base class pointer to concrete class

References value.

virtual bool libevocosm::function_solution::operator< ( const organism< vector< double > > &  a_right) const [inline, virtual]

Returns true if the target object is greater than a_source. While the operator may be "less than", what it really meands for algorithms is "comes before" -- and I want the highest fitness to come first.

Parameters:
a_right- Right hand argument for less than operator
Returns:
true if this organismsfitness if greater than a_right.fitness; false otherwise

References libevocosm::organism< vector< double > >::fitness.

function_solution& libevocosm::function_solution::operator= ( const function_solution a_source) [inline]

Assigns the state of one solution to another.

Parameters:
a_source- The source object
Returns:
A reference to this

References value.


Member Data Documentation

Value is the actual computed value of this solution, which may or may not correspond directly to fitness. For example, when minimizing a function, the lowest value may correspond to the highest fitness. Generally, this is a display property.

Referenced by child_copy(), operator=(), and libevocosm::function_landscape::test().


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.