$extrastylesheet
Dakota
Version 6.2
|
Base class for NonD, DACE, and ParamStudy branches of the iterator hierarchy. More...
Public Member Functions | |
const VariablesArray & | all_variables () |
return the complete set of evaluated variables | |
const RealMatrix & | all_samples () |
return the complete set of evaluated samples | |
const IntResponseMap & | all_responses () const |
return the complete set of computed responses | |
int | num_samples () const |
virtual void | vary_pattern (bool pattern_flag) |
sets varyPattern in derived classes that support it | |
Protected Member Functions | |
Analyzer () | |
default constructor | |
Analyzer (ProblemDescDB &problem_db, Model &model) | |
standard constructor | |
Analyzer (unsigned short method_name, Model &model) | |
alternate constructor for instantiations "on the fly" with a Model | |
Analyzer (unsigned short method_name) | |
alternate constructor for instantiations "on the fly" without a Model | |
~Analyzer () | |
destructor | |
virtual void | get_parameter_sets (Model &model) |
Returns one block of samples (ndim * num_samples) | |
virtual void | update_model_from_sample (Model &model, const Real *sample_vars) |
update model's current variables with data from sample | |
virtual void | update_model_from_variables (Model &model, const Variables &vars) |
update model's current variables with data from vars | |
virtual void | sample_to_variables (const Real *sample_vars, Variables &vars) |
convert column of samples array to variables; derived classes may reimplement for more than active continuous variables | |
void | update_from_model (const Model &model) |
set inherited data attributes based on extractions from incoming model | |
void | initialize_run () |
utility function to perform common operations prior to pre_run(); typically memory initialization; setting of instance pointers | |
void | post_run (std::ostream &s) |
post-run portion of run (optional); verbose to print results; re-implemented by Iterators that can read all Variables/Responses and perform final analysis phase in a standalone way | |
void | pre_output () |
void | print_results (std::ostream &s) |
print the final iterator results | |
const Model & | algorithm_space_model () const |
const Variables & | variables_results () const |
return a single final iterator solution (variables) | |
const Response & | response_results () const |
return a single final iterator solution (response) | |
const VariablesArray & | variables_array_results () |
return multiple final iterator solutions (variables). This should only be used if returns_multiple_points() returns true. | |
const ResponseArray & | response_array_results () |
return multiple final iterator solutions (response). This should only be used if returns_multiple_points() returns true. | |
void | response_results_active_set (const ActiveSet &set) |
set the requested data for the final iterator response results | |
bool | compact_mode () const |
returns Analyzer::compactMode | |
bool | returns_multiple_points () const |
indicates if this iterator returns multiple final points. Default return is false. Override to return true if appropriate. | |
void | evaluate_parameter_sets (Model &model, bool log_resp_flag, bool log_best_flag) |
perform function evaluations to map parameter sets (allVariables) into response sets (allResponses) | |
void | variance_based_decomp (int ncont, int ndiscint, int ndiscreal, int num_samples) |
void | read_variables_responses (int num_evals, size_t num_vars) |
convenience function for reading variables/responses (used in derived classes post_input) | |
void | print_sobol_indices (std::ostream &s) const |
Printing of VBD results. | |
void | samples_to_variables_array (const RealMatrix &sample_matrix, VariablesArray &vars_array) |
convert samples array to variables array; e.g., allSamples to allVariables | |
virtual void | variables_to_sample (const Variables &vars, Real *sample_c_vars) |
convert the active continuous variables into a column of allSamples | |
void | variables_array_to_samples (const VariablesArray &vars_array, RealMatrix &sample_matrix) |
convert variables array to samples array; e.g., allVariables to allSamples | |
Protected Attributes | |
size_t | numFunctions |
number of response functions | |
size_t | numContinuousVars |
number of active continuous vars | |
size_t | numDiscreteIntVars |
number of active discrete integer vars | |
size_t | numDiscreteStringVars |
number of active discrete string vars | |
size_t | numDiscreteRealVars |
number of active discrete real vars | |
bool | compactMode |
switch for allSamples (compact mode) instead of allVariables (normal mode) | |
VariablesArray | allVariables |
array of all variables to be evaluated in evaluate_parameter_sets() | |
RealMatrix | allSamples |
compact alternative to allVariables | |
IntResponseMap | allResponses |
array of all responses to be computed in evaluate_parameter_sets() | |
StringArray | allHeaders |
array of headers to insert into output while evaluating allVariables | |
size_t | numObjFns |
number of objective functions | |
size_t | numLSqTerms |
number of least squares terms | |
RealPairPRPMultiMap | bestVarsRespMap |
map which stores best set of solutions | |
Private Member Functions | |
void | compute_best_metrics (const Response &response, std::pair< Real, Real > &metrics) |
compares current evaluation to best evaluation and updates best | |
void | update_best (const Variables &vars, int eval_id, const Response &response) |
compares current evaluation to best evaluation and updates best | |
void | update_best (const Real *sample_c_vars, int eval_id, const Response &response) |
compares current evaluation to best evaluation and updates best | |
Private Attributes | |
int | writePrecision |
write precision as specified by the user | |
Real | vbdDropTol |
tolerance for omitting output of small VBD indices | |
RealVectorArray | S4 |
VBD main effect indices. | |
RealVectorArray | T4 |
VBD total effect indices. |
Base class for NonD, DACE, and ParamStudy branches of the iterator hierarchy.
The Analyzer class provides common data and functionality for various types of systems analysis, including nondeterministic analysis, design of experiments, and parameter studies.
int num_samples | ( | ) | const [inline, virtual] |
Return current number of evaluation points. Since the calculation of samples, collocation points, etc. might be costly, provide a default implementation here that backs out from the maxEvalConcurrency.
Reimplemented from Iterator.
Reimplemented in NonDQuadrature, NonDSparseGrid, NonDSampling, NonDCubature, DDACEDesignCompExp, FSUDesignCompExp, and PSUADEDesignCompExp.
References Model::derivative_concurrency(), Iterator::iteratedModel, and Iterator::maxEvalConcurrency.
Referenced by NonDGlobalReliability::get_best_sample(), NonDPolynomialChaos::ratio_samples_to_order(), Analyzer::samples_to_variables_array(), Analyzer::variables_array_to_samples(), and Analyzer::variance_based_decomp().
void sample_to_variables | ( | const Real * | sample_c_vars, |
Variables & | vars | ||
) | [protected, virtual] |
convert column of samples array to variables; derived classes may reimplement for more than active continuous variables
Default mapping that maps into continuous part of Variables only
Reimplemented in NonDSampling.
References Variables::adiv(), Variables::adrv(), Variables::all_discrete_int_variables(), Variables::all_discrete_real_variables(), Variables::continuous_variable(), Model::current_variables(), Variables::inactive_continuous_variables(), Variables::is_null(), Iterator::iteratedModel, Analyzer::numContinuousVars, and Variables::shared_data().
Referenced by NonDLHSEvidence::post_process_samples(), Analyzer::pre_output(), Analyzer::samples_to_variables_array(), and Analyzer::update_best().
void initialize_run | ( | ) | [protected, virtual] |
utility function to perform common operations prior to pre_run(); typically memory initialization; setting of instance pointers
Perform initialization phases of run sequence, like allocating memory and setting instance pointers. Commonly used in sub-iterator executions. This is a virtual function; when re-implementing, a derived class must call its nearest parent's initialize_run(), typically _before_ performing its own implementation steps.
Reimplemented from Iterator.
Reimplemented in NonD.
References Model::is_null(), Iterator::iteratedModel, Model::set_evaluation_reference(), and Iterator::summaryOutputFlag.
void post_run | ( | std::ostream & | s | ) | [protected, virtual] |
post-run portion of run (optional); verbose to print results; re-implemented by Iterators that can read all Variables/Responses and perform final analysis phase in a standalone way
Post-run phase, which a derived iterator may optionally reimplement; when not present, post-run is likely integrated into run. This is a virtual function; when re-implementing, a derived class must call its nearest parent's post_run(), typically _after_ performing its own implementation steps.
Reimplemented from Iterator.
Reimplemented in NonDLHSSampling, DDACEDesignCompExp, ParamStudy, FSUDesignCompExp, and PSUADEDesignCompExp.
References Model::is_null(), Iterator::iteratedModel, Model::print_evaluation_summary(), Analyzer::print_results(), Iterator::resultsDB, Iterator::summaryOutputFlag, and ResultsManager::write_databases().
void pre_output | ( | ) | [protected, virtual] |
Generate tabular output with active variables (compactMode) or all variables with their labels and response labels, with no data. Variables are sequenced {cv, div, drv}
Reimplemented from Iterator.
References Analyzer::allSamples, Analyzer::allVariables, ParallelLibrary::command_line_pre_run_output(), ParallelLibrary::command_line_user_modes(), Analyzer::compactMode, Variables::copy(), Model::current_response(), Model::current_variables(), Model::interface_id(), Iterator::iteratedModel, Iterator::outputLevel, Iterator::parallelLib, ProgramOptions::pre_run_output_format(), ParallelLibrary::program_options(), Analyzer::sample_to_variables(), Dakota::write_precision, Variables::write_tabular(), and Analyzer::writePrecision.
void print_results | ( | std::ostream & | s | ) | [protected, virtual] |
print the final iterator results
This virtual function provides additional iterator-specific final results outputs beyond the function evaluation summary printed in finalize_run().
Reimplemented from Iterator.
Reimplemented in NonDLHSSampling, NonDPOFDarts, NonDQUESOBayesCalibration, NonDLocalReliability, NonDAdaptiveSampling, NonDGPImpSampling, NonDAdaptImpSampling, NonDGlobalReliability, NonDIncremLHSSampling, NonDInterval, NonDExpansion, PStudyDACE, RichExtrapVerification, and Verification.
References Analyzer::bestVarsRespMap, ParamResponsePair::eval_id(), Response::function_values(), Analyzer::numLSqTerms, Analyzer::numObjFns, ParamResponsePair::response(), and ParamResponsePair::variables().
Referenced by Analyzer::post_run().
const Model & algorithm_space_model | ( | ) | const [inline, protected, virtual] |
default definition that gets redefined in selected derived Minimizers
Reimplemented from Iterator.
Reimplemented in NonDExpansion, NonDGlobalInterval, NonDBayesCalibration, and NonDReliability.
References Iterator::iteratedModel.
void evaluate_parameter_sets | ( | Model & | model, |
bool | log_resp_flag, | ||
bool | log_best_flag | ||
) | [protected] |
perform function evaluations to map parameter sets (allVariables) into response sets (allResponses)
Convenience function for derived classes with sets of function evaluations to perform (e.g., NonDSampling, DDACEDesignCompExp, FSUDesignCompExp, ParamStudy).
References Iterator::activeSet, Analyzer::allHeaders, Analyzer::allResponses, Analyzer::allSamples, Analyzer::allVariables, Model::asynch_compute_response(), Model::asynch_flag(), Analyzer::compactMode, Model::compute_response(), Response::copy(), Model::current_response(), Model::current_variables(), Model::evaluation_id(), Model::synchronize(), Analyzer::update_best(), Analyzer::update_model_from_sample(), and Analyzer::update_model_from_variables().
Referenced by NonDSparseGrid::evaluate_grid_increment(), NonDSparseGrid::evaluate_set(), PSUADEDesignCompExp::extract_trends(), FSUDesignCompExp::extract_trends(), ParamStudy::extract_trends(), DDACEDesignCompExp::extract_trends(), NonDIncremLHSSampling::quantify_uncertainty(), NonDAdaptImpSampling::quantify_uncertainty(), NonDLHSSampling::quantify_uncertainty(), NonDIntegration::quantify_uncertainty(), NonDQUESOBayesCalibration::update_model(), and Analyzer::variance_based_decomp().
void variance_based_decomp | ( | int | ncont, |
int | ndiscint, | ||
int | ndiscreal, | ||
int | num_samples | ||
) | [protected] |
Calculation of sensitivity indices obtained by variance based decomposition. These indices are obtained by the Saltelli version of the Sobol VBD which uses (K+2)*N function evaluations, where K is the number of dimensions (uncertain vars) and N is the number of samples.
References Dakota::abort_handler(), Analyzer::allResponses, Analyzer::allSamples, Analyzer::allVariables, Analyzer::compactMode, Variables::continuous_variables(), Dakota::copy_data(), Variables::discrete_int_variables(), Variables::discrete_real_variables(), Analyzer::evaluate_parameter_sets(), Analyzer::get_parameter_sets(), Iterator::iteratedModel, Analyzer::num_samples(), Analyzer::numFunctions, Analyzer::S4, Analyzer::T4, and Analyzer::vary_pattern().
Referenced by FSUDesignCompExp::extract_trends(), DDACEDesignCompExp::extract_trends(), and NonDLHSSampling::quantify_uncertainty().
void read_variables_responses | ( | int | num_evals, |
size_t | num_vars | ||
) | [protected] |
convenience function for reading variables/responses (used in derived classes post_input)
read num_evals variables/responses from file
References Dakota::abort_handler(), Analyzer::allResponses, Analyzer::allSamples, Analyzer::allVariables, ParallelLibrary::command_line_post_run_input(), ParallelLibrary::command_line_user_modes(), Analyzer::compactMode, Response::copy(), Variables::copy(), Model::current_response(), Model::current_variables(), Iterator::iteratedModel, Iterator::outputLevel, Iterator::parallelLib, ProgramOptions::post_run_input_format(), ParallelLibrary::program_options(), Variables::read_tabular(), Analyzer::update_best(), and Analyzer::variables_to_sample().
Referenced by PSUADEDesignCompExp::post_input(), FSUDesignCompExp::post_input(), ParamStudy::post_input(), DDACEDesignCompExp::post_input(), and NonDLHSSampling::post_input().
void print_sobol_indices | ( | std::ostream & | s | ) | const [protected] |
Printing of VBD results.
printing of variance based decomposition indices.
References Model::continuous_variable_labels(), Model::discrete_int_variable_labels(), Model::discrete_real_variable_labels(), Iterator::iteratedModel, Analyzer::numContinuousVars, Analyzer::numDiscreteIntVars, Analyzer::numDiscreteRealVars, Analyzer::numFunctions, Model::response_labels(), Analyzer::S4, Analyzer::T4, Analyzer::vbdDropTol, and Dakota::write_precision.
Referenced by PStudyDACE::print_results(), and NonDLHSSampling::print_results().
void variables_to_sample | ( | const Variables & | vars, |
Real * | sample_c_vars | ||
) | [protected, virtual] |
convert the active continuous variables into a column of allSamples
Default implementation maps active continuous variables only
Reimplemented in NonDSampling.
References Variables::continuous_variables(), and Analyzer::numContinuousVars.
Referenced by Analyzer::read_variables_responses(), and Analyzer::variables_array_to_samples().