Dakota  Version 6.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
DataFitSurrModel Class Reference

Derived model class within the surrogate model branch for managing data fit surrogates (global and local) More...

Inheritance diagram for DataFitSurrModel:
SurrogateModel Model

Public Member Functions

 DataFitSurrModel (ProblemDescDB &problem_db)
 constructor
 
 DataFitSurrModel (Iterator &dace_iterator, Model &actual_model, const ActiveSet &set, const String &approx_type, const UShortArray &approx_order, short corr_type, short corr_order, short data_order, short output_level, const String &point_reuse, const String &import_build_points_file=String(), unsigned short import_build_format=TABULAR_ANNOTATED, bool import_build_active_only=false, const String &export_approx_points_file=String(), unsigned short export_approx_format=TABULAR_ANNOTATED)
 alternate constructor for instantiations on the fly
 
 ~DataFitSurrModel ()
 destructor More...
 
void total_points (int points)
 set pointsTotal and pointsManagement mode
 

Protected Member Functions

void derived_evaluate (const ActiveSet &set)
 portion of evaluate() specific to DataFitSurrModel More...
 
void derived_evaluate_nowait (const ActiveSet &set)
 portion of evaluate_nowait() specific to DataFitSurrModel More...
 
const IntResponseMap & derived_synchronize ()
 portion of synchronize() specific to DataFitSurrModel More...
 
const IntResponseMap & derived_synchronize_nowait ()
 portion of synchronize_nowait() specific to DataFitSurrModel More...
 
Iteratorsubordinate_iterator ()
 return daceIterator
 
Modelsurrogate_model ()
 return this model instance
 
Modeltruth_model ()
 return actualModel
 
void derived_subordinate_models (ModelList &ml, bool recurse_flag)
 return actualModel (and optionally its sub-models)
 
void update_from_subordinate_model (size_t depth=std::numeric_limits< size_t >::max())
 pass request to actualModel if recursing and then update from it
 
Interfacederived_interface ()
 return approxInterface
 
void primary_response_fn_weights (const RealVector &wts, bool recurse_flag=true)
 set the relative weightings for multiple objective functions or least squares terms and optionally recurses into actualModel
 
void surrogate_response_mode (short mode)
 set responseMode and pass any bypass request on to actualModel for any lower-level surrogates.
 
void surrogate_function_indices (const IntSet &surr_fn_indices)
 (re)set the surrogate index set in SurrogateModel::surrogateFnIndices and ApproximationInterface::approxFnIndices
 
void build_approximation ()
 Builds the local/multipoint/global approximation using daceIterator/actualModel to generate new data points. More...
 
bool build_approximation (const Variables &vars, const IntResponsePair &response_pr)
 Builds the local/multipoint/global approximation using daceIterator/actualModel to generate new data points that augment the passed vars/response anchor point. More...
 
void update_approximation (bool rebuild_flag)
 replaces the approximation data with daceIterator results and rebuilds the approximation if requested More...
 
void update_approximation (const Variables &vars, const IntResponsePair &response_pr, bool rebuild_flag)
 replaces the anchor point, and rebuilds the approximation if requested More...
 
void update_approximation (const VariablesArray &vars_array, const IntResponseMap &resp_map, bool rebuild_flag)
 replaces the current points array and rebuilds the approximation if requested More...
 
void update_approximation (const RealMatrix &samples, const IntResponseMap &resp_map, bool rebuild_flag)
 replaces the current points array and rebuilds the approximation if requested More...
 
void append_approximation (bool rebuild_flag)
 appends daceIterator results to a global approximation and rebuilds it if requested More...
 
void append_approximation (const Variables &vars, const IntResponsePair &response_pr, bool rebuild_flag)
 appends a point to a global approximation and rebuilds it if requested More...
 
void append_approximation (const VariablesArray &vars_array, const IntResponseMap &resp_map, bool rebuild_flag)
 appends an array of points to a global approximation and rebuilds it if requested More...
 
void append_approximation (const RealMatrix &samples, const IntResponseMap &resp_map, bool rebuild_flag)
 appends a matrix of points to a global approximation and rebuilds it if requested More...
 
void pop_approximation (bool save_surr_data, bool rebuild_flag=false)
 remove approximation data added on previous append_approximation() call or a specified number of points
 
void push_approximation ()
 retrieve a previous approximation data state
 
bool push_available ()
 query for whether a trial increment can be retrieved
 
void finalize_approximation ()
 finalize data fit by applying all previous trial increments
 
void store_approximation (size_t index=_NPOS)
 store the current data fit approximation for later combination
 
void restore_approximation (size_t index=_NPOS)
 restore a previous data fit approximation
 
void remove_stored_approximation (size_t index=_NPOS)
 store the current data fit approximation for later combination
 
void combine_approximation (short corr_type)
 combine the current data fit approximation with one previously stored
 
void run_dace_iterator (bool rebuild_flag)
 execute the DACE iterator, append the approximation data, and rebuild the approximation if indicated
 
SharedApproxDatashared_approximation ()
 retrieve the SharedApproxData from approxInterface
 
std::vector< Approximation > & approximations ()
 retrieve the set of Approximations from approxInterface
 
const RealVectorArray & approximation_coefficients (bool normalized=false)
 return the approximation coefficients from each Approximation (request forwarded to approxInterface)
 
void approximation_coefficients (const RealVectorArray &approx_coeffs, bool normalized=false)
 set the approximation coefficients within each Approximation (request forwarded to approxInterface)
 
const RealVector & approximation_variances (const Variables &vars)
 return the approximation variance from each Approximation (request forwarded to approxInterface)
 
const Pecos::SurrogateData & approximation_data (size_t index)
 return the approximation data from a particular Approximation (request forwarded to approxInterface)
 
void component_parallel_mode (short mode)
 update component parallel mode for supporting parallelism in actualModel
 
IntIntPair estimate_partition_bounds (int max_eval_concurrency)
 estimate the minimum and maximum partition sizes that can be utilized by this Model
 
void derived_init_communicators (ParLevLIter pl_iter, int max_eval_concurrency, bool recurse_flag=true)
 set up actualModel for parallel operations More...
 
void derived_init_serial ()
 set up actualModel for serial operations.
 
void derived_set_communicators (ParLevLIter pl_iter, int max_eval_concurrency, bool recurse_flag=true)
 set active parallel configuration within actualModel
 
void derived_free_communicators (ParLevLIter pl_iter, int max_eval_concurrency, bool recurse_flag=true)
 deallocate communicator partitions for the DataFitSurrModel (request forwarded to actualModel)
 
void serve_run (ParLevLIter pl_iter, int max_eval_concurrency)
 Service actualModel job requests received from the master. Completes when a termination message is received from stop_servers().
 
void stop_servers ()
 Executed by the master to terminate actualModel server operations when DataFitSurrModel iteration is complete.
 
void inactive_view (short view, bool recurse_flag=true)
 update the Model's inactive view based on higher level (nested) context and optionally recurse into actualModel
 
const String & interface_id () const
 return the approxInterface identifier
 
int evaluation_id () const
 return the current evaluation id for the DataFitSurrModel More...
 
void set_evaluation_reference ()
 set the evaluation counter reference points for the DataFitSurrModel (request forwarded to approxInterface and actualModel)
 
void fine_grained_evaluation_counters ()
 request fine-grained evaluation reporting within approxInterface and actualModel
 
void print_evaluation_summary (std::ostream &s, bool minimal_header=false, bool relative_count=true) const
 print the evaluation summary for the DataFitSurrModel (request forwarded to approxInterface and actualModel)
 
- Protected Member Functions inherited from SurrogateModel
 SurrogateModel (ProblemDescDB &problem_db)
 constructor
 
 SurrogateModel (ProblemDescDB &problem_db, ParallelLibrary &parallel_lib, const SharedVariablesData &svd, const SharedResponseData &srd, const ActiveSet &set, short output_level)
 alternate constructor
 
 ~SurrogateModel ()
 destructor
 
Modelsubordinate_model ()
 return truth_model()
 
short surrogate_response_mode () const
 return responseMode
 
size_t mi_parallel_level_index () const
 return miPLIndex
 
DiscrepancyCorrectiondiscrepancy_correction ()
 return deltaCorr
 
void check_submodel_compatibility (const Model &sub_model)
 verify compatibility between SurrogateModel attributes and attributes of the submodel (DataFitSurrModel::actualModel or HierarchSurrModel::highFidelityModel)
 
bool force_rebuild ()
 evaluate whether a rebuild of the approximation should be forced based on changes in the inactive data More...
 
void asv_mapping (const ShortArray &orig_asv, ShortArray &actual_asv, ShortArray &approx_asv, bool build_flag)
 distributes the incoming orig_asv among actual_asv and approx_asv
 
void asv_mapping (const ShortArray &actual_asv, const ShortArray &approx_asv, ShortArray &combined_asv)
 reconstitutes a combined_asv from actual_asv and approx_asv
 
void response_mapping (const Response &actual_response, const Response &approx_response, Response &combined_response)
 overlays actual_response and approx_response to update combined_response
 
- Protected Member Functions inherited from Model
 Model (BaseConstructor, ProblemDescDB &problem_db)
 constructor initializing the base class part of letter classes (BaseConstructor overloading avoids infinite recursion in the derived class constructors - Coplien, p. 139) More...
 
 Model (LightWtBaseConstructor, ProblemDescDB &problem_db, ParallelLibrary &parallel_lib, const SharedVariablesData &svd, const SharedResponseData &srd, const ActiveSet &set, short output_level)
 constructor initializing base class for derived model class instances constructed on the fly
 
 Model (LightWtBaseConstructor, ProblemDescDB &problem_db, ParallelLibrary &parallel_lib)
 constructor initializing base class for recast model instances More...
 
void set_ie_asynchronous_mode (int max_eval_concurrency)
 default logic for defining asynchEvalFlag and evaluationCapacity based on ie_pl settings
 
void string_variable_max (const StringSetArray &ssa, size_t offset, Variables &vars)
 set the current value of each string variable offset + i to the longest string value found in the admissible string set ssa[i]
 
void string_variable_max (const StringRealMapArray &srma, size_t offset, Variables &vars)
 set the current value of each string variable offset + i to the longest string value found in the admissible string map srma[i]
 
SizetMultiArrayConstView initialize_x0_bounds (const SizetArray &original_dvv, bool &active_derivs, bool &inactive_derivs, RealVector &x0, RealVector &fd_lb, RealVector &fd_ub) const
 Initialize data needed for computing finite differences (active/inactive, center point, and bounds)
 
Real forward_grad_step (size_t num_deriv_vars, size_t xj_index, Real x0_j, Real lb_j, Real ub_j)
 Compute the forward step for a finite difference gradient; updates shortStep.
 

Protected Attributes

const bool exportSurrogate
 whether to export the surrogate to file
 
const bool autoRefine
 whether to automatically refine the surrogate during the build phase
 
const int maxIterations
 Maximum number of times to refine the surrogate.
 
const int maxFuncEvals
 Maximum number of evaluations while refining a surrogate.
 
const Real convergenceTolerance
 Convergence criterion, compared to CV score for specified metric.
 
const String refineCVMetric
 Type of error metric to test for surrogate refinement convegence.
 
const int refineCVFolds
 Number of cross validation folds for surrogate refinement.
 
- Protected Attributes inherited from SurrogateModel
IntSet surrogateFnIndices
 for mixed response sets, this array specifies the response function subset that is approximated
 
IntResponseMap surrResponseMap
 map of surrogate responses used in derived_synchronize() and derived_synchronize_nowait() functions
 
IntVariablesMap rawVarsMap
 map of raw continuous variables used by apply_correction(). Model::varsList cannot be used for this purpose since it does not contain lower level variables sets from finite differencing.
 
IntIntMap truthIdMap
 map from actualModel/highFidelityModel evaluation ids to DataFitSurrModel.hppierarchSurrModel ids
 
IntIntMap surrIdMap
 map from approxInterface/lowFidelityModel evaluation ids to DataFitSurrModel.hppierarchSurrModel ids
 
IntResponseMap cachedApproxRespMap
 map of approximate responses retrieved in derived_synchronize_nowait() that could not be returned since corresponding truth model response portions were still pending.
 
short responseMode
 an enumeration that controls the response calculation mode in {DataFit,Hierarch}SurrModel approximate response computations More...
 
size_t approxBuilds
 number of calls to build_approximation() More...
 
size_t miPLIndex
 the index of the active metaiterator-iterator parallelism level (corresponding to ParallelConfiguration::miPLIters) used at runtime
 
RealVector referenceCLBnds
 stores a reference copy of active continuous lower bounds when the approximation is built; used to detect when a rebuild is required.
 
RealVector referenceCUBnds
 stores a reference copy of active continuous upper bounds when the approximation is built; used to detect when a rebuild is required.
 
IntVector referenceDILBnds
 stores a reference copy of active discrete int lower bounds when the approximation is built; used to detect when a rebuild is required.
 
IntVector referenceDIUBnds
 stores a reference copy of active discrete int upper bounds when the approximation is built; used to detect when a rebuild is required.
 
RealVector referenceDRLBnds
 stores a reference copy of active discrete real lower bounds when the approximation is built; used to detect when a rebuild is required.
 
RealVector referenceDRUBnds
 stores a reference copy of active discrete real upper bounds when the approximation is built; used to detect when a rebuild is required.
 
RealVector referenceICVars
 stores a reference copy of the inactive continuous variables when the approximation is built using a Distinct view; used to detect when a rebuild is required.
 
IntVector referenceIDIVars
 stores a reference copy of the inactive discrete int variables when the approximation is built using a Distinct view; used to detect when a rebuild is required.
 
StringMultiArray referenceIDSVars
 stores a reference copy of the inactive discrete string variables when the approximation is built using a Distinct view; used to detect when a rebuild is required.
 
RealVector referenceIDRVars
 stores a reference copy of the inactive discrete real variables when the approximation is built using a Distinct view; used to detect when a rebuild is required.
 
DiscrepancyCorrection deltaCorr
 manages construction and application of correction functions that are applied to a surrogate model (DataFitSurr or HierarchSurr) in order to reproduce high fidelity data.
 
- Protected Attributes inherited from Model
Variables currentVariables
 the set of current variables used by the model for performing function evaluations
 
size_t numDerivVars
 the number of active continuous variables used in computing most response derivatives (i.e., in places such as quasi-Hessians and response corrections where only the active continuous variables are supported)
 
Response currentResponse
 the set of current responses that holds the results of model function evaluations
 
size_t numFns
 the number of functions in currentResponse
 
Constraints userDefinedConstraints
 Explicit constraints on variables are maintained in the Constraints class hierarchy. Currently, this includes linear constraints and bounds, but could be extended in the future to include other explicit constraints which (1) have their form specified by the user, and (2) are not catalogued in Response since their form and coefficients are published to an iterator at startup.
 
String modelId
 model identifier string from the input file
 
String modelType
 type of model: simulation, nested, or surrogate
 
String surrogateType
 type of surrogate model: local_*, multipoint_*, global_*, or hierarchical
 
String gradientType
 type of gradient data: analytic, numerical, mixed, or none
 
String methodSource
 source of numerical gradient routine: dakota or vendor
 
String intervalType
 type of numerical gradient interval: central or forward
 
String hessianType
 type of Hessian data: analytic, numerical, quasi, mixed, or none
 
RealVector fdGradStepSize
 relative finite difference step size for numerical gradients More...
 
String fdGradStepType
 type of finite difference step to use for numerical gradient: relative - step length is relative to x absolute - step length is what is specified bounds - step length is relative to range of x
 
RealVector fdHessByGradStepSize
 relative finite difference step size for numerical Hessians estimated using first-order differences of gradients More...
 
RealVector fdHessByFnStepSize
 relative finite difference step size for numerical Hessians estimated using second-order differences of function values More...
 
String fdHessStepType
 type of finite difference step to use for numerical Hessian: relative - step length is relative to x absolute - step length is what is specified bounds - step length is relative to range of x
 
bool ignoreBounds
 option to ignore bounds when computing finite diffs
 
bool centralHess
 option to use old 2nd-order finite diffs for Hessians
 
bool supportsEstimDerivs
 whether model should perform or forward derivative estimation
 
String quasiHessType
 quasi-Hessian type: bfgs, damped_bfgs, sr1
 
IntSet gradIdAnalytic
 analytic id's for mixed gradients
 
IntSet gradIdNumerical
 numerical id's for mixed gradients
 
IntSet hessIdAnalytic
 analytic id's for mixed Hessians
 
IntSet hessIdNumerical
 numerical id's for mixed Hessians
 
IntSet hessIdQuasi
 quasi id's for mixed Hessians
 
IntArray messageLengths
 length of packed MPI buffers containing vars, vars/set, response, and PRPair
 
ProblemDescDBprobDescDB
 class member reference to the problem description database More...
 
ParallelLibraryparallelLib
 class member reference to the parallel library
 
ParConfigLIter modelPCIter
 the ParallelConfiguration node used by this Model instance
 
short componentParallelMode
 the component parallelism mode: 0 (none), 1 (INTERFACE/LF_MODEL), or 2 (SUB_MODEL/HF_MODEL/TRUTH_MODEL)
 
bool asynchEvalFlag
 flags asynch evaluations (local or distributed)
 
int evaluationCapacity
 capacity for concurrent evaluations supported by the Model
 
short outputLevel
 output verbosity level: {SILENT,QUIET,NORMAL,VERBOSE,DEBUG}_OUTPUT
 
ModelList modelList
 used to collect sub-models for subordinate_models()
 
IntSetArray discreteDesignSetIntValues
 array of IntSet's, each containing the set of allowable integer values corresponding to a discrete design integer set variable
 
StringSetArray discreteDesignSetStringValues
 array of IntSet's, each containing the set of allowable integer values corresponding to a discrete design string set variable
 
RealSetArray discreteDesignSetRealValues
 array of RealSet's, each containing the set of allowable real values corresponding to a discrete design real set variable
 
IntSetArray discreteStateSetIntValues
 array of IntSet's, each containing the set of allowable integer values corresponding to a discrete state integer set variable
 
StringSetArray discreteStateSetStringValues
 array of IntSet's, each containing the set of allowable integer values corresponding to a discrete state string set variable
 
RealSetArray discreteStateSetRealValues
 array of RealSet's, each containing the set of allowable real values corresponding to a discrete state real set variable
 
Pecos::AleatoryDistParams aleatDistParams
 container for aleatory random variable distribution parameters
 
Pecos::EpistemicDistParams epistDistParams
 container for epistemic random variable distribution parameters
 
BoolDeque primaryRespFnSense
 array of flags (one per primary function) for switching the sense to maximize the primary function (default is minimize)
 
RealVector primaryRespFnWts
 primary response function weightings (either weights for multiobjective optimization or weighted least squares)
 
bool hierarchicalTagging
 whether to perform hierarchical evalID tagging of params/results
 
ScalingOptions scalingOpts
 user-provided scaling data from the problem DB, possibly modified by Recasting
 
String evalTagPrefix
 cached evalTag Prefix from parents to use at evaluate time
 

Private Member Functions

void import_points (unsigned short tabular_format, bool active_only)
 optionally read surrogate data points from provided file More...
 
void initialize_export ()
 initialize file stream for exporting surrogate evaluations More...
 
void finalize_export ()
 finalize file stream for exporting surrogate evaluations More...
 
void manage_data_recastings ()
 initialize manageRecasting and recastFlags for data import/export More...
 
void export_point (int eval_id, const Variables &vars, const Response &resp)
 initialize file stream for exporting surrogate evaluations More...
 
void derived_synchronize_approx (const IntResponseMap &approx_resp_map, IntResponseMap &approx_resp_map_rekey)
 Common code for processing of approximate response maps shared by derived_synchronize() and derived_synchronize_nowait()
 
void update_global ()
 Updates fit arrays for global approximations.
 
void update_local_multipoint ()
 Updates fit arrays for local or multipoint approximations.
 
void build_global ()
 Builds a global approximation using daceIterator. More...
 
void build_local_multipoint ()
 Builds a local or multipoint approximation using actualModel. More...
 
void refine_surrogate ()
 Refine the built surrogate until convergence criteria are met.
 
void interface_build_approx ()
 Call build_approximation on the interface, passing appropriate constraints.
 
void update_actual_model ()
 update actualModel with data from current variables/labels/bounds/targets More...
 
void update_from_actual_model ()
 update current variables/labels/bounds/targets with data from actualModel More...
 
bool inside (const RealVector &c_vars, const IntVector &di_vars, const RealVector &dr_vars)
 test if c_vars and d_vars are within [c_l_bnds,c_u_bnds] and [d_l_bnds,d_u_bnds]
 

Private Attributes

int surrModelEvalCntr
 number of calls to derived_evaluate()/derived_evaluate_nowait()
 
int pointsTotal
 total points the user specified to construct the surrogate
 
short pointsManagement
 configuration for points management in build_global()
 
String pointReuse
 type of point reuse for approximation builds: all, region (default if points file), or none (default if no points file)
 
bool manageRecasting
 flag indicating need to manage data recastings when importing build data or exporting approximate evaluations
 
BoolDeque recastFlags
 a key indicating which models within a model recursion involve recasting
 
String importPointsFile
 file name from import_build_points_file specification
 
String exportPointsFile
 file name from export_approx_points_file specification
 
unsigned short exportFormat
 file export format for variables and approximate responses
 
std::ofstream exportFileStream
 output file stream for export_approx_points_file specification
 
VariablesList reuseFileVars
 array of variables sets read from the import_build_points_file
 
ResponseList reuseFileResponses
 array of response sets read from the import_build_points_file
 
Interface approxInterface
 manages the building and subsequent evaluation of the approximations (required for both global and local)
 
Model actualModel
 the truth model which provides evaluations for building the surrogate (optional for global, required for local) More...
 
Iterator daceIterator
 selects parameter sets on which to evaluate actualModel in order to generate the necessary data for building global approximations (optional for global since restart data may also be used)
 

Detailed Description

Derived model class within the surrogate model branch for managing data fit surrogates (global and local)

The DataFitSurrModel class manages global or local approximations (surrogates that involve data fits) that are used in place of an expensive model. The class contains an approxInterface (required for both global and local) which manages the approximate function evaluations, an actualModel (optional for global, required for local) which provides truth evaluations for building the surrogate, and a daceIterator (optional for global, not used for local) which selects parameter sets on which to evaluate actualModel in order to generate the necessary data for building global approximations.

Constructor & Destructor Documentation

~DataFitSurrModel ( )
inline

destructor

Virtual destructor handles referenceCount at base Model level.

References DataFitSurrModel::finalize_export().

Member Function Documentation

void derived_evaluate ( const ActiveSet set)
protectedvirtual
void derived_evaluate_nowait ( const ActiveSet set)
protectedvirtual
const IntResponseMap & derived_synchronize ( )
protectedvirtual

portion of synchronize() specific to DataFitSurrModel

Blocking retrieval of asynchronous evaluations from actualModel, approxInterface, or both (mixed case). For the approxInterface portion, apply correction (if active) to each response in the array. derived_synchronize() is designed for the general case where derived_evaluate_nowait() may be inconsistent in its use of actual evaluations, approximate evaluations, or both.

Reimplemented from Model.

References DataFitSurrModel::actualModel, DataFitSurrModel::approxInterface, DataFitSurrModel::component_parallel_mode(), DiscrepancyCorrection::compute(), SurrogateModel::deltaCorr, DataFitSurrModel::derived_synchronize_approx(), Model::outputLevel, SurrogateModel::response_mapping(), SurrogateModel::responseMode, SurrogateModel::surrIdMap, SurrogateModel::surrResponseMap, Interface::synch(), Model::synchronize(), and SurrogateModel::truthIdMap.

const IntResponseMap & derived_synchronize_nowait ( )
protectedvirtual

portion of synchronize_nowait() specific to DataFitSurrModel

Nonblocking retrieval of asynchronous evaluations from actualModel, approxInterface, or both (mixed case). For the approxInterface portion, apply correction (if active) to each response in the map. derived_synchronize_nowait() is designed for the general case where derived_evaluate_nowait() may be inconsistent in its use of actual evals, approx evals, or both.

Reimplemented from Model.

References Dakota::abort_handler(), DataFitSurrModel::actualModel, DataFitSurrModel::approxInterface, SurrogateModel::cachedApproxRespMap, DataFitSurrModel::component_parallel_mode(), DiscrepancyCorrection::compute(), SurrogateModel::deltaCorr, DataFitSurrModel::derived_synchronize_approx(), Model::outputLevel, SurrogateModel::response_mapping(), SurrogateModel::responseMode, SurrogateModel::surrIdMap, SurrogateModel::surrResponseMap, Interface::synch_nowait(), Model::synchronize_nowait(), and SurrogateModel::truthIdMap.

void build_approximation ( )
protectedvirtual

Builds the local/multipoint/global approximation using daceIterator/actualModel to generate new data points.

This function constructs a new approximation, discarding any previous data. It constructs any required data for SurrogateData::{vars,resp}Data and does not define an anchor point for SurrogateData::anchor{Vars,Resp}, so is an unconstrained build.

Reimplemented from Model.

References SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, DataFitSurrModel::autoRefine, DataFitSurrModel::build_global(), DataFitSurrModel::build_local_multipoint(), Interface::clear_current(), DataFitSurrModel::interface_build_approx(), Dakota::strbegins(), Model::surrogateType, DataFitSurrModel::update_actual_model(), DataFitSurrModel::update_global(), and DataFitSurrModel::update_local_multipoint().

Referenced by DataFitSurrModel::derived_evaluate(), and DataFitSurrModel::derived_evaluate_nowait().

bool build_approximation ( const Variables vars,
const IntResponsePair &  response_pr 
)
protectedvirtual

Builds the local/multipoint/global approximation using daceIterator/actualModel to generate new data points that augment the passed vars/response anchor point.

This function constructs a new approximation, discarding any previous data. It uses the passed data to populate SurrogateData::anchor{Vars,Resp} and constructs any required data points for SurrogateData::{vars,resp}Data.

Reimplemented from Model.

References SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, DataFitSurrModel::autoRefine, DataFitSurrModel::build_global(), Interface::clear_current(), DataFitSurrModel::interface_build_approx(), Dakota::strbegins(), Model::surrogateType, DataFitSurrModel::update_actual_model(), Interface::update_approximation(), DataFitSurrModel::update_global(), and DataFitSurrModel::update_local_multipoint().

void update_approximation ( bool  rebuild_flag)
protectedvirtual

replaces the approximation data with daceIterator results and rebuilds the approximation if requested

This function populates/replaces SurrogateData::anchor{Vars,Resp} and rebuilds the approximation, if requested. It does not clear other data (i.e., SurrogateData::{vars,resp}Data) and does not update the actualModel with revised bounds, labels, etc. Thus, it updates data from a previous call to build_approximation(), and is not intended to be used in isolation.

Reimplemented from Model.

References Iterator::all_responses(), Iterator::all_samples(), Iterator::all_variables(), SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Iterator::compact_mode(), DataFitSurrModel::daceIterator, Model::numFns, Interface::rebuild_approximation(), Model::surrogateType, and Interface::update_approximation().

void update_approximation ( const Variables vars,
const IntResponsePair &  response_pr,
bool  rebuild_flag 
)
protectedvirtual

replaces the anchor point, and rebuilds the approximation if requested

This function populates/replaces SurrogateData::anchor{Vars,Resp} and rebuilds the approximation, if requested. It does not clear other data (i.e., SurrogateData::{vars,resp}Data) and does not update the actualModel with revised bounds, labels, etc. Thus, it updates data from a previous call to build_approximation(), and is not intended to be used in isolation.

Reimplemented from Model.

References SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Model::numFns, Interface::rebuild_approximation(), Model::surrogateType, and Interface::update_approximation().

void update_approximation ( const VariablesArray &  vars_array,
const IntResponseMap &  resp_map,
bool  rebuild_flag 
)
protectedvirtual

replaces the current points array and rebuilds the approximation if requested

This function populates/replaces SurrogateData::{vars,resp}Data and rebuilds the approximation, if requested. It does not clear other data (i.e., SurrogateData::anchor{Vars,Resp}) and does not update the actualModel with revised bounds, labels, etc. Thus, it updates data from a previous call to build_approximation(), and is not intended to be used in isolation.

Reimplemented from Model.

References SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Model::numFns, Interface::rebuild_approximation(), Model::surrogateType, and Interface::update_approximation().

void update_approximation ( const RealMatrix &  samples,
const IntResponseMap &  resp_map,
bool  rebuild_flag 
)
protectedvirtual

replaces the current points array and rebuilds the approximation if requested

This function populates/replaces SurrogateData::{vars,resp}Data and rebuilds the approximation, if requested. It does not clear other data (i.e., SurrogateData::anchor{Vars,Resp}) and does not update the actualModel with revised bounds, labels, etc. Thus, it updates data from a previous call to build_approximation(), and is not intended to be used in isolation.

Reimplemented from Model.

References SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Model::numFns, Interface::rebuild_approximation(), Model::surrogateType, and Interface::update_approximation().

void append_approximation ( bool  rebuild_flag)
protectedvirtual

appends daceIterator results to a global approximation and rebuilds it if requested

This function appends one point to SurrogateData::{vars,resp}Data and rebuilds the approximation, if requested. It does not modify other data (i.e., SurrogateData::anchor{Vars,Resp}) and does not update the actualModel with revised bounds, labels, etc. Thus, it appends to data from a previous call to build_approximation(), and is not intended to be used in isolation.

Reimplemented from Model.

References Iterator::all_responses(), Iterator::all_samples(), Iterator::all_variables(), Interface::append_approximation(), SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Iterator::compact_mode(), DataFitSurrModel::daceIterator, Model::numFns, Interface::rebuild_approximation(), and Model::surrogateType.

Referenced by DataFitSurrModel::run_dace_iterator().

void append_approximation ( const Variables vars,
const IntResponsePair &  response_pr,
bool  rebuild_flag 
)
protectedvirtual

appends a point to a global approximation and rebuilds it if requested

This function appends one point to SurrogateData::{vars,resp}Data and rebuilds the approximation, if requested. It does not modify other data (i.e., SurrogateData::anchor{Vars,Resp}) and does not update the actualModel with revised bounds, labels, etc. Thus, it appends to data from a previous call to build_approximation(), and is not intended to be used in isolation.

Reimplemented from Model.

References Interface::append_approximation(), SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Model::numFns, Interface::rebuild_approximation(), and Model::surrogateType.

void append_approximation ( const VariablesArray &  vars_array,
const IntResponseMap &  resp_map,
bool  rebuild_flag 
)
protectedvirtual

appends an array of points to a global approximation and rebuilds it if requested

This function appends multiple points to SurrogateData::{vars,resp}Data and rebuilds the approximation, if requested. It does not modify other data (i.e., SurrogateData::anchor{Vars,Resp}) and does not update the actualModel with revised bounds, labels, etc. Thus, it appends to data from a previous call to build_approximation(), and is not intended to be used in isolation.

Reimplemented from Model.

References Interface::append_approximation(), SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Model::numFns, Interface::rebuild_approximation(), and Model::surrogateType.

void append_approximation ( const RealMatrix &  samples,
const IntResponseMap &  resp_map,
bool  rebuild_flag 
)
protectedvirtual

appends a matrix of points to a global approximation and rebuilds it if requested

This function appends multiple points to SurrogateData::{vars,resp}Data and rebuilds the approximation, if requested. It does not modify other data (i.e., SurrogateData::anchor{Vars,Resp}) and does not update the actualModel with revised bounds, labels, etc. Thus, it appends to data from a previous call to build_approximation(), and is not intended to be used in isolation.

Reimplemented from Model.

References Interface::append_approximation(), SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Model::numFns, Interface::rebuild_approximation(), and Model::surrogateType.

void derived_init_communicators ( ParLevLIter  pl_iter,
int  max_eval_concurrency,
bool  recurse_flag = true 
)
protectedvirtual

set up actualModel for parallel operations

asynchronous flags need to be initialized for the sub-models. In addition, max_eval_concurrency is the outer level iterator concurrency, not the DACE concurrency that actualModel will see, and recomputing the message_lengths on the sub-model is probably not a bad idea either. Therefore, recompute everything on actualModel using init_communicators.

Reimplemented from Model.

References DataFitSurrModel::actualModel, DataFitSurrModel::approxInterface, DataFitSurrModel::daceIterator, Model::derivative_concurrency(), ProblemDescDB::get_db_method_node(), ProblemDescDB::get_db_model_node(), Iterator::init_communicators(), Model::init_communicators(), Iterator::is_null(), Model::is_null(), Iterator::iterated_model(), Iterator::maximum_evaluation_concurrency(), Iterator::method_id(), Interface::minimum_points(), Model::model_id(), Model::probDescDB, ProblemDescDB::set_db_list_nodes(), ProblemDescDB::set_db_method_node(), and ProblemDescDB::set_db_model_nodes().

int evaluation_id ( ) const
inlineprotectedvirtual

return the current evaluation id for the DataFitSurrModel

return the DataFitSurrModel evaluation count. Due to possibly intermittent use of surrogate bypass, this is not the same as either the approxInterface or actualModel model evaluation counts. It also does not distinguish duplicate evals.

Reimplemented from Model.

References DataFitSurrModel::surrModelEvalCntr.

void import_points ( unsigned short  tabular_format,
bool  active_only 
)
private

optionally read surrogate data points from provided file

Constructor helper to read the points file once, if provided, and then reuse its data as appropriate within build_global(). Surrogate data imports default to active/inactive variables, but user can override to active only

References DataFitSurrModel::actualModel, Model::current_response(), Model::current_variables(), Model::currentResponse, Model::currentVariables, Variables::cv(), Variables::div(), Variables::drv(), Variables::dsv(), DataFitSurrModel::importPointsFile, Model::is_null(), Model::numFns, Model::outputLevel, DataFitSurrModel::reuseFileResponses, DataFitSurrModel::reuseFileVars, and Variables::tv().

Referenced by DataFitSurrModel::DataFitSurrModel().

void initialize_export ( )
private

initialize file stream for exporting surrogate evaluations

Constructor helper to export approximation-based evaluations to a file.

References Model::currentResponse, Model::currentVariables, DataFitSurrModel::exportFileStream, DataFitSurrModel::exportFormat, and DataFitSurrModel::exportPointsFile.

Referenced by DataFitSurrModel::DataFitSurrModel().

void finalize_export ( )
private

finalize file stream for exporting surrogate evaluations

Constructor helper to export approximation-based evaluations to a file.

References DataFitSurrModel::exportFileStream, and DataFitSurrModel::exportPointsFile.

Referenced by DataFitSurrModel::~DataFitSurrModel().

void manage_data_recastings ( )
private

initialize manageRecasting and recastFlags for data import/export

Constructor helper to manage model recastings for data import/export.

References DataFitSurrModel::manageRecasting, DataFitSurrModel::recastFlags, and Model::subordinate_models().

Referenced by DataFitSurrModel::DataFitSurrModel().

void export_point ( int  eval_id,
const Variables vars,
const Response resp 
)
private

initialize file stream for exporting surrogate evaluations

Constructor helper to export approximation-based evaluations to a file. Exports all variables, so it's clear at what values of inactive it was built at

References DataFitSurrModel::exportFileStream, DataFitSurrModel::exportFormat, DataFitSurrModel::exportPointsFile, DataFitSurrModel::interface_id(), RecastModel::inverse_transform_response(), DataFitSurrModel::manageRecasting, Model::model_rep(), Model::modelList, DataFitSurrModel::recastFlags, and RecastModel::transform_variables().

Referenced by DataFitSurrModel::derived_evaluate(), and DataFitSurrModel::derived_synchronize_approx().

void build_global ( )
private

Builds a global approximation using daceIterator.

Determine points to use in building the approximation and then evaluate them on actualModel using daceIterator. Any changes to the bounds should be performed by setting them at a higher level (e.g., SurrBasedOptStrategy).

References Dakota::abort_handler(), DataFitSurrModel::actualModel, Interface::append_approximation(), Interface::approximation_data(), DataFitSurrModel::approxInterface, DataFitSurrModel::autoRefine, DataFitSurrModel::component_parallel_mode(), Variables::continuous_variables(), Model::currentVariables, Variables::cv(), Model::cv(), DataFitSurrModel::daceIterator, Dakota::data_pairs, Variables::discrete_int_variables(), Variables::discrete_real_variables(), Variables::div(), Model::div(), Variables::drv(), Model::drv(), DataFitSurrModel::importPointsFile, DataFitSurrModel::inside(), Model::interface_id(), RecastModel::inverse_transform_variables(), Iterator::is_null(), Model::is_null(), DataFitSurrModel::manageRecasting, Interface::minimum_points(), Model::model_rep(), Model::modelList, Iterator::num_samples(), Model::outputLevel, DataFitSurrModel::pointReuse, DataFitSurrModel::pointsManagement, DataFitSurrModel::pointsTotal, DataFitSurrModel::recastFlags, Interface::recommended_points(), DataFitSurrModel::refine_surrogate(), DataFitSurrModel::reuseFileResponses, DataFitSurrModel::reuseFileVars, DataFitSurrModel::run_dace_iterator(), Iterator::sampling_reset(), and SurrogateModel::surrogateFnIndices.

Referenced by DataFitSurrModel::build_approximation().

void build_local_multipoint ( )
private
void update_actual_model ( )
private

update actualModel with data from current variables/labels/bounds/targets

Update variables and constraints data within actualModel using values and labels from currentVariables and bound/linear/nonlinear constraints from userDefinedConstraints.

References Dakota::abort_handler(), DataFitSurrModel::actualModel, Model::aleatDistParams, Model::aleatory_distribution_parameters(), Constraints::all_continuous_lower_bounds(), Model::all_continuous_lower_bounds(), Constraints::all_continuous_upper_bounds(), Model::all_continuous_upper_bounds(), Variables::all_continuous_variable_labels(), Model::all_continuous_variable_labels(), Variables::all_continuous_variables(), Model::all_continuous_variables(), Constraints::all_discrete_int_lower_bounds(), Model::all_discrete_int_lower_bounds(), Constraints::all_discrete_int_upper_bounds(), Model::all_discrete_int_upper_bounds(), Variables::all_discrete_int_variable_labels(), Model::all_discrete_int_variable_labels(), Variables::all_discrete_int_variables(), Model::all_discrete_int_variables(), Constraints::all_discrete_real_lower_bounds(), Model::all_discrete_real_lower_bounds(), Constraints::all_discrete_real_upper_bounds(), Model::all_discrete_real_upper_bounds(), Variables::all_discrete_real_variable_labels(), Model::all_discrete_real_variable_labels(), Variables::all_discrete_real_variables(), Model::all_discrete_real_variables(), SurrogateModel::approxBuilds, Constraints::continuous_lower_bounds(), Model::continuous_lower_bounds(), Constraints::continuous_upper_bounds(), Model::continuous_upper_bounds(), Variables::continuous_variable_labels(), Model::continuous_variable_labels(), Variables::continuous_variables(), Model::continuous_variables(), Model::current_variables(), Model::currentResponse, Model::currentVariables, Variables::cv(), Model::cv(), Model::discrete_design_set_int_values(), Model::discrete_design_set_real_values(), Constraints::discrete_int_lower_bounds(), Model::discrete_int_lower_bounds(), Constraints::discrete_int_upper_bounds(), Model::discrete_int_upper_bounds(), Variables::discrete_int_variable_labels(), Model::discrete_int_variable_labels(), Variables::discrete_int_variables(), Model::discrete_int_variables(), Constraints::discrete_real_lower_bounds(), Model::discrete_real_lower_bounds(), Constraints::discrete_real_upper_bounds(), Model::discrete_real_upper_bounds(), Variables::discrete_real_variable_labels(), Model::discrete_real_variable_labels(), Variables::discrete_real_variables(), Model::discrete_real_variables(), Model::discrete_state_set_int_values(), Model::discrete_state_set_real_values(), Model::discreteDesignSetIntValues, Model::discreteDesignSetRealValues, Model::discreteStateSetIntValues, Model::discreteStateSetRealValues, Variables::div(), Model::div(), Variables::drv(), Model::drv(), Model::epistDistParams, Model::epistemic_distribution_parameters(), Response::function_labels(), SharedVariablesData::id(), Variables::inactive_continuous_variable_labels(), Model::inactive_continuous_variable_labels(), Variables::inactive_discrete_int_variable_labels(), Model::inactive_discrete_int_variable_labels(), Variables::inactive_discrete_real_variable_labels(), Model::inactive_discrete_real_variable_labels(), Model::is_null(), Constraints::linear_eq_constraint_coeffs(), Model::linear_eq_constraint_coeffs(), Constraints::linear_eq_constraint_targets(), Model::linear_eq_constraint_targets(), Constraints::linear_ineq_constraint_coeffs(), Model::linear_ineq_constraint_coeffs(), Constraints::linear_ineq_constraint_lower_bounds(), Model::linear_ineq_constraint_lower_bounds(), Constraints::linear_ineq_constraint_upper_bounds(), Model::linear_ineq_constraint_upper_bounds(), Constraints::nonlinear_eq_constraint_targets(), Model::nonlinear_eq_constraint_targets(), Constraints::nonlinear_ineq_constraint_lower_bounds(), Model::nonlinear_ineq_constraint_lower_bounds(), Constraints::nonlinear_ineq_constraint_upper_bounds(), Model::nonlinear_ineq_constraint_upper_bounds(), Constraints::num_linear_eq_constraints(), Constraints::num_linear_ineq_constraints(), Constraints::num_nonlinear_eq_constraints(), Constraints::num_nonlinear_ineq_constraints(), Model::response_labels(), Variables::shared_data(), Model::userDefinedConstraints, and Variables::view().

Referenced by DataFitSurrModel::build_approximation(), DataFitSurrModel::derived_evaluate(), and DataFitSurrModel::derived_evaluate_nowait().

void update_from_actual_model ( )
private

update current variables/labels/bounds/targets with data from actualModel

Update values and labels in currentVariables and bound/linear/nonlinear constraints in userDefinedConstraints from variables and constraints data within actualModel.

References Dakota::abort_handler(), DataFitSurrModel::actualModel, Model::aleatDistParams, Model::aleatory_distribution_parameters(), Constraints::all_continuous_lower_bounds(), Model::all_continuous_lower_bounds(), Constraints::all_continuous_upper_bounds(), Model::all_continuous_upper_bounds(), Variables::all_continuous_variable_labels(), Model::all_continuous_variable_labels(), Variables::all_continuous_variables(), Model::all_continuous_variables(), Constraints::all_discrete_int_lower_bounds(), Model::all_discrete_int_lower_bounds(), Constraints::all_discrete_int_upper_bounds(), Model::all_discrete_int_upper_bounds(), Variables::all_discrete_int_variable_labels(), Model::all_discrete_int_variable_labels(), Variables::all_discrete_int_variables(), Model::all_discrete_int_variables(), Constraints::all_discrete_real_lower_bounds(), Model::all_discrete_real_lower_bounds(), Constraints::all_discrete_real_upper_bounds(), Model::all_discrete_real_upper_bounds(), Variables::all_discrete_real_variable_labels(), Model::all_discrete_real_variable_labels(), Variables::all_discrete_real_variables(), Model::all_discrete_real_variables(), SurrogateModel::approxBuilds, Model::current_variables(), Model::currentResponse, Model::currentVariables, Variables::cv(), Model::cv(), Model::discrete_design_set_int_values(), Model::discrete_design_set_real_values(), Model::discrete_state_set_int_values(), Model::discrete_state_set_real_values(), Model::discreteDesignSetIntValues, Model::discreteDesignSetRealValues, Model::discreteStateSetIntValues, Model::discreteStateSetRealValues, Variables::div(), Model::div(), Variables::drv(), Model::drv(), Model::epistDistParams, Model::epistemic_distribution_parameters(), Response::function_labels(), SharedVariablesData::id(), Constraints::linear_eq_constraint_coeffs(), Model::linear_eq_constraint_coeffs(), Constraints::linear_eq_constraint_targets(), Model::linear_eq_constraint_targets(), Constraints::linear_ineq_constraint_coeffs(), Model::linear_ineq_constraint_coeffs(), Constraints::linear_ineq_constraint_lower_bounds(), Model::linear_ineq_constraint_lower_bounds(), Constraints::linear_ineq_constraint_upper_bounds(), Model::linear_ineq_constraint_upper_bounds(), Constraints::nonlinear_eq_constraint_targets(), Model::nonlinear_eq_constraint_targets(), Constraints::nonlinear_ineq_constraint_lower_bounds(), Model::nonlinear_ineq_constraint_lower_bounds(), Constraints::nonlinear_ineq_constraint_upper_bounds(), Model::nonlinear_ineq_constraint_upper_bounds(), Model::num_linear_eq_constraints(), Model::num_linear_ineq_constraints(), Model::num_nonlinear_eq_constraints(), Model::num_nonlinear_ineq_constraints(), Model::primary_response_fn_sense(), Model::primary_response_fn_weights(), Model::primaryRespFnSense, Model::primaryRespFnWts, Model::response_labels(), Variables::shared_data(), and Model::userDefinedConstraints.

Referenced by DataFitSurrModel::DataFitSurrModel(), and DataFitSurrModel::update_from_subordinate_model().

Member Data Documentation

Model actualModel
private

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