NOMAD Source  Version 4.0.0 Beta
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Barrier Class Reference

Class for barrier following algorithm 12.2 of DFBO. More...

#include <Barrier.hpp>

Collaboration diagram for Barrier:

Public Member Functions

 Barrier (const Double &hMax=INF, const Point &fixedVariable=Point())
 Constructor. More...
 
const std::vector< EvalPointPtrgetAllXFeas () 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< EvalPointPtrgetAllXInf () 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::EvalPointPtrgetAllPoints ()
 
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...
 

Detailed Description

Class for barrier following algorithm 12.2 of DFBO.

Definition at line 10 of file Barrier.hpp.

Constructor & Destructor Documentation

Barrier::Barrier ( const Double hMax = INF,
const Point fixedVariable = Point() 
)
inline

Constructor.

hMax will be updated during optimization.

Parameters
hMaxThe max of h to keep a point in the barrier – IN.
fixedVariableThe fixed variables have a fixed value – IN.

Definition at line 27 of file Barrier.hpp.

29  : _xFeas(),
30  _xInf(),
31  _hMax(hMax)
32  {
33  init(fixedVariable);
34  }
void init(const Point &fixedVariable)
Helper function for constructor.
std::vector< EvalPointPtr > _xFeas
Current feasible incumbent solutions.
Definition: Barrier.hpp:14
Double _hMax
Maximum acceptable value for h.
Definition: Barrier.hpp:17
std::vector< EvalPointPtr > _xInf
Current infeasible incumbent solutions.
Definition: Barrier.hpp:15

Member Function Documentation

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.

Parameters
xFeasThe 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.

Parameters
xInfThe eval point to add – IN.
void Barrier::checkCache ( )
private

Helper function for init/constructor.

Throw an exception if the Cache has not been instanciated yet. Will remain silent otherwise.

void Barrier::checkHMax ( )
private

Helper function for init/setHMax.

Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.

void Barrier::checkXFeas ( )
private

Helper function for insertion.

Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.

void Barrier::checkXFeasIsFeas ( )
private

Helper function for insertion.

Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.

void Barrier::checkXInf ( )
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 ( )
const std::vector<EvalPointPtr> Barrier::getAllXFeas ( ) const
inline

Get all feasible points in the barrier.

Definition at line 37 of file Barrier.hpp.

37 { return _xFeas; }
std::vector< EvalPointPtr > _xFeas
Current feasible incumbent solutions.
Definition: Barrier.hpp:14
const std::vector<EvalPointPtr> Barrier::getAllXInf ( ) const
inline

Get all infeasible points in the barrier.

Returns
All the eval points that are infeasible.

Definition at line 65 of file Barrier.hpp.

65 { return _xInf; }
std::vector< EvalPointPtr > _xInf
Current infeasible incumbent solutions.
Definition: Barrier.hpp:15
EvalPointPtr Barrier::getFirstXFeas ( ) const

Get the first feasible points in the barrier.

If there is no feasible point, return a nullptr

Returns
A single feasible eval point.
EvalPointPtr Barrier::getFirstXInf ( ) const

Get the first infeasible points in the barrier.

If there is no infeasible point, return a nullptr

Returns
A single infeasible eval point.
Double Barrier::getHMax ( ) const
inline

Get the current hMax of the barrier.

Definition at line 92 of file Barrier.hpp.

92 { return _hMax; }
Double _hMax
Maximum acceptable value for h.
Definition: Barrier.hpp:17
void Barrier::init ( const Point fixedVariable)
private

Helper function for constructor.

Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.

Parameters
fixedVariableThe fixed variables have a fixed value – IN.
size_t Barrier::nbXFeas ( ) const
inline

Number of feasible points in the barrier.

Definition at line 48 of file Barrier.hpp.

48 { return _xFeas.size(); }
std::vector< EvalPointPtr > _xFeas
Current feasible incumbent solutions.
Definition: Barrier.hpp:14
size_t Barrier::nbXInf ( ) const
inline

Number of infeasible points in the barrier.

Definition at line 76 of file Barrier.hpp.

76 { return _xInf.size(); }
std::vector< EvalPointPtr > _xInf
Current infeasible incumbent solutions.
Definition: Barrier.hpp:15
void Barrier::setHMax ( const Double hMax)

Set the hMax of the barrier.

Parameters
hMaxThe hMax – IN.

Member Data Documentation

Double Barrier::_hMax
private

Maximum acceptable value for h.

Definition at line 17 of file Barrier.hpp.

std::vector<EvalPointPtr> Barrier::_xFeas
private

Current feasible incumbent solutions.

Definition at line 14 of file Barrier.hpp.

std::vector<EvalPointPtr> Barrier::_xInf
private

Current infeasible incumbent solutions.

Definition at line 15 of file Barrier.hpp.


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