NOMAD Source
Version 4.0.0 Beta
|
Class to manage the iterations. More...
#include <MegaIteration.hpp>
Public Member Functions | |
MegaIteration (const Step *parentStep, size_t k, std::shared_ptr< Barrier > barrier, SuccessType success) | |
Constructor. More... | |
size_t | getNbIterations () const |
std::shared_ptr< Iteration > | getIter (size_t i) const |
size_t | getK () const |
void | setK (const size_t k) |
size_t | getNextK () const |
const std::shared_ptr < NOMAD::Barrier > | getBarrier () const |
void | setBarrier (const std::shared_ptr< NOMAD::Barrier > &barrier) |
virtual void | start () override=0 |
What a step does. More... | |
virtual bool | run () override=0 |
What a step does. More... | |
virtual void | end () override |
What a step does. More... | |
const SuccessType & | getSuccessType () const |
void | setSuccessType (const SuccessType &success) |
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 |
virtual void | hotRestartOnUserInterrupt () |
Helper for hot restart functionalities. More... | |
Protected Attributes | |
std::vector< std::shared_ptr < Iteration > > | _iterList |
A collection of additional iterations: Help generate more eval points. More... | |
std::shared_ptr< Barrier > | _barrier |
size_t | _k |
Main counter. More... | |
size_t | _nbIterRun |
Number of iterations run within this MegaIteration. More... | |
SuccessType | _success |
![]() | |
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... | |
Private Member Functions | |
void | init () |
Helper for constructor. 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) |
![]() | |
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... | |
![]() | |
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 to manage the iterations.
A mega iteration of an algorithm:
The run and start functions of mega iteration must be implemented for each optimizer that has several phases of points creation that we want to combine before launching evaluations (for example, MadsMegaIteration, NMMegaIteration, ...).
Definition at line 28 of file MegaIteration.hpp.
|
inlineexplicit |
Constructor.
parentStep | The parent step of this step – IN. |
k | The main iteration counter – IN. |
barrier | The barrier for constraints handling. Belongs to subproblem space. – IN. |
success | Success type of the previous MegaIteration. – IN. |
Definition at line 66 of file MegaIteration.hpp.
|
virtual |
Reimplemented in MadsMegaIteration, and NMMegaIteration.
|
overridevirtual |
What a step does.
Reimplemented from Step.
|
inline |
Definition at line 98 of file MegaIteration.hpp.
|
inline |
Definition at line 91 of file MegaIteration.hpp.
|
inline |
Definition at line 93 of file MegaIteration.hpp.
|
inline |
Definition at line 90 of file MegaIteration.hpp.
size_t MegaIteration::getNextK | ( | ) | const |
|
inline |
Definition at line 107 of file MegaIteration.hpp.
|
private |
Helper for constructor.
|
virtual |
Reimplemented in MadsMegaIteration, and NMMegaIteration.
|
overridepure virtual |
|
inline |
Definition at line 99 of file MegaIteration.hpp.
|
inline |
Definition at line 94 of file MegaIteration.hpp.
|
inline |
Definition at line 109 of file MegaIteration.hpp.
|
overridepure virtual |
What a step does.
Reimplemented from Step.
Implemented in MadsMegaIteration, and NMMegaIteration.
|
protected |
The barrier holds xFeas, xInf and hMax. xFeas and xInf will be used as frame centers.
Definition at line 40 of file MegaIteration.hpp.
|
protected |
A collection of additional iterations: Help generate more eval points.
Definition at line 33 of file MegaIteration.hpp.
|
protected |
Main counter.
Definition at line 43 of file MegaIteration.hpp.
|
protected |
Number of iterations run within this MegaIteration.
Definition at line 44 of file MegaIteration.hpp.
|
protected |
Success type of this step. Initialized with the run of the previous mega iteration, so that the update step knows what to do (for example,enlarge or reduce the mesh). At the end of run step during the mega iteration of an algorithm, the success type is updated (::setSuccessType) with the latest success type.
Definition at line 54 of file MegaIteration.hpp.