Pakman
SweepController.h
1 #ifndef SWEEPCONTROLLER_H
2 #define SWEEPCONTROLLER_H
3 
4 #include <string>
5 #include <vector>
6 
7 #include "interface/types.h"
8 
9 #include "AbstractController.h"
10 
26 {
27  public:
28 
29  // Forward declaration of Input
30  struct Input;
31 
36  SweepController(const Input &input_obj);
37 
39  virtual ~SweepController() override = default;
40 
42  virtual void iterate() override;
43 
45  virtual Command getSimulator() const override;
46 
48  static std::string help();
49 
55  static void addLongOptions(LongOptions& lopts);
56 
63  static SweepController* makeController(const Arguments& args);
64 
68  struct Input
69  {
76  static Input makeInput(const Arguments& args);
77 
80 
82  std::vector<ParameterName> parameter_names;
83 
86  };
87 
88  private:
89 
91  // Parameter names
92  std::vector<ParameterName> m_parameter_names;
93 
94  // Parameter list
95  std::vector<Parameter> m_prmtr_list;
96 
97  // Counter for number of finished parameters
98  int m_num_finished = 0;
99 
100  // At first iteration, SweepController will push all parameters to the
101  // pending queue of the Master. This flag tells iterate() that it is
102  // in the first iteration.
103  bool m_first_iteration = true;
104 
105  // Simulator command
106  Command m_simulator;
107 
108  // Entered iterate()
109  bool m_entered = false;
110 };
111 
112 #endif // SWEEPCONTROLLER_H
static std::string help()
static Input makeInput(const Arguments &args)
virtual void iterate() override
SweepController(const Input &input_obj)
static SweepController * makeController(const Arguments &args)
std::vector< ParameterName > parameter_names
virtual Command getSimulator() const override
virtual ~SweepController() override=default
static void addLongOptions(LongOptions &lopts)