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

Class NM algorithm to perform Reflect, Expansion, Inside_Contraction, Outside_Contraction. More...

#include <NMReflective.hpp>

Inheritance diagram for NMReflective:
Collaboration diagram for NMReflective:

Public Member Functions

 NMReflective (const Step *parentStep)
 Constructor. More...
 
 ~NMReflective ()
 
virtual void start () override
 What a step does. More...
 
virtual bool run () override
 What a step does. More...
 
void generateTrialPoints () override
 Generate new points to evaluate. More...
 
void setCurrentNMStepType (NMStepType stepType)
 
NMStepType getNextNMStepType (void) const
 
- Public Member Functions inherited from Step
 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 StepgetParentStep () 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< AllStopReasonsgetAllStopReasons () 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 StepgetParentOfType (const bool stopAtAlgo=true) const
 Template function to get the parent of given type. More...
 
bool isAnAlgorithm () const
 
const std::shared_ptr< MeshBasegetIterationMesh () const
 
const std::shared_ptr< EvalPointgetIterationFrameCenter () const
 
const std::shared_ptr< BarriergetMegaIterationBarrier () const
 
Point getSubFixedVariable () const
 
virtual void end ()
 What a step does. More...
 
virtual void hotRestartOnUserInterrupt ()
 Helper for hot restart functionalities. More...
 
- Public Member Functions inherited from NMIterationUtils
 NMIterationUtils (const Step *parentStep)
 Constructor. More...
 
- Public Member Functions inherited from IterationUtils
 IterationUtils (const Step *parentStep)
 Constructor. More...
 
 ~IterationUtils ()
 Destructor. More...
 
const SuccessTypegetSuccessType () const
 
void setSuccessType (const SuccessType &success)
 
size_t getTrialPointsCount () const
 
EvalPointSetgetTrialPoints ()
 
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 ()
 
void setNextNMStepType (void)
 
void setAfterReflect (void)
 
void setAfterExpand (void)
 
void setAfterOutsideContract (void)
 
void setAfterInsideContract (void)
 
bool insertInY (const Point &x)
 
bool insertInYBest (const Point &x1, const Point &x2)
 
bool pointDominatesY0 (const Point &x) const
 
bool YnDominatesPoint (const Point &x) const
 
bool pointDominatesPtsInY (const Point &x, size_t nb) const
 
bool makeListY0 (void)
 
bool makeListYn (void)
 
void displayY0nInfo (void) const
 

Private Attributes

NMStepType _nextStepType
 
Double _delta
 
Double _deltaE
 
Double _deltaOC
 
Double _deltaIC
 
Point _xr
 
Point _xe
 
Point _xoc
 
Point _xic
 
std::list< const EvalPoint * > _nmY0
 Lists of points extracted from NM simplex (loose ordering–>tied points can exist). _nmY0: undominated points, _nmYn: dominated points. More...
 
std::list< const EvalPoint * > _nmYn
 

Additional Inherited Members

- Static Public Member Functions inherited from Step
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 > &paramLines)
 
- Static Public Member Functions inherited from IterationUtils
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...
 
- Protected Member Functions inherited from Step
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...
 
- Protected Member Functions inherited from NMIterationUtils
void updateYCharacteristics (void)
 
void displayYInfo (void) const
 
int getRankDZ () const
 
void setStopReason () const
 
- Protected Attributes inherited from Step
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...
 
- Protected Attributes inherited from NMIterationUtils
Double _rankEps
 
NMStepType _currentStepType
 
std::shared_ptr
< NMSimplexEvalPointSet
_nmY
 
- Protected Attributes inherited from IterationUtils
const Step_parentStep
 
SuccessType _success
 Success type of this step. More...
 
Iteration_iterAncestor
 
MegaIteration_megaIterAncestor
 
- Static Protected Attributes inherited from Step
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
 

Detailed Description

Class NM algorithm to perform Reflect, Expansion, Inside_Contraction, Outside_Contraction.

Note
The name "reflective" is because all those steps are reflections with different delta.

Definition at line 16 of file NMReflective.hpp.

Constructor & Destructor Documentation

NMReflective::NMReflective ( const Step parentStep)
inlineexplicit

Constructor.

Parameters
parentStepThe parent of this NM step

Definition at line 33 of file NMReflective.hpp.

34  : Step( parentStep ) ,
35  NMIterationUtils ( parentStep )
36  {
37 
38 
39  init();
40  }
NMIterationUtils(const Step *parentStep)
Constructor.
Step()
Constructor #1 for MainStep (no parent)
Definition: Step.hpp:51
NMReflective::~NMReflective ( )
inline

Definition at line 41 of file NMReflective.hpp.

41 {}

Member Function Documentation

void NMReflective::displayY0nInfo ( void  ) const
private
void NMReflective::generateTrialPoints ( )
overridevirtual

Generate new points to evaluate.

Implements IterationUtils.

NMStepType NMReflective::getNextNMStepType ( void  ) const
inline

Definition at line 51 of file NMReflective.hpp.

51 { return _nextStepType ; }
NMStepType _nextStepType
void NMReflective::init ( )
private
Note
VRM Documentation TODO.
bool NMReflective::insertInY ( const Point x)
private
bool NMReflective::insertInYBest ( const Point x1,
const Point x2 
)
private
bool NMReflective::makeListY0 ( void  )
private
bool NMReflective::makeListYn ( void  )
private
bool NMReflective::pointDominatesPtsInY ( const Point x,
size_t  nb 
) const
private
bool NMReflective::pointDominatesY0 ( const Point x) const
private
virtual bool NMReflective::run ( )
overridevirtual

What a step does.

Reimplemented from Step.

void NMReflective::setAfterExpand ( void  )
private
void NMReflective::setAfterInsideContract ( void  )
private
void NMReflective::setAfterOutsideContract ( void  )
private
void NMReflective::setAfterReflect ( void  )
private
void NMReflective::setCurrentNMStepType ( NMStepType  stepType)
void NMReflective::setNextNMStepType ( void  )
private
virtual void NMReflective::start ( )
overridevirtual

What a step does.

Todo:
Consider the us

Reimplemented from Step.

bool NMReflective::YnDominatesPoint ( const Point x) const
private

Member Data Documentation

Double NMReflective::_delta
private

Definition at line 20 of file NMReflective.hpp.

Double NMReflective::_deltaE
private

Definition at line 20 of file NMReflective.hpp.

Double NMReflective::_deltaIC
private

Definition at line 20 of file NMReflective.hpp.

Double NMReflective::_deltaOC
private

Definition at line 20 of file NMReflective.hpp.

NMStepType NMReflective::_nextStepType
private

Definition at line 19 of file NMReflective.hpp.

std::list<const EvalPoint *> NMReflective::_nmY0
private

Lists of points extracted from NM simplex (loose ordering–>tied points can exist). _nmY0: undominated points, _nmYn: dominated points.

Definition at line 25 of file NMReflective.hpp.

std::list<const EvalPoint *> NMReflective::_nmYn
private

Definition at line 25 of file NMReflective.hpp.

Point NMReflective::_xe
private

Definition at line 22 of file NMReflective.hpp.

Point NMReflective::_xic
private

Definition at line 22 of file NMReflective.hpp.

Point NMReflective::_xoc
private

Definition at line 22 of file NMReflective.hpp.

Point NMReflective::_xr
private

Definition at line 22 of file NMReflective.hpp.


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