Class for barrier following algorithm 12.2 of DFBO.
More...
#include <Barrier.hpp>
Class for barrier following algorithm 12.2 of DFBO.
Definition at line 54 of file Barrier.hpp.
◆ Barrier()
Constructor.
hMax will be updated during optimization.
- Parameters
-
hMax | The max of h to keep a point in the barrier – IN. |
fixedVariable | The fixed variables have a fixed value – IN. |
evalType | Type of evaluation (BB or SGTE) – IN. |
evalPointList | Additional points to consider in building the barrier – IN. |
Definition at line 83 of file Barrier.hpp.
94 init(fixedVariable, evalType, evalPointList);
◆ addXFeas()
Add a feasible point in the barrier.
If the point is feasible it is added, if not an exception is triggered.
- Parameters
-
xFeas | The eval point to add – IN. |
evalType | Which eval (Blackbox or Surrogate) of the EvalPoint to use to verify feasibility – IN. |
◆ addXInf()
void Barrier::addXInf |
( |
const EvalPoint & |
xInf | ) |
|
Add an infeasible point in the barrier.
If the point is nullptr an exception is triggered.
- Parameters
-
xInf | The eval point to add – IN. |
◆ checkCache()
void Barrier::checkCache |
( |
| ) |
|
|
private |
Helper function for init/constructor.
Throw an exception if the Cache has not been instantiated yet. Will remain silent otherwise.
◆ checkHMax()
void Barrier::checkHMax |
( |
| ) |
|
|
private |
Helper function for init/setHMax.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
◆ checkXFeas()
void Barrier::checkXFeas |
( |
const EvalType & |
evalType | ) |
|
|
private |
Helper function for insertion.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
◆ checkXFeasIsFeas()
void Barrier::checkXFeasIsFeas |
( |
const EvalType & |
evalType | ) |
|
|
private |
Helper function for insertion.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
◆ checkXInf()
void Barrier::checkXInf |
( |
| ) |
|
|
private |
Helper function for insertion.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
◆ clearXFeas()
void Barrier::clearXFeas |
( |
| ) |
|
Remove feasible points from the barrier.
◆ clearXInf()
void Barrier::clearXInf |
( |
| ) |
|
Remove infeasible points from the barrier.
◆ display()
std::string Barrier::display |
( |
const size_t |
max = INF_SIZE_T | ) |
const |
Return the barrier as a string.
◆ getAllPoints()
std::vector<EvalPoint> Barrier::getAllPoints |
( |
| ) |
|
Get all feasible and infeasable points.
◆ getAllXFeas()
const std::vector<EvalPoint> Barrier::getAllXFeas |
( |
| ) |
const |
|
inline |
Get all feasible points in the barrier.
- Returns
- All the eval points that are feasible.
Definition at line 104 of file Barrier.hpp.
◆ getAllXInf()
const std::vector<EvalPoint> Barrier::getAllXInf |
( |
| ) |
const |
|
inline |
Get all infeasible points in the barrier.
- Returns
- All the eval points that are infeasible.
Definition at line 145 of file Barrier.hpp.
◆ getFirstXFeas()
Get the first feasible point in the barrier.
If there is no feasible point, return a nullptr
- Returns
- A single feasible eval point.
◆ getFirstXInf()
Get the first infeasible point in the barrier.
If there is no infeasible point, return a nullptr
- Returns
- A single infeasible eval point.
◆ getHMax()
Double Barrier::getHMax |
( |
| ) |
const |
|
inline |
Get the current hMax of the barrier.
Definition at line 182 of file Barrier.hpp.
◆ getRefBestFeas()
Get the point that was previously the first feasible point in the barrier.
If there is no feasible point, return a nullptr
- Returns
- A single feasible eval point.
Definition at line 121 of file Barrier.hpp.
◆ getRefBestInf()
Get the point that was previously the first infeasible point in the barrier.
If there is no feasible point, return a nullptr
- Returns
- A single feasible eval point.
Definition at line 159 of file Barrier.hpp.
◆ init()
void Barrier::init |
( |
const Point & |
fixedVariable, |
|
|
const EvalType & |
evalType, |
|
|
const std::vector< EvalPoint > & |
evalPointList |
|
) |
| |
|
private |
Helper function for constructor.
Will throw exceptions or output error messages if something is wrong. Will remain silent otherwise.
- Parameters
-
fixedVariable | The fixed variables have a fixed value – IN. |
evalType | Which eval (Blackbox or Surrogate) to use to verify feasibility – IN. |
evalPointList | Additional points to consider to construct barrier. – IN. |
◆ nbXFeas()
size_t Barrier::nbXFeas |
( |
| ) |
const |
|
inline |
Number of feasible points in the barrier.
Definition at line 125 of file Barrier.hpp.
◆ nbXInf()
size_t Barrier::nbXInf |
( |
| ) |
const |
|
inline |
Number of infeasible points in the barrier.
Definition at line 163 of file Barrier.hpp.
163 {
return _xInf.size(); }
◆ setHMax()
void Barrier::setHMax |
( |
const Double & |
hMax | ) |
|
Set the hMax of the barrier.
- Parameters
-
◆ setN()
Helper function for init/constructor.
◆ setRefBestFeas()
void Barrier::setRefBestFeas |
( |
const EvalPointPtr |
refBestFeas | ) |
|
|
inline |
◆ setRefBestInf()
void Barrier::setRefBestInf |
( |
const EvalPointPtr |
refBestInf | ) |
|
|
inline |
◆ updateRefBests()
void Barrier::updateRefBests |
( |
| ) |
|
Update ref best feasible and ref best infeasible values.
◆ updateWithPoints()
bool Barrier::updateWithPoints |
( |
const std::vector< EvalPoint > & |
evalPointList, |
|
|
const EvalType & |
evalType, |
|
|
const bool |
keepAllPoints |
|
) |
| |
Update xFeas and xInf according to given points.
◆ _hMax
Maximum acceptable value for h.
Definition at line 64 of file Barrier.hpp.
◆ _n
Dimension of the points in the barrier.
Used for verification only. To be reviewed when we address category variables. /see _n in CacheBase.
Definition at line 72 of file Barrier.hpp.
◆ _refBestFeas
Previous first feasible incumbent.
Definition at line 61 of file Barrier.hpp.
◆ _refBestInf
Previous first infeasible incumbent.
Definition at line 62 of file Barrier.hpp.
◆ _xFeas
Current feasible incumbent solutions.
Definition at line 58 of file Barrier.hpp.
◆ _xInf
Current infeasible incumbent solutions.
Definition at line 59 of file Barrier.hpp.
The documentation for this class was generated from the following file: