NOMAD Source  Version 4.0.0 Beta
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LH.hpp
Go to the documentation of this file.
1 #ifndef __NOMAD400_LH__
2 #define __NOMAD400_LH__
3 
4 #include "../../Eval/EvalPoint.hpp"
5 
6 
7 #include "../../Algos/Algorithm.hpp"
8 #include "../../Algos/AlgoStopReasons.hpp"
9 #include "../../Algos/IterationUtils.hpp"
10 
11 #include "../../nomad_nsbegin.hpp"
12 
13 /// Class for Latin Hypercube algorithm sampling.
14 /**
15  \todo Complete documentation
16  */
17 class LH: public Algorithm, public IterationUtils
18 {
19 
20 public:
21  /// Constructor
22  explicit LH(const Step* parentStep,
23  std::shared_ptr<AlgoStopReasons<LHStopType>> stopReasons,
24  const std::shared_ptr<RunParameters>& runParams,
25  const std::shared_ptr<PbParameters>& pbParams)
26  : Algorithm(parentStep, stopReasons, runParams, pbParams),
27  IterationUtils(this)
28  {
29  init();
30  }
31 
32  /// Destructor
33  ~LH() {}
34 
35 
36  virtual void start() override;
37  virtual bool run() override;
38  virtual void end() override;
39 
40  virtual void readInformationForHotRestart() override {}
41 
42 private:
43  /// Helper for constructor
44  void init();
45 
46  /**
47  \copydoc IterationUtils::generateTrialPoints \n
48  \note For LH, the generation of points uses LHS for sampling with the problem bounds and problem X0.
49  */
50  virtual void generateTrialPoints ( ) override;
51 
52 
53 };
54 
55 #include "../../nomad_nsend.hpp"
56 
57 #endif // __NOMAD400_LH__
virtual void generateTrialPoints() override
Generate the trial points of an algorithm iteration before evaluation. The method depends on the impl...
virtual void end() override
End step of the algorithm.
virtual bool run() override
Run algorithm execution for single-objective.
void init()
Helper for constructor.
Class for Latin Hypercube algorithm sampling.
Definition: LH.hpp:17
~LH()
Destructor.
Definition: LH.hpp:33
virtual void readInformationForHotRestart() override
Helper for start() when doing a hot restart.
Definition: LH.hpp:40
Template class for algorithm stop reasons.
Generic class for any direct search optimizer algorithm.
Definition: Algorithm.hpp:28
Class of utils (attributes and helper functions) for some phases of an algorithm that involve Iterati...
Base class of all types of steps (Iteration, Termination, Initialization, Poll, Mads,...).
Definition: Step.hpp:24
virtual void start() override
Start step of the algorithm.
LH(const Step *parentStep, std::shared_ptr< AlgoStopReasons< LHStopType >> stopReasons, const std::shared_ptr< RunParameters > &runParams, const std::shared_ptr< PbParameters > &pbParams)
Constructor.
Definition: LH.hpp:22