NOMAD Source
Version 4.0.0 Beta
|
Class for barrier following algorithm 12.2 of DFBO. More...
#include <Barrier.hpp>
Public Member Functions | |
Barrier (const Double &hMax=INF, const Point &fixedVariable=Point()) | |
Constructor. More... | |
const std::vector< EvalPointPtr > | getAllXFeas () const |
Get all feasible points in the barrier. More... | |
EvalPointPtr | getFirstXFeas () const |
Get the first feasible points in the barrier. More... | |
size_t | nbXFeas () const |
Number of feasible points in the barrier. More... | |
void | addXFeas (const EvalPointPtr &xFeas) |
Add a feasible point in the barrier. More... | |
void | clearXFeas () |
Remove feasible points from the barrier. More... | |
const std::vector< EvalPointPtr > | getAllXInf () const |
Get all infeasible points in the barrier. More... | |
EvalPointPtr | getFirstXInf () const |
Get the first infeasible points in the barrier. More... | |
size_t | nbXInf () const |
Number of infeasible points in the barrier. More... | |
void | addXInf (const EvalPointPtr &xInf) |
Add an infeasible point in the barrier. More... | |
void | clearXInf () |
Remove infeasible points from the barrier. More... | |
std::vector< NOMAD::EvalPointPtr > | getAllPoints () |
Double | getHMax () const |
Get the current hMax of the barrier. More... | |
void | setHMax (const Double &hMax) |
Set the hMax of the barrier. More... | |
std::string | display () const |
Return the barrier as a string. More... | |
Private Member Functions | |
void | init (const Point &fixedVariable) |
Helper function for constructor. More... | |
void | checkCache () |
Helper function for init/constructor. More... | |
void | checkXFeas () |
Helper function for insertion. More... | |
void | checkXFeasIsFeas () |
Helper function for insertion. More... | |
void | checkXInf () |
Helper function for insertion. More... | |
void | checkHMax () |
Helper function for init/setHMax. More... | |
Private Attributes | |
std::vector< EvalPointPtr > | _xFeas |
Current feasible incumbent solutions. More... | |
std::vector< EvalPointPtr > | _xInf |
Current infeasible incumbent solutions. More... | |
Double | _hMax |
Maximum acceptable value for h. More... | |
Class for barrier following algorithm 12.2 of DFBO.
Definition at line 10 of file Barrier.hpp.
Constructor.
hMax will be updated during optimization.
hMax | The max of h to keep a point in the barrier – IN. |
fixedVariable | The fixed variables have a fixed value – IN. |
Definition at line 27 of file Barrier.hpp.
void Barrier::addXFeas | ( | const EvalPointPtr & | xFeas | ) |
Add a feasible point in the barrier.
If the point is feasible it is added, if not an exception is triggered.
xFeas | The eval point to add – IN. |
void Barrier::addXInf | ( | const EvalPointPtr & | xInf | ) |
Add an infeasible point in the barrier.
If the point is nullptr an exception is triggered.
xInf | The eval point to add – IN. |
|
private |
Helper function for init/constructor.
Throw an exception if the Cache has not been instanciated yet. Will remain silent otherwise.
|
private |
Helper function for init/setHMax.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
|
private |
Helper function for insertion.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
|
private |
Helper function for insertion.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
|
private |
Helper function for insertion.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
void Barrier::clearXFeas | ( | ) |
Remove feasible points from the barrier.
void Barrier::clearXInf | ( | ) |
Remove infeasible points from the barrier.
std::string Barrier::display | ( | ) | const |
Return the barrier as a string.
std::vector<NOMAD::EvalPointPtr> Barrier::getAllPoints | ( | ) |
|
inline |
Get all feasible points in the barrier.
Definition at line 37 of file Barrier.hpp.
|
inline |
Get all infeasible points in the barrier.
Definition at line 65 of file Barrier.hpp.
EvalPointPtr Barrier::getFirstXFeas | ( | ) | const |
Get the first feasible points in the barrier.
If there is no feasible point, return a nullptr
EvalPointPtr Barrier::getFirstXInf | ( | ) | const |
Get the first infeasible points in the barrier.
If there is no infeasible point, return a nullptr
|
inline |
|
private |
Helper function for constructor.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
fixedVariable | The fixed variables have a fixed value – IN. |
|
inline |
Number of feasible points in the barrier.
Definition at line 48 of file Barrier.hpp.
|
inline |
Number of infeasible points in the barrier.
Definition at line 76 of file Barrier.hpp.
void Barrier::setHMax | ( | const Double & | hMax | ) |
Set the hMax of the barrier.
hMax | The hMax – IN. |
|
private |
Maximum acceptable value for h.
Definition at line 17 of file Barrier.hpp.
|
private |
Current feasible incumbent solutions.
Definition at line 14 of file Barrier.hpp.
|
private |
Current infeasible incumbent solutions.
Definition at line 15 of file Barrier.hpp.