Classes | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
JEGAOptimizer Class Reference

A version of Dakota::Optimizer for instantiation of John Eddy's Genetic Algorithms (JEGA). More...

Inheritance diagram for JEGAOptimizer:
Optimizer Minimizer Iterator

List of all members.

Classes

class  Driver
 A subclass of the JEGA front end driver that exposes the individual protected methods to execute the algorithm. More...
class  Evaluator
 An evaluator specialization that knows how to interact with Dakota. More...
class  EvaluatorCreator
 A specialization of the JEGA::FrontEnd::EvaluatorCreator that creates a new instance of a Evaluator. More...

Public Member Functions

virtual void find_optimum ()
 Performs the iterations to determine the optimal set of solutions.
virtual bool accepts_multiple_points () const
 Overridden to return true since JEGA algorithms can accept multiple initial points.
virtual bool returns_multiple_points () const
 Overridden to return true since JEGA algorithms can return multiple final points.
virtual void initial_points (const VariablesArray &pts)
 Overridden to assign the _initPts member variable to the passed in collection of Dakota::Variables.
virtual const VariablesArray & initial_points () const
 Overridden to return the collection of initial points for the JEGA algorithm created and run by this JEGAOptimizer.
 JEGAOptimizer (Model &model)
 Constructs a JEGAOptimizer class object.
 ~JEGAOptimizer ()
 Destructs a JEGAOptimizer.

Protected Member Functions

void LoadDakotaResponses (const JEGA::Utilities::Design &from, Variables &vars, Response &resp) const
 Loads the JEGA-style Design class into equivolent Dakota-style Variables and Response objects.
void ReCreateTheParameterDatabase ()
 Destroys the current parameter database and creates a new empty one.
void LoadTheParameterDatabase ()
 Reads information out of the known Dakota::ProblemDescDB and puts it into the current parameter database.
void LoadAlgorithmConfig (JEGA::FrontEnd::AlgorithmConfig &aConfig)
 Completely initializes the supplied algorithm configuration.
void LoadProblemConfig (JEGA::FrontEnd::ProblemConfig &pConfig)
 Completely initializes the supplied problem configuration.
void LoadTheDesignVariables (JEGA::FrontEnd::ProblemConfig &pConfig)
 Adds DesignVariableInfo objects into the problem configuration object.
void LoadTheObjectiveFunctions (JEGA::FrontEnd::ProblemConfig &pConfig)
 Adds ObjectiveFunctionInfo objects into the problem configuration object.
void LoadTheConstraints (JEGA::FrontEnd::ProblemConfig &pConfig)
 Adds ConstraintInfo objects into the problem configuration object.
void GetBestSolutions (const JEGA::Utilities::DesignOFSortSet &from, std::multimap< RealRealPair, JEGA::Utilities::Design * > &designSortMap)
 Returns up to _numBest designs sorted by DAKOTA's fitness (L2 constraint violation, then utopia or objective), taking into account the algorithm type. The front of the returned map can be viewed as a single "best".
void GetBestMOSolutions (const JEGA::Utilities::DesignOFSortSet &from, std::multimap< RealRealPair, JEGA::Utilities::Design * > &designSortMap)
 Retreive the best Designs from a set of solutions assuming that they are generated by a multi objective algorithm.
void GetBestSOSolutions (const JEGA::Utilities::DesignOFSortSet &from, std::multimap< RealRealPair, JEGA::Utilities::Design * > &designSortMap)
 Retreive the best Designs from a set of solutions assuming that they are generated by a single objective algorithm.
JEGA::DoubleMatrix ToDoubleMatrix (const VariablesArray &variables) const
 Converts the items in a VariablesArray into a DoubleMatrix whereby the items in the matrix are the design variables.
void resize_variables_results_array (std::size_t newsize)
 Safely resizes the best variables array taking into account the requirements put forth by the envelope-letter design pattern.
void resize_response_results_array (std::size_t newsize)
 Safely resizes the best response array taking into account the requirements put forth by the envelope-letter design pattern.

Private Attributes

EvaluatorCreator_theEvalCreator
 A pointer to an EvaluatorCreator used to create the evaluator used by JEGA in Dakota (a JEGAEvaluator).
JEGA::Utilities::ParameterDatabase * _theParamDB
 A pointer to the ParameterDatabase from which all parameters are retrieved by the created algorithms.
VariablesArray _initPts
 An array of initial points to use as an initial population.

Static Private Attributes

static const std::string SOGA_METHOD_TXT
 The text that indicates the SOGA method.
static const std::string MOGA_METHOD_TXT
 The text that indicates the MOGA method.

Detailed Description

A version of Dakota::Optimizer for instantiation of John Eddy's Genetic Algorithms (JEGA).

This class encapsulates the necessary functionality for creating and properly initializing the JEGA algorithms (MOGA and SOGA).


Constructor & Destructor Documentation

JEGAOptimizer ( Model model)

Constructs a JEGAOptimizer class object.

This method does some of the initialization work for the algorithm. In particular, it initialized the JEGA core.

Parameters:
modelThe Dakota::Model that will be used by this optimizer for problem information, etc.

References JEGAOptimizer::_theEvalCreator, ProblemDescDB::get_int(), ProblemDescDB::get_short(), Model::init_communicators(), Iterator::iteratedModel, JEGAOptimizer::LoadTheParameterDatabase(), Optimizer::localObjectiveRecast, Iterator::maxConcurrency, Iterator::methodName, JEGAOptimizer::MOGA_METHOD_TXT, Iterator::numFinalSolutions, Iterator::probDescDB, and Minimizer::scaleFlag.


Member Function Documentation

void LoadDakotaResponses ( const JEGA::Utilities::Design &  from,
Dakota::Variables vars,
Dakota::Response resp 
) const [protected]

Loads the JEGA-style Design class into equivolent Dakota-style Variables and Response objects.

This version is meant for the case where a Variables and a Response object exist and just need to be loaded.

Parameters:
fromThe JEGA Design class object from which to extract the variable and response information for Dakota.
varsThe Dakota::Variables object into which to load the design variable values of from.
respThe Dakota::Response object into which to load the objective function and constraint values of from.

References Variables::continuous_variables(), Variables::discrete_int_variables(), Variables::discrete_real_variables(), and Response::function_values().

void LoadTheParameterDatabase ( ) [protected]

Reads information out of the known Dakota::ProblemDescDB and puts it into the current parameter database.

This should be called from the JEGAOptimizer constructor since it is the only time when the problem description database is certain to be configured to supply data for this optimizer.

Referenced by JEGAOptimizer::JEGAOptimizer().

void LoadAlgorithmConfig ( JEGA::FrontEnd::AlgorithmConfig &  aConfig) [protected]

Completely initializes the supplied algorithm configuration.

This loads the supplied configuration object with appropriate data retrieved from the parameter database.

Parameters:
aConfigThe algorithm configuration object to load.
void LoadProblemConfig ( JEGA::FrontEnd::ProblemConfig &  pConfig) [protected]

Completely initializes the supplied problem configuration.

This loads the fresh configuration object using the LoadTheDesignVariables, LoadTheObjectiveFunctions, and LoadTheConstraints methods.

Parameters:
pConfigThe problem configuration object to load.
void LoadTheDesignVariables ( JEGA::FrontEnd::ProblemConfig &  pConfig) [protected]

Adds DesignVariableInfo objects into the problem configuration object.

This retrieves design variable information from the ParameterDatabase and creates DesignVariableInfo's from it.

Parameters:
pConfigThe problem configuration object to load.

References Model::continuous_lower_bounds().

void LoadTheObjectiveFunctions ( JEGA::FrontEnd::ProblemConfig &  pConfig) [protected]

Adds ObjectiveFunctionInfo objects into the problem configuration object.

This retrieves objective function information from the ParameterDatabase and creates ObjectiveFunctionInfo's from it.

Parameters:
pConfigThe problem configuration object to load.

References Dakota::asstring().

void LoadTheConstraints ( JEGA::FrontEnd::ProblemConfig &  pConfig) [protected]

Adds ConstraintInfo objects into the problem configuration object.

This retrieves constraint function information from the ParameterDatabase and creates ConstraintInfo's from it.

Parameters:
pConfigThe problem configuration object to load.

References Dakota::asstring(), Dakota::copy_row_vector(), and Model::nonlinear_ineq_constraint_lower_bounds().

void GetBestSolutions ( const JEGA::Utilities::DesignOFSortSet &  from,
std::multimap< RealRealPair, JEGA::Utilities::Design * > &  designSortMap 
) [protected]

Returns up to _numBest designs sorted by DAKOTA's fitness (L2 constraint violation, then utopia or objective), taking into account the algorithm type. The front of the returned map can be viewed as a single "best".

Parameters:
fromThe full set of designs returned by the solver.
designSortMapMap of best solutions with key pair<constraintViolation, fitness>

eventually this functionality must be moved into a separate post-processing application for MO datasets.

void GetBestMOSolutions ( const JEGA::Utilities::DesignOFSortSet &  from,
std::multimap< RealRealPair, JEGA::Utilities::Design * > &  designSortMap 
) [protected]

Retreive the best Designs from a set of solutions assuming that they are generated by a multi objective algorithm.

eventually this functionality must be moved into a separate post-processing application for MO datasets.

void GetBestSOSolutions ( const JEGA::Utilities::DesignOFSortSet &  from,
std::multimap< RealRealPair, JEGA::Utilities::Design * > &  designSortMap 
) [protected]

Retreive the best Designs from a set of solutions assuming that they are generated by a single objective algorithm.

eventually this functionality must be moved into a separate post-processing application for MO datasets.

JEGA::DoubleMatrix ToDoubleMatrix ( const VariablesArray &  variables) const [protected]

Converts the items in a VariablesArray into a DoubleMatrix whereby the items in the matrix are the design variables.

The matrix will not contain responses but when being used by Dakota, this doesn't matter. JEGA will attempt to re-evaluate these points but Dakota will recognize that they do not require re-evaluation and thus it will be a cheap operation.

Parameters:
variablesThe array of DakotaVariables objects to use as the contents of the returned matrix.
Returns:
The matrix created using the supplied VariablesArray.
void resize_variables_results_array ( std::size_t  newsize) [protected]

Safely resizes the best variables array taking into account the requirements put forth by the envelope-letter design pattern.

Do not directly call resize on the bestVariablesArray object unless you intend to share the internal content (letter) with other objects after assignment.

Parameters:
newsizeThe new size for the variables array.
void resize_response_results_array ( std::size_t  newsize) [protected]

Safely resizes the best response array taking into account the requirements put forth by the envelope-letter design pattern.

Do not directly call resize on the bestResponseArray object unless you intend to share the internal content (letter) with other objects after assignment.

Parameters:
newsizeThe new size for the responses array.
void find_optimum ( ) [virtual]

Performs the iterations to determine the optimal set of solutions.

Override of pure virtual method in Optimizer base class.

The extraction of parameter values actually occurs in this method when the JEGA::FrontEnd::Driver::ExecuteAlgorithm is called. Also the loading of the problem and algorithm configurations occurs in this method. That way, if it is called more than once and the algorithm or problem has changed, it will be accounted for.

Implements Optimizer.

References JEGAOptimizer::Driver::DestroyAlgorithm(), JEGAOptimizer::Driver::ExtractAllData(), and JEGAOptimizer::Driver::PerformIterations().

bool accepts_multiple_points ( ) const [virtual]

Overridden to return true since JEGA algorithms can accept multiple initial points.

Returns:
true, always.

Reimplemented from Iterator.

bool returns_multiple_points ( ) const [virtual]

Overridden to return true since JEGA algorithms can return multiple final points.

Returns:
true, always.

Reimplemented from Iterator.

void initial_points ( const VariablesArray &  pts) [virtual]

Overridden to assign the _initPts member variable to the passed in collection of Dakota::Variables.

Parameters:
ptsThe array of initial points for the JEGA algorithm created and run by this JEGAOptimizer.

Reimplemented from Iterator.

const VariablesArray & initial_points ( ) const [virtual]

Overridden to return the collection of initial points for the JEGA algorithm created and run by this JEGAOptimizer.

Returns:
The collection of initial points for the JEGA algorithm created and run by this JEGAOptimizer.

Reimplemented from Iterator.


Member Data Documentation

VariablesArray _initPts [private]

An array of initial points to use as an initial population.

This member is here to help support the use of JEGA algorithms in Dakota strategies. If this array is populated, then whatever initializer is specified will be ignored and the DoubleMatrix initializer will be used instead on a matrix created from the data in this array.


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