Dakota  Version 6.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
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

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 core_run ()
 Performs the iterations to determine the optimal set of solutions. More...
 
virtual bool accepts_multiple_points () const
 Overridden to return true since JEGA algorithms can accept multiple initial points. More...
 
virtual bool returns_multiple_points () const
 Overridden to return true since JEGA algorithms can return multiple final points. More...
 
virtual void initial_points (const VariablesArray &pts)
 Overridden to assign the _initPts member variable to the passed in collection of Dakota::Variables. More...
 
virtual const VariablesArray & initial_points () const
 Overridden to return the collection of initial points for the JEGA algorithm created and run by this JEGAOptimizer. More...
 
 JEGAOptimizer (ProblemDescDB &problem_db, Model &model)
 Constructs a JEGAOptimizer class object. More...
 
 ~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 equivalent Dakota-style Variables and Response objects. More...
 
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. More...
 
void LoadAlgorithmConfig (JEGA::FrontEnd::AlgorithmConfig &aConfig)
 Completely initializes the supplied algorithm configuration. More...
 
void LoadProblemConfig (JEGA::FrontEnd::ProblemConfig &pConfig)
 Completely initializes the supplied problem configuration. More...
 
void LoadTheDesignVariables (JEGA::FrontEnd::ProblemConfig &pConfig)
 Adds DesignVariableInfo objects into the problem configuration object. More...
 
void LoadTheObjectiveFunctions (JEGA::FrontEnd::ProblemConfig &pConfig)
 Adds ObjectiveFunctionInfo objects into the problem configuration object. More...
 
void LoadTheConstraints (JEGA::FrontEnd::ProblemConfig &pConfig)
 Adds ConstraintInfo objects into the problem configuration object. More...
 
void GetBestSolutions (const JEGA::Utilities::DesignOFSortSet &from, const JEGA::Algorithms::GeneticAlgorithm &theGA, 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". More...
 
void GetBestMOSolutions (const JEGA::Utilities::DesignOFSortSet &from, const JEGA::Algorithms::GeneticAlgorithm &theGA, 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. More...
 
void GetBestSOSolutions (const JEGA::Utilities::DesignOFSortSet &from, const JEGA::Algorithms::GeneticAlgorithm &theGA, 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. More...
 
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. More...
 
- Protected Member Functions inherited from Optimizer
 Optimizer ()
 default constructor
 
 Optimizer (ProblemDescDB &problem_db, Model &model)
 alternate constructor; accepts a model
 
 Optimizer (unsigned short method_name, Model &model)
 alternate constructor for "on the fly" instantiations
 
 Optimizer (unsigned short method_name, size_t num_cv, size_t num_div, size_t num_dsv, size_t num_drv, size_t num_lin_ineq, size_t num_lin_eq, size_t num_nln_ineq, size_t num_nln_eq)
 alternate constructor for "on the fly" instantiations
 
 ~Optimizer ()
 destructor
 
void initialize_run ()
 
void post_run (std::ostream &s)
 
void finalize_run ()
 utility function to perform common operations following post_run(); deallocation and resetting of instance pointers More...
 
void print_results (std::ostream &s)
 
- Protected Member Functions inherited from Minimizer
 Minimizer ()
 default constructor
 
 Minimizer (ProblemDescDB &problem_db, Model &model)
 standard constructor More...
 
 Minimizer (unsigned short method_name, Model &model)
 alternate constructor for "on the fly" instantiations
 
 Minimizer (unsigned short method_name, size_t num_lin_ineq, size_t num_lin_eq, size_t num_nln_ineq, size_t num_nln_eq)
 alternate constructor for "on the fly" instantiations
 
 ~Minimizer ()
 destructor
 
void update_from_model (const Model &model)
 set inherited data attributes based on extractions from incoming model
 
const Modelalgorithm_space_model () const
 
Model original_model (unsigned short recasts_left=0)
 Return a shallow copy of the original model this Iterator was originally passed, optionally leaving recasts_left on top of it.
 
void data_transform_model ()
 Wrap iteratedModel in a RecastModel that subtracts provided observed data from the primary response functions (variables and secondary responses are unchanged) More...
 
void scale_model ()
 Wrap iteratedModel in a RecastModel that performs variable and/or response scaling. More...
 
Real objective (const RealVector &fn_vals, const BoolDeque &max_sense, const RealVector &primary_wts) const
 compute a composite objective value from one or more primary functions More...
 
Real objective (const RealVector &fn_vals, size_t num_fns, const BoolDeque &max_sense, const RealVector &primary_wts) const
 compute a composite objective with specified number of source primary functions, instead of userPrimaryFns More...
 
void objective_gradient (const RealVector &fn_vals, const RealMatrix &fn_grads, const BoolDeque &max_sense, const RealVector &primary_wts, RealVector &obj_grad) const
 compute the gradient of the composite objective function
 
void objective_gradient (const RealVector &fn_vals, size_t num_fns, const RealMatrix &fn_grads, const BoolDeque &max_sense, const RealVector &primary_wts, RealVector &obj_grad) const
 compute the gradient of the composite objective function More...
 
void objective_hessian (const RealVector &fn_vals, const RealMatrix &fn_grads, const RealSymMatrixArray &fn_hessians, const BoolDeque &max_sense, const RealVector &primary_wts, RealSymMatrix &obj_hess) const
 compute the Hessian of the composite objective function
 
void objective_hessian (const RealVector &fn_vals, size_t num_fns, const RealMatrix &fn_grads, const RealSymMatrixArray &fn_hessians, const BoolDeque &max_sense, const RealVector &primary_wts, RealSymMatrix &obj_hess) const
 compute the Hessian of the composite objective function More...
 
void archive_allocate_best (size_t num_points)
 allocate results arrays and labels for multipoint storage
 
void archive_best (size_t index, const Variables &best_vars, const Response &best_resp)
 archive the best point into the results array
 
void resize_best_vars_array (size_t newsize)
 Safely resize the best variables array to newsize taking into account the envelope-letter design pattern and any recasting. More...
 
void resize_best_resp_array (size_t newsize)
 Safely resize the best response array to newsize taking into account the envelope-letter design pattern and any recasting. More...
 
Real sum_squared_residuals (size_t num_pri_fns, const RealVector &residuals, const RealVector &weights)
 return weighted sum of squared residuals
 
void print_residuals (size_t num_terms, const RealVector &best_terms, const RealVector &weights, size_t num_best, size_t best_index, std::ostream &s)
 print num_terms residuals and misfit for final results
 
void print_model_resp (size_t num_pri_fns, const RealVector &best_fns, size_t num_best, size_t best_index, std::ostream &s)
 print the original user model resp in the case of data transformations
 
void local_recast_retrieve (const Variables &vars, Response &response) const
 infers MOO/NLS solution from the solution of a single-objective optimizer More...
 
- Protected Member Functions inherited from Iterator
 Iterator (BaseConstructor, ProblemDescDB &problem_db)
 constructor initializes the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139) More...
 
 Iterator (NoDBBaseConstructor, unsigned short method_name, Model &model)
 alternate constructor for base iterator classes constructed on the fly More...
 
 Iterator (NoDBBaseConstructor, unsigned short method_name)
 alternate constructor for base iterator classes constructed on the fly More...
 
virtual void derived_init_communicators (ParLevLIter pl_iter)
 derived class contributions to initializing the communicators associated with this Iterator instance
 
StrStrSizet run_identifier () const
 get the unique run identifier based on method name, id, and number of executions
 

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. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Optimizer
static void not_available (const std::string &package_name)
 Static helper function: third-party opt packages which are not available.
 
- Static Protected Member Functions inherited from Iterator
static void gnewton_set_recast (const Variables &recast_vars, const ActiveSet &recast_set, ActiveSet &sub_model_set)
 conversion of request vector values for the Gauss-Newton Hessian approximation More...
 
- Protected Attributes inherited from Optimizer
size_t numObjectiveFns
 number of objective functions (iterator view)
 
bool localObjectiveRecast
 flag indicating whether local recasting to a single objective is used
 
OptimizerprevOptInstance
 pointer containing previous value of optimizerInstance
 
- Static Protected Attributes inherited from Optimizer
static OptimizeroptimizerInstance
 pointer to Optimizer instance used in static member functions
 

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 ( ProblemDescDB problem_db,
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
problem_dbThe Dakota::ProblemDescDB with information on how the algorithm controls should be set.
modelThe Dakota::Model that will be used by this optimizer for problem information, etc.

References JEGAOptimizer::_theEvalCreator, ProblemDescDB::get_int(), ProblemDescDB::get_short(), Iterator::iteratedModel, JEGAOptimizer::LoadTheParameterDatabase(), Iterator::maxEvalConcurrency, Iterator::methodName, Iterator::numFinalSolutions, and Iterator::probDescDB.

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 equivalent 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(), Variables::discrete_string_variable(), Response::function_values(), and Dakota::set_index_to_value().

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.
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,
const JEGA::Algorithms::GeneticAlgorithm &  theGA,
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.
theGAThe GA used to generate this set; needed for its weights in the SO case, provided to both for consistency
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,
const JEGA::Algorithms::GeneticAlgorithm &  theGA,
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,
const JEGA::Algorithms::GeneticAlgorithm &  theGA,
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.

References Dakota::abort_handler().

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 core_run ( )
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.

Reimplemented from Iterator.

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: