NOMAD Source
Version 4.0.0 Beta
|
Class for the representation of an evaluation point. More...
#include <EvalPoint.hpp>
Public Member Functions | |
EvalPoint () | |
Constructor #1. More... | |
EvalPoint (size_t n) | |
Constructor #2. More... | |
EvalPoint (const Point &x) | |
Constructor #3. More... | |
EvalPoint (const EvalPoint &evalPoint) | |
Copy constructor. More... | |
EvalPoint & | operator= (const EvalPoint &evalPoint) |
Affectation operator. More... | |
virtual | ~EvalPoint () |
Destructor. More... | |
const Point * | getX () const |
Eval * | getEval (const bool useSgte=false) const |
Get the evaluation of the true or the surrogate blackbox evaluation. More... | |
void | setEval (const Eval &eval, const bool useSgte=false) |
Set the evaluation of the true or the surrogate blackbox evaluation. More... | |
void | clearEvalSgte () |
Clear the surrogate blackbox evaluation of *this . More... | |
Double | getF (const bool useSgte=false) const |
Get the objective function value of the the true or the surrogate blackbox evaluation. More... | |
void | setF (const Double f, const bool useSgte=false) |
Set the objective function value of the true or the surrogate blackbox evaluation. More... | |
Double | getH (const bool useSgte=false) const |
Get the infeasibility measure of the true or the surrogate blackbox evaluation. More... | |
void | setH (const Double &h, const bool useSgte=false) |
Set the infeasibility measure of the true or the surrogate blackbox evaluation. More... | |
std::string | getBBO (const bool useSgte=false) const |
Get the true or surrogate blackbox output as a string . More... | |
void | setBBO (const std::string &bbo, const BBOutputTypeList &bboutputtypes, const bool useSgte=false, const bool evalOk=true) |
Set the true or surrogate blackbox output from a string . More... | |
void | setBBO (const std::string &bbo, const std::string &sBBOutputTypes, const bool useSgte=false, const bool evalOk=true) |
Set the true or surrogate blackbox output from a string . More... | |
void | setBBO (const BBOutput bbo, const bool useSgte=false, const bool evalOk=true) |
Set the true or surrogate blackbox output. More... | |
EvalStatusType | getEvalStatus (const bool useSgte=false) const |
Get evaluation status of the true or the surrogate blackbox evaluation. More... | |
void | setEvalStatus (const EvalStatusType &evalStatus, const bool useSgte=false) |
Set evaluation status of the true or the surrogate blackbox evaluation. More... | |
short | getNumberEval () const |
void | setNumberEval (const short numEval) |
void | incNumberEval () |
const std::shared_ptr< Point > | getPointFrom () const |
Get the from point EvalPoint::_pointFrom. More... | |
const std::shared_ptr< Point > | getPointFrom (const Point &fixedVariable) const |
Get the EvalPoint::_pointFrom. More... | |
void | setPointFrom (const std::shared_ptr< Point > pointFrom) |
Set the from point EvalPoint::_pointFrom. More... | |
void | setPointFrom (std::shared_ptr< Point > pointFrom, const Point &fixedVariable) |
Set the from point EvalPoint::_pointFrom . The from point. More... | |
bool | isFeasible (const bool useSgte=false) const |
Get evaluation feasibility flag of the true or the surrogate blackbox evaluation. More... | |
void | recomputeFH (const BBOutputTypeList &bbOutputType) |
Recompute f and h, for a given list of blackbox output type considering that raw blackbox output is set. More... | |
bool | dominates (const EvalPoint &rhs) const |
Comparison operator used by NM algorithm. More... | |
bool | isBetterThan (const EvalPoint &rhs) const |
Comparison operator (used by NM). More... | |
EvalPoint | makeFullSpacePointFromFixed (const Point &fixedVariable) const |
Convert a point from sub space to full space using fixed variables. More... | |
EvalPoint | makeSubSpacePointFromFixed (const Point &fixedVariable) const |
Convert a point from full space to sub space using fixed variables. More... | |
bool | operator== (const EvalPoint &evalPoint) const |
Comparison operator == . More... | |
bool | operator!= (const EvalPoint &evalPoint) const |
Comparison operator != . More... | |
bool | operator< (const EvalPoint &x) const |
Comparison operator < , used for set ordering. More... | |
bool | isEvalOk (const bool useSgte=false) const |
std::string | display (const ArrayOfDouble &format=ArrayOfDouble()) const override |
Display with or without format. More... | |
std::string | displayAll () const |
Display both true and surrogate evaluations. Useful for debugging. More... | |
bool | toEval (short maxPointEval, const bool useSgte=false) const |
Function to test if evaluation is required. More... | |
bool | isDefined () const override |
![]() | |
Point (const size_t n=0, const Double &val=Double()) | |
Point (const Point &pt) | |
Copy constructors. More... | |
const Point & | operator= (const Point &pt) |
Assignment operator. More... | |
const Point & | operator= (const ArrayOfDouble &aod) |
Assignment operator. More... | |
virtual | ~Point () |
Destructor. More... | |
std::string | display (const ArrayOfDouble &prec=ArrayOfDouble()) const override |
Formated Point display. More... | |
std::string | displayNoPar (const ArrayOfDouble &prec=ArrayOfDouble()) const |
Formated Point display. More... | |
bool | operator< (const Point &point __attribute__((unused))) const |
Comparison operator < . More... | |
Point | operator+ (const Direction &dir) const |
Addition Point = Point + Direction. More... | |
Point | makeFullSpacePointFromFixed (const Point &fixedVariable) const |
Convert a point from sub space to full space using fixed variables. More... | |
Point | makeSubSpacePointFromFixed (const Point &fixedVariable) const |
Convert a point from full space to sub space using fixed variables. More... | |
bool | hasFixed (const Point &fixedVariable) const |
Verify if a Point is part of the sub-space defined by fixed variable. More... | |
![]() | |
ArrayOfDouble (const size_t n=0, const Double &val=Double()) | |
Constructor. More... | |
ArrayOfDouble (const ArrayOfDouble &coords) | |
Copy constructor. More... | |
const ArrayOfDouble & | operator= (const ArrayOfDouble &coords) |
Affectation operator. More... | |
virtual | ~ArrayOfDouble () |
Destructor. More... | |
Double & | operator[] (size_t i) const |
Operator []. More... | |
size_t | size () const |
Access to the dimension of the array. More... | |
void | reset (size_t n=0, const Double &d=Double()) |
Change the ArrayOfDouble dimension, and set all coordinates to d. More... | |
void | resize (size_t n, const Double &d=Double()) |
Change the dimensionof the array. The values are kept. More... | |
bool | isEmpty () const |
Test if empty. More... | |
void | set (const Double &d) const |
Set all the coordinates to a specific value. More... | |
void | set (size_t index, const Double &d, bool relative=false, const Double &lb=Double(), const Double &ub=Double()) |
void | set (size_t n, const Double *a) |
Set the coordinates with an array of reals. More... | |
bool | isComplete () const |
Check if all the coordinates are defined. More... | |
size_t | nbDefined () const |
Count the number of defined values. More... | |
bool | toBeDefined () const |
void | snapToBounds (const ArrayOfDouble &lb, const ArrayOfDouble &ub, const ArrayOfDouble &frameCenter, const ArrayOfDouble &meshSize) |
Snap an array to the bounds. Remain on mesh centered on frameCenter. More... | |
void | readValuesAsArray (const ArrayOfString &valueString) |
Read values and fill the array with corresponding double values. More... | |
Double | max () const |
Return max of all defined values. More... | |
const ArrayOfDouble & | operator*= (const Double &d) |
Mutiplication with a scalar. More... | |
const ArrayOfDouble | operator+ (const ArrayOfDouble &p) const |
Addition with another array. More... | |
const ArrayOfDouble | operator- (const ArrayOfDouble &p) const |
Substraction with an other array. More... | |
bool | isMultipleOf (const ArrayOfDouble &gran, int &index) const |
bool | operator== (const ArrayOfDouble &coords) const |
Comparison operator == . More... | |
bool | operator!= (const ArrayOfDouble &coords) const |
Comparison operator != . More... | |
virtual bool | operator<= (const ArrayOfDouble &coords) const |
Comparison operator <= . More... | |
virtual bool | operator< (const ArrayOfDouble &coords) const |
Comparison operator < . More... | |
Static Public Member Functions | |
static void | clearEvalSgte (EvalPoint &evalPoint) |
Clear the surrogate blackbox evaluation of a point. More... | |
![]() | |
static bool | weakLess (const Point &lhs, const Point &rhs) |
Weak comparison operator. More... | |
static Double | dist (const Point &X, const Point &Y) |
Euclidean distance between two points. More... | |
static Direction | vectorize (const Point &X, const Point &Y) |
Create a Direction by substracting 2 Points . More... | |
Static Public Attributes | |
static const std::string | ptFrom |
Static string "<", used for indicating pointFrom in I/O. More... | |
![]() | |
static const std::string | pStart |
Static variable used for array delimitation. More... | |
static const std::string | pEnd |
Static variable used for array delimitation. More... | |
Private Member Functions | |
void | copyMembers (const EvalPoint &evalPoint) |
Helper for copy constructor and others. More... | |
Private Attributes | |
EvalUPtr | _eval |
Value of the evaluation (truth / blackbox) More... | |
EvalUPtr | _evalSgte |
Value of the surrogate evaluation. More... | |
short | _numberEval |
Number of times *this point has been evaluated (blackbox only) More... | |
std::shared_ptr< Point > | _pointFrom |
The frame center which generated *this point (blackbox only) More... | |
Additional Inherited Members | |
![]() | |
void | verifySizesMatch (size_t n1, size_t n2, std::string filename, size_t linenum) const |
Helper function to verify that n1 == n2. More... | |
void | compare (const ArrayOfDouble &aod, bool &isInf, bool &isStrictInf) const |
Helper function to compare arrays. More... | |
![]() | |
size_t | _n |
Dimension of the array. More... | |
Double * | _array |
Values of the array. More... | |
Class for the representation of an evaluation point.
An evaluation point gathers the point coordinates x
, and the blackbox outputs at these coordinates f(x)
.
Definition at line 29 of file EvalPoint.hpp.
|
explicit |
Constructor #1.
|
explicit |
Constructor #2.
n | Number of variables – IN. |
|
explicit |
Constructor #3.
x | Coordinates of the eval point – IN. |
EvalPoint::EvalPoint | ( | const EvalPoint & | evalPoint | ) |
Copy constructor.
evalPoint | The copied object – IN. |
|
virtual |
Destructor.
|
inline |
Clear the surrogate blackbox evaluation of *this
.
Definition at line 102 of file EvalPoint.hpp.
|
inlinestatic |
Clear the surrogate blackbox evaluation of a point.
Definition at line 105 of file EvalPoint.hpp.
|
private |
Helper for copy constructor and others.
|
overridevirtual |
Display with or without format.
Reimplemented from ArrayOfDouble.
std::string EvalPoint::displayAll | ( | ) | const |
Display both true and surrogate evaluations. Useful for debugging.
bool EvalPoint::dominates | ( | const EvalPoint & | rhs | ) | const |
Comparison operator used by NM algorithm.
rhs | Second eval points to compare – IN. |
true
if *this
dominates x. std::string EvalPoint::getBBO | ( | const bool | useSgte = false | ) | const |
Get the true or surrogate blackbox output as a string
.
|
inline |
Get the evaluation of the true or the surrogate blackbox evaluation.
Definition at line 96 of file EvalPoint.hpp.
EvalStatusType EvalPoint::getEvalStatus | ( | const bool | useSgte = false | ) | const |
Get evaluation status of the true or the surrogate blackbox evaluation.
Double EvalPoint::getF | ( | const bool | useSgte = false | ) | const |
Get the objective function value of the the true or the surrogate blackbox evaluation.
Double EvalPoint::getH | ( | const bool | useSgte = false | ) | const |
Get the infeasibility measure of the true or the surrogate blackbox evaluation.
|
inline |
Definition at line 163 of file EvalPoint.hpp.
|
inline |
Get the from point EvalPoint::_pointFrom.
Definition at line 168 of file EvalPoint.hpp.
Get the EvalPoint::_pointFrom.
Get a new from point if a fixedVariable is provided.
|
inline |
Definition at line 93 of file EvalPoint.hpp.
|
inline |
Definition at line 165 of file EvalPoint.hpp.
bool EvalPoint::isBetterThan | ( | const EvalPoint & | rhs | ) | const |
Comparison operator (used by NM).
rhs | The right-hand side object – IN. |
true
if lhs
is better than rhs.
|
inlineoverridevirtual |
Reimplemented from ArrayOfDouble.
Definition at line 270 of file EvalPoint.hpp.
bool EvalPoint::isEvalOk | ( | const bool | useSgte = false | ) | const |
bool EvalPoint::isFeasible | ( | const bool | useSgte = false | ) | const |
Get evaluation feasibility flag of the true or the surrogate blackbox evaluation.
Convert a point from sub space to full space using fixed variables.
*this
is unchanged. Convert a point from full space to sub space using fixed variables.
*this
is unchanged.
|
inline |
Comparison operator !=
.
evalPoint | The right-hand side object – IN. |
false
if *this
==
p
, true
if not. Definition at line 234 of file EvalPoint.hpp.
bool EvalPoint::operator< | ( | const EvalPoint & | x | ) | const |
Comparison operator <
, used for set ordering.
x | Right-hand side object – IN. |
true
if *this
<
x
, false
if not.. Affectation operator.
evalPoint | The right-hand side object – IN. |
*this
as the result of the affectation. bool EvalPoint::operator== | ( | const EvalPoint & | evalPoint | ) | const |
Comparison operator ==
.
evalPoint | The right-hand side object – IN. |
true
if *this
==
p
, false
if not. void EvalPoint::recomputeFH | ( | const BBOutputTypeList & | bbOutputType | ) |
Recompute f and h, for a given list of blackbox output type considering that raw blackbox output is set.
bbOutputType | The list of blackbox output types. |
void EvalPoint::setBBO | ( | const std::string & | bbo, |
const BBOutputTypeList & | bboutputtypes, | ||
const bool | useSgte = false , |
||
const bool | evalOk = true |
||
) |
Set the true or surrogate blackbox output from a string
.
bbo | The string containg the raw result of the blackbox evaluation – IN. |
bboutputtypes | The list of blackbox output types – IN. |
useSgte | Flag for true or surrogate evaluation – IN. |
evalOk | Flag for evaluation status – IN. |
void EvalPoint::setBBO | ( | const std::string & | bbo, |
const std::string & | sBBOutputTypes, | ||
const bool | useSgte = false , |
||
const bool | evalOk = true |
||
) |
Set the true or surrogate blackbox output from a string
.
bbo | The string containg the raw result of the blackbox evaluation – IN. |
sBBOutputTypes | The blackbox output types coded as a single string – IN. |
useSgte | Flag for true or surrogate evaluation – IN. |
evalOk | Flag for evaluation status – IN. |
void EvalPoint::setBBO | ( | const BBOutput | bbo, |
const bool | useSgte = false , |
||
const bool | evalOk = true |
||
) |
Set the true or surrogate blackbox output.
bbo | A blackbox evaluation output – IN. |
useSgte | Flag for true or surrogate evaluation – IN. |
evalOk | Flag for evaluation status – IN. |
void EvalPoint::setEval | ( | const Eval & | eval, |
const bool | useSgte = false |
||
) |
Set the evaluation of the true or the surrogate blackbox evaluation.
void EvalPoint::setEvalStatus | ( | const EvalStatusType & | evalStatus, |
const bool | useSgte = false |
||
) |
Set evaluation status of the true or the surrogate blackbox evaluation.
void EvalPoint::setF | ( | const Double | f, |
const bool | useSgte = false |
||
) |
Set the objective function value of the true or the surrogate blackbox evaluation.
void EvalPoint::setH | ( | const Double & | h, |
const bool | useSgte = false |
||
) |
Set the infeasibility measure of the true or the surrogate blackbox evaluation.
|
inline |
Definition at line 164 of file EvalPoint.hpp.
void EvalPoint::setPointFrom | ( | const std::shared_ptr< Point > | pointFrom | ) |
Set the from point EvalPoint::_pointFrom.
Set the from point EvalPoint::_pointFrom . The from point.
bool EvalPoint::toEval | ( | short | maxPointEval, |
const bool | useSgte = false |
||
) | const |
Function to test if evaluation is required.
Depending on the status of the Eval, should we evaluate (possibly re-evaluate) this point?
maxPointEval | The maximum number of point evaluations – IN. |
useSgte | Use true or surrogate evaluation. |
true
if evaluation is required and false
otherwise.
|
private |
Value of the evaluation (truth / blackbox)
Definition at line 36 of file EvalPoint.hpp.
|
private |
Value of the surrogate evaluation.
Definition at line 39 of file EvalPoint.hpp.
|
private |
Number of times *this
point has been evaluated (blackbox only)
Definition at line 42 of file EvalPoint.hpp.
|
private |
The frame center which generated *this
point (blackbox only)
Definition at line 44 of file EvalPoint.hpp.
|
static |
Static string "<", used for indicating pointFrom in I/O.
Definition at line 32 of file EvalPoint.hpp.