Dakota  Version
Explore and Predict with Confidence
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
JEGAOptimizer::Evaluator Class Reference

An evaluator specialization that knows how to interact with Dakota. More...

Inherits GeneticAlgorithmEvaluator.

Public Member Functions

virtual bool Evaluate (DesignGroup &group)
 Does evaluation of each design in group. More...
 
virtual bool Evaluate (Design &des)
 This method cannot be used!! More...
 
virtual std::string GetName () const
 Returns the proper name of this operator. More...
 
virtual std::string GetDescription () const
 Returns a full description of what this operator does and how. More...
 
virtual GeneticAlgorithmOperator * Clone (GeneticAlgorithm &algorithm) const
 Creates and returns a pointer to an exact duplicate of this operator. More...
 
 Evaluator (GeneticAlgorithm &algorithm, Model &model)
 Constructs a Evaluator for use by algorithm. More...
 
 Evaluator (const Evaluator &copy)
 Copy constructs a Evaluator. More...
 
 Evaluator (const Evaluator &copy, GeneticAlgorithm &algorithm, Model &model)
 Copy constructs a Evaluator for use by algorithm. More...
 

Static Public Member Functions

static const std::string & Name ()
 Returns the proper name of this operator. More...
 
static const std::string & Description ()
 Returns a full description of what this operator does and how. More...
 

Protected Member Functions

void SeparateVariables (const Design &from, RealVector &intoCont, IntVector &intoDiscInt, RealVector &intoDiscReal, StringMultiArray &intoDiscString) const
 This method fills intoCont, intoDiscInt and intoDiscReal appropriately using the values of from. More...
 
void RecordResponses (const RealVector &from, Design &into) const
 Records the computed objective and constraint function values into into. More...
 
std::size_t GetNumberNonLinearConstraints () const
 Returns the number of non-linear constraints for the problem. More...
 
std::size_t GetNumberLinearConstraints () const
 Returns the number of linear constraints for the problem. More...
 

Private Member Functions

 Evaluator (GeneticAlgorithm &algorithm)
 This constructor has no implementation and cannot be used. More...
 

Private Attributes

Model_model
 The Model known by this evaluator. More...
 

Detailed Description

An evaluator specialization that knows how to interact with Dakota.

This evaluator knows how to use the model to do evaluations both in synchronous and asynchronous modes.

Constructor & Destructor Documentation

◆ Evaluator() [1/4]

Evaluator ( GeneticAlgorithm &  algorithm,
Model model 
)
inline

Constructs a Evaluator for use by algorithm.

The optimizer is needed for purposes of variable scaling.

Parameters
algorithmThe GA for which the new evaluator is to be used.
modelThe model through which evaluations will be done.

◆ Evaluator() [2/4]

Evaluator ( const Evaluator copy)
inline

Copy constructs a Evaluator.

Parameters
copyThe evaluator from which properties are to be duplicated into this.

◆ Evaluator() [3/4]

Evaluator ( const Evaluator copy,
GeneticAlgorithm &  algorithm,
Model model 
)
inline

Copy constructs a Evaluator for use by algorithm.

The optimizer is needed for purposes of variable scaling.

Parameters
copyThe existing Evaluator from which to retrieve properties.
algorithmThe GA for which the new evaluator is to be used.
modelThe model through which evaluations will be done.

◆ Evaluator() [4/4]

Evaluator ( GeneticAlgorithm &  algorithm)
private

This constructor has no implementation and cannot be used.

This constructor can never be used. It is provided so that this operator can still be registered in an operator registry even though it can never be instantiated from there.

Parameters
algorithmThe GA for which the new evaluator is to be used.

Member Function Documentation

◆ Name()

static const std::string& Name ( )
inlinestatic

Returns the proper name of this operator.

Returns
The string "DAKOTA JEGA Evaluator".

◆ Description()

static const std::string& Description ( )
inlinestatic

Returns a full description of what this operator does and how.

The returned text is:

 This evaluator uses Sandia's DAKOTA optimization
 software to evaluate the passed in Designs.  This
 makes it possible to take advantage of the fact that
 DAKOTA is designed to run on massively parallel machines.

.

Returns
A description of the operation of this operator.

◆ SeparateVariables()

void SeparateVariables ( const Design &  from,
RealVector &  intoCont,
IntVector &  intoDiscInt,
RealVector &  intoDiscReal,
StringMultiArray &  intoDiscString 
) const
protected

This method fills intoCont, intoDiscInt and intoDiscReal appropriately using the values of from.

The discrete integer design variable values are placed in intoDiscInt, the discrete real design variable values are placed in intoDiscReal, and the continuum are placed into intoCont. The values are written into the vectors from the beginning so any previous contents of the vectors will be overwritten.

Parameters
fromThe Design class object from which to extract the discrete design variable values.
intoDiscIntThe vector into which to place the extracted discrete integer values.
intoDiscRealThe vector into which to place the extracted discrete real values.
intoContThe vector into which to place the extracted continuous values.

References JEGAOptimizer::Evaluator::_model, Model::cv(), Model::discrete_int_sets(), Model::discrete_set_string_values(), Model::div(), Model::drv(), Model::dsv(), and Dakota::set_index_to_value().

◆ RecordResponses()

void RecordResponses ( const RealVector &  from,
Design &  into 
) const
protected

Records the computed objective and constraint function values into into.

This method takes the response values stored in from and properly transfers them into the into design.

The response vector from is expected to contain values for each objective function followed by values for each non-linear constraint in the order in which the info objects were loaded into the target by the optimizer class.

Parameters
fromThe vector of responses to install into into.
intoThe Design to which the responses belong and into which they must be written.

◆ GetNumberNonLinearConstraints()

std::size_t GetNumberNonLinearConstraints ( ) const
inlineprotected

Returns the number of non-linear constraints for the problem.

This is computed by adding the number of non-linear equality constraints to the number of non-linear inequality constraints. These values are obtained from the model.

Returns
The total number of non-linear constraints.

References Model::num_nonlinear_eq_constraints(), and Model::num_nonlinear_ineq_constraints().

◆ GetNumberLinearConstraints()

std::size_t GetNumberLinearConstraints ( ) const
inlineprotected

Returns the number of linear constraints for the problem.

This is computed by adding the number of linear equality constraints to the number of linear inequality constraints. These values are obtained from the model.

Returns
The total number of linear constraints.

References Model::num_linear_eq_constraints(), and Model::num_linear_ineq_constraints().

◆ Evaluate() [1/2]

bool Evaluate ( DesignGroup &  group)
virtual

Does evaluation of each design in group.

This method uses the Model known by this class to get Designs evaluated. It properly formats the Design class information in a way that Dakota will understand and then interprets the Dakota results and puts them back into the Design class object. It respects the asynchronous flag in the Model so evaluations may occur synchronously or asynchronously.

Prior to evaluating a Design, this class checks to see if it is marked as already evaluated. If it is, then the evaluation of that Design is not carried out. This is not strictly necessary because Dakota keeps track of evaluated designs and does not re-evaluate. An exception is the case of a population read in from a file complete with responses where Dakota is unaware of the evaluations.

Parameters
groupThe group of Design class objects to be evaluated.
Returns
true if all evaluations completed and false otherwise.

◆ Evaluate() [2/2]

virtual bool Evaluate ( Design &  des)
inlinevirtual

This method cannot be used!!

This method does nothing and cannot be called. This is because in the case of asynchronous evaluation, this method would be unable to conform. It would require that each evaluation be done in a synchronous fashion.

Parameters
desA Design that would be evaluated if this method worked.
Returns
Would return true if the Design were evaluated and false otherwise. Never actually returns here. Issues a fatal error. Otherwise, it would always return false.

◆ GetName()

virtual std::string GetName ( ) const
inlinevirtual

Returns the proper name of this operator.

Returns
See Name().

◆ GetDescription()

virtual std::string GetDescription ( ) const
inlinevirtual

Returns a full description of what this operator does and how.

Returns
See Description().

◆ Clone()

virtual GeneticAlgorithmOperator* Clone ( GeneticAlgorithm &  algorithm) const
inlinevirtual

Creates and returns a pointer to an exact duplicate of this operator.

Parameters
algorithmThe GA for which the clone is being created.
Returns
A clone of this operator.

Member Data Documentation

◆ _model

Model& _model
private

The Model known by this evaluator.

It is through this model that evaluations will take place.

Referenced by JEGAOptimizer::Evaluator::SeparateVariables().


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