NOMAD Source
Version 4.0.0 Beta
|
Class for Latin Hypercube algorithm sampling. More...
#include <LH.hpp>
Public Member Functions | |
LH (const Step *parentStep, std::shared_ptr< AlgoStopReasons< LHStopType >> stopReasons, const std::shared_ptr< RunParameters > &runParams, const std::shared_ptr< PbParameters > &pbParams) | |
Constructor. More... | |
~LH () | |
Destructor. More... | |
virtual void | start () override |
Start step of the algorithm. More... | |
virtual bool | run () override |
Run algorithm execution for single-objective. More... | |
virtual void | end () override |
End step of the algorithm. More... | |
virtual void | readInformationForHotRestart () override |
Helper for start() when doing a hot restart. More... | |
![]() | |
Algorithm (const Step *parentStep, std::shared_ptr< AllStopReasons > stopReasons, const std::shared_ptr< RunParameters > &runParams, const std::shared_ptr< PbParameters > &pbParams) | |
Constructor. More... | |
virtual | ~Algorithm () |
Destructor. More... | |
const std::shared_ptr < MegaIteration > | getMegaIteration () const |
void | setEndDisplay (bool endDisplay) |
bool | isSubAlgo () const |
virtual void | read (std::istream &is) |
virtual void | display (std::ostream &os) const |
![]() | |
Step () | |
Constructor #1 for MainStep (no parent) More... | |
Step (const Step *parentStep, const std::shared_ptr< RunParameters > &runParams=nullptr, const std::shared_ptr< PbParameters > &pbParams=nullptr) | |
Constructor #2 for child step of a parent sharing the same stopReason. More... | |
Step (const Step *parentStep, std::shared_ptr< AllStopReasons > stopReasons, const std::shared_ptr< RunParameters > &runParams=nullptr, const std::shared_ptr< PbParameters > &pbParams=nullptr) | |
Constructor #3: for a child Step with a provided stopReason (such as an algorithm) More... | |
virtual | ~Step () |
Destructor. More... | |
const Step * | getParentStep () const |
Get the parent step. More... | |
virtual const std::string | getName () const |
Get the name of this step. More... | |
void | setName (const std::string &name) |
Set the name of this step. More... | |
std::shared_ptr< AllStopReasons > | getAllStopReasons () const |
void | addCallback (const NOMAD::CallbackType &callbackType, const NOMAD::StepEndCbFunc &stepEndCbFunc) |
Set user callback. More... | |
void | addCallback (const NOMAD::CallbackType &callbackType, const NOMAD::HotRestartCbFunc &hotRestartCbFunc) |
void | AddOutputInfo (const std::string &s, bool isBlockStart, bool isBlockEnd) const |
display output More... | |
void | AddOutputInfo (const std::string &s, OutputLevel outputLevel=OutputLevel::LEVEL_INFO) const |
void | AddOutputError (const std::string &s) const |
void | AddOutputWarning (const std::string &s) const |
void | AddOutputVeryHigh (const std::string &s) const |
void | AddOutputHigh (const std::string &s) const |
void | AddOutputDebug (const std::string &s) const |
void | AddOutputInfo (OutputInfo outputInfo) const |
template<typename T > | |
const Step * | getParentOfType (const bool stopAtAlgo=true) const |
Template function to get the parent of given type. More... | |
bool | isAnAlgorithm () const |
const std::shared_ptr< MeshBase > | getIterationMesh () const |
const std::shared_ptr< EvalPoint > | getIterationFrameCenter () const |
const std::shared_ptr< Barrier > | getMegaIterationBarrier () const |
Point | getSubFixedVariable () const |
![]() | |
IterationUtils (const Step *parentStep) | |
Constructor. More... | |
~IterationUtils () | |
Destructor. More... | |
const SuccessType & | getSuccessType () const |
void | setSuccessType (const SuccessType &success) |
size_t | getTrialPointsCount () const |
EvalPointSet & | getTrialPoints () |
bool | insertTrialPoint (const EvalPoint &evalPoint) |
Insert a trial point. More... | |
void | clearTrialPoints (void) |
Clear trial points. More... | |
virtual void | postProcessing () |
Helper for end() More... | |
virtual void | verifyPointsAreOnMesh () |
Helper for start() More... | |
bool | evalTrialPoints (Step *step) |
Start evaluation of the trial points. More... | |
size_t | getNbEvalPointsThatNeededEval () const |
Get the number of evaluation points in the queue for evaluation. More... | |
virtual void | updatePointsWithFrameCenter () |
Add current frame center as originator of each point in trialPoints. More... | |
Private Member Functions | |
void | init () |
Helper for constructor. More... | |
virtual void | generateTrialPoints () override |
Generate the trial points of an algorithm iteration before evaluation. The method depends on the implementation of this pure virtual function. More... | |
Additional Inherited Members | |
![]() | |
static bool | getUserTerminate () |
Interruption call by user. More... | |
static void | setUserTerminate () |
Interruption requested. More... | |
static void | userInterrupt (int signalValue) |
Interruption call by user with a signal value. More... | |
static bool | getUserInterrupt () |
static void | runCallback (NOMAD::CallbackType callbackType, const NOMAD::Step &step, bool &stop) |
Run user callback. More... | |
static void | runCallback (NOMAD::CallbackType callbackType, std::vector< std::string > ¶mLines) |
![]() | |
static void | snapPointToBoundsAndProjectOnMesh (Point &xt, const ArrayOfDouble &lb, const ArrayOfDouble &ub, const std::shared_ptr< Point > frameCenter, const std::shared_ptr< MeshBase > mesh=nullptr) |
Helper for start() More... | |
![]() | |
void | init () |
Helper for Constructor. More... | |
void | saveInformationForHotRestart () const |
Helper for end() More... | |
void | displayBestSolutions () const |
Helper for end() More... | |
void | displayEvalCounts () const |
Helper for end() More... | |
void | hotRestartOnUserInterrupt () override |
Helper for hot restart. More... | |
![]() | |
void | verifyParentNotNull () |
Helper for constructors. More... | |
void | verifyGenerateAllPointsBeforeEval (const std::string &method, const bool expected) const |
Helper for validating steps depending on parameter GENERATE_ALL_POINTS_BEFORE_EVAL. More... | |
void | init () |
Helper for constructors. More... | |
void | defaultStart () |
bool | defaultRun () |
void | defaultEnd () |
void | hotRestartBeginHelper () |
Helpers for hot restart, to be called at the start and end of any override. More... | |
void | hotRestartEndHelper () |
Helpers for hot restart, to be called at the start and end of any override. More... | |
![]() | |
std::unique_ptr< Initialization > | _initialization |
To initialize the algorithm (X0) More... | |
std::unique_ptr< Termination > | _termination |
To verify termination conditions. More... | |
std::shared_ptr< MegaIteration > | _megaIteration |
MegaIteration used to keep information between steps. More... | |
bool | _endDisplay |
![]() | |
const Step * | _parentStep |
The parent of this step. More... | |
std::string | _name |
The name of this step. More... | |
std::shared_ptr< AllStopReasons > | _stopReasons |
The stop reasons of an algorithm. More... | |
std::shared_ptr< RunParameters > | _runParams |
The run parameters that control a step. More... | |
std::shared_ptr< PbParameters > | _pbParams |
The problem parameters that control a step. More... | |
![]() | |
const Step * | _parentStep |
SuccessType | _success |
Success type of this step. More... | |
Iteration * | _iterAncestor |
MegaIteration * | _megaIterAncestor |
![]() | |
static bool | _userInterrupt |
Interrupt NOMAD if Ctrl-C is pressed. More... | |
static bool | _userTerminate |
Terminate NOMAD if Ctrl-C is pressed again. More... | |
static NOMAD::StepEndCbFunc | _cbIterationEnd |
static NOMAD::StepEndCbFunc | _cbMegaIterationEnd |
static NOMAD::HotRestartCbFunc | _cbHotRestart |
Class for Latin Hypercube algorithm sampling.
|
inlineexplicit |
Constructor.
Definition at line 22 of file LH.hpp.
|
overridevirtual |
End step of the algorithm.
Display some information and save information for a potential hot restart.
Reimplemented from Algorithm.
|
overrideprivatevirtual |
Generate the trial points of an algorithm iteration before evaluation. The method depends on the implementation of this pure virtual function.
Implements IterationUtils.
|
private |
Helper for constructor.
|
inlineoverridevirtual |
|
overridevirtual |
|
overridevirtual |
Start step of the algorithm.
If doing a hot restart get the algorithm ready to continue.
If starting a new algorithm, reset the stop reason, the lap evaluation counter, and perform initialization.
Reimplemented from Algorithm.