Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
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

List of all members.

Public Member Functions

 DataFitSurrModel (ProblemDescDB &problem_db)
 constructor
 DataFitSurrModel (Iterator &dace_iterator, Model &actual_model, const String &approx_type, const UShortArray &approx_order, const String &corr_type, short corr_order, const String &point_reuse)
 alternate constructor for instantiations on the fly
 ~DataFitSurrModel ()
 destructor

Protected Member Functions

void derived_compute_response (const ActiveSet &set)
 portion of compute_response() specific to DataFitSurrModel
void derived_asynch_compute_response (const ActiveSet &set)
 portion of asynch_compute_response() specific to DataFitSurrModel
const IntResponseMap & derived_synchronize ()
 portion of synchronize() specific to DataFitSurrModel
const IntResponseMap & derived_synchronize_nowait ()
 portion of synchronize_nowait() specific to DataFitSurrModel
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 (bool recurse_flag=true)
 pass request to actualModel if recursing and then update from it
Interfaceinterface ()
 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_bypass (bool bypass_flag)
 set surrogateBypass flag and pass 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.
bool build_approximation (const Variables &vars, const Response &response)
 Builds the local/multipoint/global approximation using daceIterator/actualModel to generate new data points that augment the vars/response anchor point.
void update_approximation (bool rebuild_flag)
 replaces the aproximation data and rebuilds the approximation if requested
void update_approximation (const Variables &vars, const Response &response, bool rebuild_flag)
 replaces the anchor point, and rebuilds the approximation if requested
void update_approximation (const VariablesArray &vars_array, const ResponseArray &resp_array, bool rebuild_flag)
 replaces the current points array and rebuilds the approximation if requested
void append_approximation (bool rebuild_flag)
 appends data to a global approximation and rebuilds it if requested
void append_approximation (const Variables &vars, const Response &response, bool rebuild_flag)
 appends a point to a global approximation and rebuilds it if requested
void append_approximation (const VariablesArray &vars_array, const ResponseArray &resp_array, bool rebuild_flag)
 appends an array of points to a global approximation and rebuilds it if requested
void pop_approximation (bool save_sdp_set)
 remove approximation data added on previous append_approximation() call
void restore_approximation ()
 restore a previous approximation data state
bool restore_available ()
 query for whether a trial increment is restorable
void finalize_approximation ()
 finalize data fit by applying all previous trial increments
std::vector< Approximation > & approximations ()
 retrieve the set of Approximations from approxInterface
const RealVectorArray & approximation_coefficients ()
 return the approximation coefficients from each Approximation (request forwarded to approxInterface)
void approximation_coefficients (const RealVectorArray &approx_coeffs)
 set the approximation coefficients within each Approximation (request forwarded to approxInterface)
const RealVector & approximation_variances (const RealVector &c_vars)
 return the approximation variance from each Approximation (request forwarded to approxInterface)
const SDPList & 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
void derived_init_communicators (const int &max_iterator_concurrency, bool recurse_flag=true)
 set up actualModel for parallel operations
void derived_init_serial ()
 set up actualModel for serial operations.
void derived_set_communicators (const int &max_iterator_concurrency, bool recurse_flag=true)
 set active parallel configuration within actualModel
void derived_free_communicators (const int &max_iterator_concurrency, bool recurse_flag=true)
 deallocate communicator partitions for the DataFitSurrModel (request forwarded to actualModel)
void serve ()
 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 Stringinterface_id () const
 return the approxInterface identifier
int evaluation_id () const
 return the current evaluation id for the DataFitSurrModel
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)

Private Member Functions

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.
void build_local_multipoint ()
 Builds a local or multipoint approximation using actualModel.
void update_actual_model ()
 update actualModel with data from current variables/labels/bounds/targets
void update_from_actual_model ()
 update current variables/labels/bounds/targets with data from actualModel
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 surrModelEvals
 number of calls to derived_compute_response()/ derived_asynch_compute_response()
int pointsTotal
 total points the user specified to construct the surrogate
bool pointsMinimum
 user wishes to use minimum points to construct the surrogate
bool pointsRecommended
 user wishes to use recommended points to construct the surrogate
String pointReuse
 type of point reuse for approximation builds: all, region (default if points file), or none (default if no points file)
String pointReuseFile
 file name for points_file specification
VariablesList reuseFileVars
 array of variables sets read from the points_file
ResponseList reuseFileResponses
 array of response sets read from the 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)
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.


Member Function Documentation

void derived_compute_response ( const ActiveSet set) [protected, virtual]
void derived_asynch_compute_response ( const ActiveSet set) [protected, virtual]
const IntResponseMap & derived_synchronize ( ) [protected, virtual]

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_asynch_compute_response() 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(), DataFitSurrModel::derived_synchronize_approx(), SurrogateModel::response_mapping(), SurrogateModel::surrIdMap, SurrogateModel::surrResponseMap, Interface::synch(), Model::synchronize(), and SurrogateModel::truthIdMap.

const IntResponseMap & derived_synchronize_nowait ( ) [protected, virtual]

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_asynch_compute_response() may be inconsistent in its use of actual evals, approx evals, or both.

Reimplemented from Model.

References DataFitSurrModel::actualModel, DataFitSurrModel::approxInterface, SurrogateModel::cachedApproxRespMap, DataFitSurrModel::component_parallel_mode(), DataFitSurrModel::derived_synchronize_approx(), SurrogateModel::response_mapping(), SurrogateModel::surrIdMap, SurrogateModel::surrResponseMap, Interface::synch_nowait(), Model::synchronize_nowait(), and SurrogateModel::truthIdMap.

void build_approximation ( ) [protected, virtual]
bool build_approximation ( const Variables vars,
const Response response 
) [protected, virtual]

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

This function constructs a new approximation, discarding any previous data. It uses the passed data to populate the anchorPoint and constructs any required currentPoints.

Reimplemented from Model.

References DataFitSurrModel::actualModel, SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Interface::build_approximation(), DataFitSurrModel::build_global(), Interface::clear_current(), Model::continuous_lower_bounds(), Constraints::continuous_lower_bounds(), Model::continuous_upper_bounds(), Constraints::continuous_upper_bounds(), Model::is_null(), Model::surrogateType, DataFitSurrModel::update_actual_model(), Interface::update_approximation(), DataFitSurrModel::update_global(), DataFitSurrModel::update_local_multipoint(), and Model::userDefinedConstraints.

void update_approximation ( bool  rebuild_flag) [protected, virtual]

replaces the aproximation data and rebuilds the approximation if requested

This function populates/replaces Approximation::anchorPoint and rebuilds the approximation, if requested. It does not clear other data (i.e., Approximation::currentPoints) 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, Interface::rebuild_approximation(), Model::surrogateType, and Interface::update_approximation().

void update_approximation ( const Variables vars,
const Response response,
bool  rebuild_flag 
) [protected, virtual]

replaces the anchor point, and rebuilds the approximation if requested

This function populates/replaces Approximation::anchorPoint and rebuilds the approximation, if requested. It does not clear other data (i.e., Approximation::currentPoints) 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 Response::active_set_request_vector(), DataFitSurrModel::actualModel, SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Interface::build_approximation(), Model::continuous_lower_bounds(), Constraints::continuous_lower_bounds(), Model::continuous_upper_bounds(), Constraints::continuous_upper_bounds(), Model::is_null(), Model::numFns, Model::surrogateType, Interface::update_approximation(), and Model::userDefinedConstraints.

void update_approximation ( const VariablesArray &  vars_array,
const ResponseArray &  resp_array,
bool  rebuild_flag 
) [protected, virtual]

replaces the current points array and rebuilds the approximation if requested

This function populates/replaces Approximation::currentPoints and rebuilds the approximation, if requested. It does not clear other data (i.e., Approximation::anchorPoint) 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 DataFitSurrModel::actualModel, SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Interface::build_approximation(), Model::continuous_lower_bounds(), Constraints::continuous_lower_bounds(), Model::continuous_upper_bounds(), Constraints::continuous_upper_bounds(), Model::is_null(), Model::numFns, Model::surrogateType, Interface::update_approximation(), and Model::userDefinedConstraints.

void append_approximation ( bool  rebuild_flag) [protected, virtual]

appends data to a global approximation and rebuilds it if requested

This function appends one point to Approximation::currentPoints and rebuilds the approximation, if requested. It does not modify other data (i.e., Approximation::anchorPoint) 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, Interface::rebuild_approximation(), and Model::surrogateType.

void append_approximation ( const Variables vars,
const Response response,
bool  rebuild_flag 
) [protected, virtual]

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

This function appends one point to Approximation::currentPoints and rebuilds the approximation, if requested. It does not modify other data (i.e., Approximation::anchorPoint) 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 Response::active_set_request_vector(), DataFitSurrModel::actualModel, Interface::append_approximation(), SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Interface::build_approximation(), Model::continuous_lower_bounds(), Constraints::continuous_lower_bounds(), Model::continuous_upper_bounds(), Constraints::continuous_upper_bounds(), Model::is_null(), Model::numFns, Model::surrogateType, and Model::userDefinedConstraints.

void append_approximation ( const VariablesArray &  vars_array,
const ResponseArray &  resp_array,
bool  rebuild_flag 
) [protected, virtual]

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

This function appends multiple points to Approximation::currentPoints and rebuilds the approximation, if requested. It does not modify other data (i.e., Approximation::anchorPoint) 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 DataFitSurrModel::actualModel, Interface::append_approximation(), SurrogateModel::approxBuilds, DataFitSurrModel::approxInterface, Interface::build_approximation(), Model::continuous_lower_bounds(), Constraints::continuous_lower_bounds(), Model::continuous_upper_bounds(), Constraints::continuous_upper_bounds(), Model::is_null(), Model::numFns, Model::surrogateType, and Model::userDefinedConstraints.

void derived_init_communicators ( const int &  max_iterator_concurrency,
bool  recurse_flag = true 
) [inline, protected, virtual]

set up actualModel for parallel operations

asynchronous flags need to be initialized for the sub-models. In addition, max_iterator_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(), Model::init_communicators(), Iterator::is_null(), Model::is_null(), Iterator::maximum_concurrency(), and Interface::minimum_points().

int evaluation_id ( ) const [inline, protected, virtual]

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::surrModelEvals.

void build_global ( ) [private]
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().

Referenced by DataFitSurrModel::build_approximation(), DataFitSurrModel::derived_asynch_compute_response(), and DataFitSurrModel::derived_compute_response().

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

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: