EasyLocalpp  3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Control.h
Go to the documentation of this file.
1 #if !defined(_CONTROL_HH_)
2 #define _CONTROL_HH_
3 
4 #include <stdexcept>
5 #include <list>
6 #include <string>
7 #include <iostream>
8 #include <memory>
9 #include <sstream>
10 //#include "easylocal/utils/types.hh"
11 
12 
13 #ifdef WIN32
14 #pragma warning(disable:4786)
15 #endif
16 
17 
20 
21 
22 //#include "Utilities.h"
23 //#include "Parameters.h"
24 //#include "Settings.h"
25 
26 using namespace std;
27 
28 //#include "Timer.h"
29 //#include "Random.h"
30 #include <map>
31 
32 class Control {
33 private:
34  //map< string, string > parameters;
35  //Timer timer;
36 
37  int nrTry, maxTry;
38 
39  int seed;
40  double timeLimit;
41 
42  ostream *os;
43 
44  const char *ss;
45 
46 public:
47 
48  Control(int, char**); // construct a control object, given a set of command line options
49  ~Control();
50  const char *is;
51  const char *param_set_file;
52 
54 
55 
56  int runner;
58  int solver;
61 
65 
66  void Usage();
67 
68  void ComParser(int argc, char** argv);
69  int getSeed() {
70  return seed;
71  } // get the seed for the random number generator
72  void resetTime(); // reset the timer
73 
74  ; // check whether our run has time left
75  int getNumTry() {
76  return (nrTry);
77  }
78  ;
79 
80 
81  const char *getInputStream() {
82  return is;
83  } // get the input stream for constructing problems
84  const char *getInputSolutionStream() {
85  return ss;
86  } // get the input stream for constructing problems
87  ostream& getOutputStream() {
88  return *os;
89  } // get the output stream used for writing output data
91  return maxTry;
92  } // get the max number of tries
93  bool triesLeft() {
94  return (nrTry < maxTry);
95  } // check whether more tries need to be run
96  double getTimeLimit() {
97  return timeLimit;
98  } // get the time limit of one run
99  void informationsReport();
100  char *readline(istream &infile);
101  char *match(char *source, char *prefix);
102  void SetDefaultParameters();
103  const char *fullPathToInstance() {return is;};
104 
105  Parameters *parset;
106 
107 };
108 
109 #endif
bool triesLeft()
Definition: Control.h:93
string os_certificate
Definition: Control.h:64
#define Longint
Definition: Definitions.h:72
int getNumberOfTries()
Definition: Control.h:90
int max_restart
Definition: Control.h:57
double getTimeLimit()
Definition: Control.h:96
Longint max_idle
Definition: Control.h:60
const char * getInputSolutionStream()
Definition: Control.h:84
Longint max_iter
Definition: Control.h:59
Bool print_statistics
Definition: Control.h:62
int getSeed()
Definition: Control.h:69
const char * is
Definition: Control.h:50
#define Bool
Definition: Definitions.h:29
Bool certificate
Definition: Control.h:63
Longint ls_iter
Definition: Control.h:53
int getNumTry()
Definition: Control.h:75
const char * getInputStream()
Definition: Control.h:81
int runner
Definition: Control.h:56
ostream & getOutputStream()
Definition: Control.h:87
const char * param_set_file
Definition: Control.h:51
int solver
Definition: Control.h:58