Gadget
maininfo.h
Go to the documentation of this file.
1 #ifndef maininfo_h
2 #define maininfo_h
3 
4 #include "gadget.h"
5 #include "commentstream.h"
6 #include "printinfo.h"
7 
12 class MainInfo {
13 public:
17  MainInfo();
21  ~MainInfo();
26  void showCorrectUsage(char* error);
30  void showUsage();
36  void checkUsage(const char* const inputdir, const char* const workingdir);
42  void read(int aNumber, char* const aVector[]);
47  void setPrintInitialFile(char* filename);
52  void setPrintFinalFile(char* filename);
57  void setInitialParamFile(char* filename);
62  void setMainGadgetFile(char* filename);
67  void setOptInfoFile(char* filename);
72  int runOptimise() const { return runoptimise; };
77  int runStochastic() const { return runstochastic; };
82  int runNetwork() const { return runnetwork; };
87  int runPrint() const { return runprint; };
92  int getOptInfoGiven() const { return givenOptInfo; };
97  int getInitialParamGiven() const { return givenInitialParam; };
102  int getForcePrint() const { return forceprint; };
107  PrintInfo getPI() const { return printinfo; };
112  int printInitial() const { return printInitialInfo; };
117  int printFinal() const { return printFinalInfo; };
122  char* getInitialParamFile() const { return strInitialParamFile; };
127  char* getPrintInitialFile() const { return strPrintInitialFile; };
132  char* getPrintFinalFile() const { return strPrintFinalFile; };
137  char* getMainGadgetFile() const { return strMainGadgetFile; };
142  char* getOptInfoFile() const { return strOptInfoFile; };
147  double getMaxRatio() const { return maxratio; };
148 private:
153  void read(CommentStream& file);
157  char* strOptInfoFile;
161  char* strInitialParamFile;
165  char* strPrintInitialFile;
169  char* strPrintFinalFile;
173  char* strMainGadgetFile;
177  PrintInfo printinfo;
181  int givenOptInfo;
185  int givenInitialParam;
189  int runoptimise;
193  int runstochastic;
197  int runnetwork;
201  int runprint;
205  int forceprint;
209  int printInitialInfo;
213  int printFinalInfo;
217  int printLogLevel;
221  double maxratio;
222 };
223 
224 #endif
This is the class used to strip comments (and whitespace) from any input stream.
Definition: commentstream.h:40
This is the class used to store information for the current model given from the command-line.
Definition: maininfo.h:12
int printFinal() const
This function will return the flag used to determine whether the final model information should be pr...
Definition: maininfo.h:117
~MainInfo()
This is the default MainInfo destructor.
Definition: maininfo.cc:60
int getInitialParamGiven() const
This function will return the flag used to determine whether the initial values for the model paramet...
Definition: maininfo.h:97
PrintInfo getPI() const
This function will return the PrintInfo used to store printing information.
Definition: maininfo.h:107
void checkUsage(const char *const inputdir, const char *const workingdir)
This function will check the options that have been specified on the commandline.
Definition: maininfo.cc:239
MainInfo()
This is the MainInfo constructor.
Definition: maininfo.cc:43
int getForcePrint() const
This function will return the flag used to force the model to print the model output to file.
Definition: maininfo.h:102
void setPrintInitialFile(char *filename)
This function will store the filename that the initial model information will be written to.
Definition: maininfo.cc:420
double getMaxRatio() const
This function will return the maximum ratio of a stock that can be consumed on any given timestep.
Definition: maininfo.h:147
int printInitial() const
This function will return the flag used to determine whether the initial model information should be ...
Definition: maininfo.h:112
char * getPrintFinalFile() const
This function will return the filename that the final model information will be written to.
Definition: maininfo.h:132
int getOptInfoGiven() const
This function will return the flag used to determine whether the optimisation parameters have been gi...
Definition: maininfo.h:92
char * getMainGadgetFile() const
This function will return the filename that the main model information will be read from.
Definition: maininfo.h:137
char * getInitialParamFile() const
This function will return the filename that the initial values for the model parameters will be read ...
Definition: maininfo.h:122
void setInitialParamFile(char *filename)
This function will store the filename that the initial values for the model parameters will be read f...
Definition: maininfo.cc:449
void showCorrectUsage(char *error)
This function will print an error message, brief help information and then exit.
Definition: maininfo.cc:7
int runPrint() const
This function will return the flag used to determine whether the current simulation should print the ...
Definition: maininfo.h:87
void read(int aNumber, char *const aVector[])
This function will read input from the command line.
Definition: maininfo.cc:83
char * getOptInfoFile() const
This function will return the filename that the optimisation information will be read from.
Definition: maininfo.h:142
int runOptimise() const
This function will return the flag used to determine whether the likelihood score should be optimised...
Definition: maininfo.h:72
void setMainGadgetFile(char *filename)
This function will store the filename that the main model information will be read from.
Definition: maininfo.cc:440
void setOptInfoFile(char *filename)
This function will store the filename that the optimisation information will be read from.
Definition: maininfo.cc:459
void showUsage()
This function will print help information and then exit.
Definition: maininfo.cc:15
int runNetwork() const
This function will return the flag used to determine whether the current simulation has been started ...
Definition: maininfo.h:82
char * getPrintInitialFile() const
This function will return the filename that the initial model information will be written to.
Definition: maininfo.h:127
void setPrintFinalFile(char *filename)
This function will store the filename that the final model information will be written to.
Definition: maininfo.cc:430
int runStochastic() const
This function will return the flag used to determine whether a simulation run should be performed.
Definition: maininfo.h:77
This is the class used to store information about what format the model parameters should be written ...
Definition: printinfo.h:10