$extrastylesheet
Dakota
Version 6.2
|
Wrapper class for optimizers defined using COLIN. More...
Public Member Functions | |
COLINOptimizer (ProblemDescDB &problem_db, Model &model) | |
standard constructor | |
COLINOptimizer (const String &method_name, Model &model, int seed, int max_iter, int max_eval) | |
alternate constructor for on-the-fly instantiations | |
COLINOptimizer (const String &method_name, Model &model) | |
alternate constructor for Iterator instantiations by name | |
~COLINOptimizer () | |
destructor | |
void | reset () |
clears internal optimizer state | |
void | find_optimum () |
iterates the COLIN solver to determine the optimal solution | |
bool | returns_multiple_points () const |
some COLIN methods can return multiple points | |
Protected Member Functions | |
void | solver_setup (unsigned short method_name) |
convenience function for setting up the particular COLIN solver and appropriate Application | |
void | set_rng (int seed) |
sets up the random number generator for stochastic methods | |
void | set_solver_parameters () |
sets construct-time options for specific methods based on user specifications, including calling method-specific set functions | |
void | post_run (std::ostream &s) |
Get the final set of points from the solver Look up responses and sort, first according to constraint violation, then according to function value. | |
std::pair< bool, bool > | colin_cache_lookup (const colin::AppResponse &colinResponse, Response &tmpResponseHolder) |
Retrieve response from Colin AppResponse, return pair indicating success for <objective, constraints> | |
double | constraint_violation (const Response &tmpResponseHolder) |
Compute constraint violation, based on nonlinear constraints in iteratedModel and provided Response data. | |
Protected Attributes | |
short | solverType |
COLIN solver sub-type as enumerated in COLINOptimizer.cpp. | |
colin::SolverHandle | colinSolver |
handle to the COLIN solver | |
std::pair < colin::ApplicationHandle, COLINApplication * > | colinProblem |
handle and pointer to the COLINApplication object | |
colin::EvaluationManager_Base * | colinEvalMgr |
pointer to the COLIN evalutaion manager object | |
utilib::RNG * | rng |
random number generator pointer | |
bool | blockingSynch |
the synchronization setting: true if blocking , false if nonblocking | |
Real | constraint_penalty |
Buffer to hold problem constraint_penalty parameter. | |
bool | constant_penalty |
Buffer to hold problem constant_penalty parameter. |
Wrapper class for optimizers defined using COLIN.
The COLINOptimizer class wraps COLIN, a Sandia-developed C++ optimization interface library. A variety of COLIN optimizers are defined in COLIN and its associated libraries, including SCOLIB which contains the optimization components from the old COLINY (formerly SGOPT) library. COLIN contains optimizers such as genetic algorithms, pattern search methods, and other nongradient-based techniques. COLINOptimizer uses a COLINApplication object to perform the function evaluations.
The user input mappings are as follows: max_iterations
, max_function_evaluations
, convergence_tolerance
, and solution_accuracy
are mapped into COLIN's max_iterations
, max_function_evaluations_this_trial
, function_value_tolerance
, sufficient_objective_value
properties. An outputLevel
is mapped to COLIN's output_level
property and a setting of debug
activates output of method initialization and sets the COLIN debug
attribute to 10000 for the DEBUG output level. Refer to [Hart, W.E., 2006] for additional information on COLIN objects and controls.
COLINOptimizer | ( | ProblemDescDB & | problem_db, |
Model & | model | ||
) |
standard constructor
Standard constructor.
References ProblemDescDB::get_int(), ProblemDescDB::get_ushort(), Iterator::probDescDB, COLINOptimizer::set_rng(), COLINOptimizer::set_solver_parameters(), and COLINOptimizer::solver_setup().
COLINOptimizer | ( | const String & | method_name, |
Model & | model, | ||
int | seed, | ||
int | max_iter, | ||
int | max_eval | ||
) |
alternate constructor for on-the-fly instantiations
Alternate constructor for on-the-fly instantiations.
References Iterator::maxFunctionEvals, Iterator::maxIterations, Iterator::method_string_to_enum(), COLINOptimizer::set_rng(), COLINOptimizer::set_solver_parameters(), and COLINOptimizer::solver_setup().
COLINOptimizer | ( | const String & | method_name, |
Model & | model | ||
) |
alternate constructor for Iterator instantiations by name
Alternate constructor for Iterator instantiations by name.
References Iterator::method_string_to_enum(), COLINOptimizer::set_solver_parameters(), and COLINOptimizer::solver_setup().
void find_optimum | ( | ) | [virtual] |
iterates the COLIN solver to determine the optimal solution
find_optimum redefines the Optimizer virtual function to perform the optimization using COLIN. It first sets up the problem data, then executes optimize() on the COLIN solver and finally catalogues the results.
Implements Optimizer.
References Dakota::_NPOS, Dakota::abort_handler(), Model::asynch_flag(), COLINOptimizer::blockingSynch, COLINOptimizer::colinEvalMgr, COLINOptimizer::colinProblem, COLINOptimizer::colinSolver, COLINOptimizer::constant_penalty, COLINOptimizer::constraint_penalty, Model::continuous_variables(), Model::discrete_int_sets(), Model::discrete_int_variables(), Model::discrete_real_variables(), Model::discrete_set_int_values(), Model::discrete_set_real_values(), Model::evaluation_capacity(), Iterator::iteratedModel, Minimizer::numDiscreteIntVars, Minimizer::numDiscreteRealVars, Iterator::outputLevel, Dakota::set_value_to_index(), and COLINOptimizer::solverType.
bool returns_multiple_points | ( | ) | const [virtual] |
some COLIN methods can return multiple points
Designate which solvers can return multiple final points.
Reimplemented from Iterator.
References COLINOptimizer::solverType.
void solver_setup | ( | unsigned short | method_name | ) | [protected] |
convenience function for setting up the particular COLIN solver and appropriate Application
This convenience function is called by the constructors in order to instantiate the solver.
References COLINOptimizer::colinProblem, COLINOptimizer::colinSolver, COLINOptimizer::constant_penalty, COLINOptimizer::constraint_penalty, ProblemDescDB::get_string(), Iterator::method_enum_to_string(), Iterator::probDescDB, and COLINOptimizer::solverType.
Referenced by COLINOptimizer::COLINOptimizer().
void set_rng | ( | int | seed | ) | [protected] |
sets up the random number generator for stochastic methods
Instantiate random number generator (RNG).
References COLINOptimizer::colinSolver, and COLINOptimizer::rng.
Referenced by COLINOptimizer::COLINOptimizer().
void set_solver_parameters | ( | ) | [protected] |
sets construct-time options for specific methods based on user specifications, including calling method-specific set functions
Sets solver properties based on user specifications. Called at construction time.
References Model::asynch_flag(), COLINOptimizer::blockingSynch, COLINOptimizer::colinSolver, COLINOptimizer::constant_penalty, COLINOptimizer::constraint_penalty, Iterator::convergenceTol, ProblemDescDB::get_bool(), ProblemDescDB::get_int(), ProblemDescDB::get_real(), ProblemDescDB::get_sa(), ProblemDescDB::get_string(), ProblemDescDB::is_null(), Iterator::iteratedModel, Iterator::maxEvalConcurrency, Iterator::maxFunctionEvals, Iterator::maxIterations, Minimizer::numContinuousVars, Iterator::outputLevel, Iterator::probDescDB, and COLINOptimizer::solverType.
Referenced by COLINOptimizer::COLINOptimizer().
void post_run | ( | std::ostream & | s | ) | [protected, virtual] |
Get the final set of points from the solver Look up responses and sort, first according to constraint violation, then according to function value.
Supplement Optimizer::post_run to first retrieve points from the Colin cache (or possibly the Dakota DB) and rank them. When complete, this function will populate bestVariablesArray and bestResponsesArray with iterator-space data, that is, in the context of the solver, leaving any further untransformation to Optimizer.
Reimplemented from Optimizer.
References Iterator::bestResponseArray, Iterator::bestVariablesArray, COLINOptimizer::colin_cache_lookup(), COLINOptimizer::colinProblem, COLINOptimizer::colinSolver, COLINOptimizer::constraint_violation(), Variables::continuous_variables(), Response::copy(), Variables::copy(), Model::current_response(), Model::current_variables(), Model::discrete_int_sets(), Variables::discrete_int_variable(), Variables::discrete_real_variable(), Model::discrete_set_int_values(), Model::discrete_set_real_values(), Response::function_values(), Iterator::iteratedModel, Optimizer::localObjectiveRecast, Minimizer::numDiscreteIntVars, Minimizer::numDiscreteRealVars, Iterator::numFinalSolutions, Optimizer::numObjectiveFns, Minimizer::objective(), Model::primary_response_fn_sense(), Model::primary_response_fn_weights(), Minimizer::resize_best_resp_array(), Minimizer::resize_best_vars_array(), Dakota::set_index_to_value(), and Model::subordinate_model().
std::pair< bool, bool > colin_cache_lookup | ( | const colin::AppResponse & | colinResponse, |
Response & | tmpResponseHolder | ||
) | [protected] |
Retrieve response from Colin AppResponse, return pair indicating success for <objective, constraints>
Encapsulated Colin Cache response extraction, which will ultimately become the default lookup. Might want to return separate vectors of function values and constraints for use in the sort, but not for now (least change). Return true if not needed or successful lookup.
References Response::function_value(), Minimizer::numNonlinearConstraints, and Optimizer::numObjectiveFns.
Referenced by COLINOptimizer::post_run().
double constraint_violation | ( | const Response & | tmpResponseHolder | ) | [protected] |
Compute constraint violation, based on nonlinear constraints in iteratedModel and provided Response data.
BMA TODO: incorporate constraint tolerance, possibly via elevating SurrBasedMinimizer::constraint_violation(). Always use iteratedModel to get the constraints; they are in the right space.
References Response::function_values(), Iterator::iteratedModel, Model::nonlinear_eq_constraint_targets(), Model::nonlinear_ineq_constraint_lower_bounds(), Model::nonlinear_ineq_constraint_upper_bounds(), Model::num_nonlinear_eq_constraints(), Model::num_nonlinear_ineq_constraints(), and Minimizer::numIterPrimaryFns.
Referenced by COLINOptimizer::post_run().