Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Annotation of /trunk/gadget/maininfo.h
[mareframe] / trunk / gadget / maininfo.h Repository:
ViewVC logotype

Annotation of /trunk/gadget/maininfo.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef maininfo_h
2 :     #define maininfo_h
3 :    
4 :     #include "gadget.h"
5 :     #include "commentstream.h"
6 :     #include "printinfo.h"
7 :    
8 :     /**
9 :     * \class MainInfo
10 :     * \brief This is the class used to store information for the current model given from the command-line
11 :     */
12 :     class MainInfo {
13 :     public:
14 :     /**
15 :     * \brief This is the MainInfo constructor
16 :     */
17 :     MainInfo();
18 :     /**
19 :     * \brief This is the default MainInfo destructor
20 :     */
21 :     ~MainInfo();
22 :     /**
23 :     * \brief This function will print an error message, brief help information and then exit
24 :     * \param error is the error message
25 :     */
26 :     void showCorrectUsage(char* error);
27 :     /**
28 :     * \brief This function will print help information and then exit
29 :     */
30 :     void showUsage();
31 :     /**
32 :     * \brief This function will check the options that have been specified on the commandline
33 :     * \param inputdir is the name of the directory containing the input files to the model
34 :     * \param workingdir is the name of the directory used for the output from the model
35 :     */
36 :     void checkUsage(const char* const inputdir, const char* const workingdir);
37 :     /**
38 :     * \brief This function will read input from the command line
39 :     * \param aNumber is the number of command line entries
40 :     * \param aVector contains the command line entries
41 :     */
42 :     void read(int aNumber, char* const aVector[]);
43 :     /**
44 :     * \brief This function will store the filename that the initial model information will be written to
45 :     * \param filename is the name of the file
46 :     */
47 :     void setPrintInitialFile(char* filename);
48 :     /**
49 :     * \brief This function will store the filename that the final model information will be written to
50 :     * \param filename is the name of the file
51 :     */
52 :     void setPrintFinalFile(char* filename);
53 :     /**
54 :     * \brief This function will store the filename that the initial values for the model parameters will be read from
55 :     * \param filename is the name of the file
56 :     */
57 :     void setInitialParamFile(char* filename);
58 :     /**
59 :     * \brief This function will store the filename that the main model information will be read from
60 :     * \param filename is the name of the file
61 :     */
62 :     void setMainGadgetFile(char* filename);
63 :     /**
64 :     * \brief This function will store the filename that the optimisation information will be read from
65 :     * \param filename is the name of the file
66 :     */
67 :     void setOptInfoFile(char* filename);
68 :     /**
69 :     * \brief This function will return the flag used to determine whether the likelihood score should be optimised
70 :     * \return flag
71 :     */
72 :     int runOptimise() const { return runoptimise; };
73 :     /**
74 :     * \brief This function will return the flag used to determine whether a simulation run should be performed
75 :     * \return flag
76 :     */
77 :     int runStochastic() const { return runstochastic; };
78 :     /**
79 :     * \brief This function will return the flag used to determine whether the current simulation has been started using paramin
80 :     * \return flag
81 :     */
82 :     int runNetwork() const { return runnetwork; };
83 :     /**
84 :     * \brief This function will return the flag used to determine whether the current simulation should print the model output
85 :     * \return flag
86 :     */
87 :     int runPrint() const { return runprint; };
88 :     /**
89 :     * \brief This function will return the flag used to determine whether the optimisation parameters have been given
90 :     * \return flag
91 :     */
92 :     int getOptInfoGiven() const { return givenOptInfo; };
93 :     /**
94 :     * \brief This function will return the flag used to determine whether the initial values for the model parameters have been given
95 :     * \return flag
96 :     */
97 :     int getInitialParamGiven() const { return givenInitialParam; };
98 :     /**
99 :     * \brief This function will return the flag used to force the model to print the model output to file
100 :     * \return flag
101 :     */
102 :     int getForcePrint() const { return forceprint; };
103 :     /**
104 :     * \brief This function will return the PrintInfo used to store printing information
105 :     * \return pi, the PrintInfo containing the printing information
106 :     */
107 :     PrintInfo getPI() const { return printinfo; };
108 :     /**
109 :     * \brief This function will return the flag used to determine whether the initial model information should be printed to file
110 :     * \return flag
111 :     */
112 :     int printInitial() const { return printInitialInfo; };
113 :     /**
114 :     * \brief This function will return the flag used to determine whether the final model information should be printed to file
115 :     * \return flag
116 :     */
117 :     int printFinal() const { return printFinalInfo; };
118 :     /**
119 :     * \brief This function will return the filename that the initial values for the model parameters will be read from
120 :     * \return filename
121 :     */
122 :     char* getInitialParamFile() const { return strInitialParamFile; };
123 :     /**
124 :     * \brief This function will return the filename that the initial model information will be written to
125 :     * \return filename
126 :     */
127 :     char* getPrintInitialFile() const { return strPrintInitialFile; };
128 :     /**
129 :     * \brief This function will return the filename that the final model information will be written to
130 :     * \return filename
131 :     */
132 :     char* getPrintFinalFile() const { return strPrintFinalFile; };
133 :     /**
134 :     * \brief This function will return the filename that the main model information will be read from
135 :     * \return filename
136 :     */
137 :     char* getMainGadgetFile() const { return strMainGadgetFile; };
138 :     /**
139 :     * \brief This function will return the filename that the optimisation information will be read from
140 :     * \return filename
141 :     */
142 :     char* getOptInfoFile() const { return strOptInfoFile; };
143 :     /**
144 :     * \brief This function will return the maximum ratio of a stock that can be consumed on any given timestep
145 :     * \return maxratio
146 :     */
147 :     double getMaxRatio() const { return maxratio; };
148 :     private:
149 :     /**
150 :     * \brief This function will read input from a file instead of the command line
151 :     * \param file is the CommentStream to read from
152 :     */
153 :     void read(CommentStream& file);
154 :     /**
155 :     * \brief This is the name of the file that optimisation parameters will be read from
156 :     */
157 :     char* strOptInfoFile;
158 :     /**
159 :     * \brief This is the name of the file that initial values for the model parameters will be read from
160 :     */
161 :     char* strInitialParamFile;
162 :     /**
163 :     * \brief This is the name of the file that the initial model information will be written to
164 :     */
165 :     char* strPrintInitialFile;
166 :     /**
167 :     * \brief This is the name of the file that the final model information will be written to
168 :     */
169 :     char* strPrintFinalFile;
170 :     /**
171 :     * \brief This is the name of the file that the main model information will be read from
172 :     */
173 :     char* strMainGadgetFile;
174 :     /**
175 :     * \brief This is the PrintInfo used to store information about the format the model parameters should be written to file
176 :     */
177 :     PrintInfo printinfo;
178 :     /**
179 :     * \brief This is the flag used to denote whether the optimisation parameters have been given or not
180 :     */
181 :     int givenOptInfo;
182 :     /**
183 :     * \brief This is the flag used to denote whether the initial values for the model parameters have been given or not
184 :     */
185 :     int givenInitialParam;
186 :     /**
187 :     * \brief This is the flag used to denote whether the likelihood score should be optimised or not
188 :     */
189 :     int runoptimise;
190 :     /**
191 :     * \brief This is the flag used to denote whether a simulation run should be performed or not
192 :     */
193 :     int runstochastic;
194 :     /**
195 :     * \brief This is the flag used to denote whether the current simulation has been started using paramin (PVM) or not
196 :     */
197 :     int runnetwork;
198 :     /**
199 :     * \brief This is the flag used to denote whether the current simulation should print model output or not
200 :     */
201 :     int runprint;
202 :     /**
203 :     * \brief This is the flag used to override the default settings and force the model to print model output at the end of an optimisation run
204 :     */
205 :     int forceprint;
206 :     /**
207 :     * \brief This is the flag used to denote whether the initial model information should be printed or not
208 :     */
209 :     int printInitialInfo;
210 :     /**
211 :     * \brief This is the flag used to denote whether the final model information should be printed or not
212 :     */
213 :     int printFinalInfo;
214 :     /**
215 :     * \brief This is the value used to decide on the level of warnings displayed during the model run
216 :     */
217 :     int printLogLevel;
218 :     /**
219 :     * \brief This is the maximum ratio of a stock that can be consumed on any given timestep
220 :     */
221 :     double maxratio;
222 :     };
223 :    
224 :     #endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge