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 11 - (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 : ulcessvp 11 //FIXME doc
74 :     int runOmp() const { return runomp; };
75 : agomez 1 /**
76 :     * \brief This function will return the flag used to determine whether a simulation run should be performed
77 :     * \return flag
78 :     */
79 :     int runStochastic() const { return runstochastic; };
80 :     /**
81 :     * \brief This function will return the flag used to determine whether the current simulation has been started using paramin
82 :     * \return flag
83 :     */
84 :     int runNetwork() const { return runnetwork; };
85 :     /**
86 :     * \brief This function will return the flag used to determine whether the current simulation should print the model output
87 :     * \return flag
88 :     */
89 :     int runPrint() const { return runprint; };
90 :     /**
91 :     * \brief This function will return the flag used to determine whether the optimisation parameters have been given
92 :     * \return flag
93 :     */
94 :     int getOptInfoGiven() const { return givenOptInfo; };
95 :     /**
96 :     * \brief This function will return the flag used to determine whether the initial values for the model parameters have been given
97 :     * \return flag
98 :     */
99 :     int getInitialParamGiven() const { return givenInitialParam; };
100 :     /**
101 :     * \brief This function will return the flag used to force the model to print the model output to file
102 :     * \return flag
103 :     */
104 :     int getForcePrint() const { return forceprint; };
105 :     /**
106 :     * \brief This function will return the PrintInfo used to store printing information
107 :     * \return pi, the PrintInfo containing the printing information
108 :     */
109 :     PrintInfo getPI() const { return printinfo; };
110 :     /**
111 :     * \brief This function will return the flag used to determine whether the initial model information should be printed to file
112 :     * \return flag
113 :     */
114 :     int printInitial() const { return printInitialInfo; };
115 :     /**
116 :     * \brief This function will return the flag used to determine whether the final model information should be printed to file
117 :     * \return flag
118 :     */
119 :     int printFinal() const { return printFinalInfo; };
120 :     /**
121 :     * \brief This function will return the filename that the initial values for the model parameters will be read from
122 :     * \return filename
123 :     */
124 :     char* getInitialParamFile() const { return strInitialParamFile; };
125 :     /**
126 :     * \brief This function will return the filename that the initial model information will be written to
127 :     * \return filename
128 :     */
129 :     char* getPrintInitialFile() const { return strPrintInitialFile; };
130 :     /**
131 :     * \brief This function will return the filename that the final model information will be written to
132 :     * \return filename
133 :     */
134 :     char* getPrintFinalFile() const { return strPrintFinalFile; };
135 :     /**
136 :     * \brief This function will return the filename that the main model information will be read from
137 :     * \return filename
138 :     */
139 :     char* getMainGadgetFile() const { return strMainGadgetFile; };
140 :     /**
141 :     * \brief This function will return the filename that the optimisation information will be read from
142 :     * \return filename
143 :     */
144 :     char* getOptInfoFile() const { return strOptInfoFile; };
145 :     /**
146 :     * \brief This function will return the maximum ratio of a stock that can be consumed on any given timestep
147 :     * \return maxratio
148 :     */
149 : ulcessvp 11 double getMaxRatio() const {
150 :     return maxratio;
151 :     }
152 :     unsigned* getSeed() const {return seed;}
153 :     // unsigned getSeedM() const {return seedM;}
154 :     // unsigned getSeedP() const {return seedP;}
155 :    
156 :     ;
157 :    
158 :    
159 : agomez 1 private:
160 :     /**
161 :     * \brief This function will read input from a file instead of the command line
162 :     * \param file is the CommentStream to read from
163 :     */
164 :     void read(CommentStream& file);
165 :     /**
166 :     * \brief This is the name of the file that optimisation parameters will be read from
167 :     */
168 :     char* strOptInfoFile;
169 :     /**
170 :     * \brief This is the name of the file that initial values for the model parameters will be read from
171 :     */
172 :     char* strInitialParamFile;
173 :     /**
174 :     * \brief This is the name of the file that the initial model information will be written to
175 :     */
176 :     char* strPrintInitialFile;
177 :     /**
178 :     * \brief This is the name of the file that the final model information will be written to
179 :     */
180 :     char* strPrintFinalFile;
181 :     /**
182 :     * \brief This is the name of the file that the main model information will be read from
183 :     */
184 :     char* strMainGadgetFile;
185 :     /**
186 :     * \brief This is the PrintInfo used to store information about the format the model parameters should be written to file
187 :     */
188 :     PrintInfo printinfo;
189 :     /**
190 :     * \brief This is the flag used to denote whether the optimisation parameters have been given or not
191 :     */
192 :     int givenOptInfo;
193 :     /**
194 :     * \brief This is the flag used to denote whether the initial values for the model parameters have been given or not
195 :     */
196 :     int givenInitialParam;
197 :     /**
198 :     * \brief This is the flag used to denote whether the likelihood score should be optimised or not
199 :     */
200 :     int runoptimise;
201 :     /**
202 :     * \brief This is the flag used to denote whether a simulation run should be performed or not
203 :     */
204 :     int runstochastic;
205 :     /**
206 :     * \brief This is the flag used to denote whether the current simulation has been started using paramin (PVM) or not
207 :     */
208 :     int runnetwork;
209 : ulcessvp 11 //FIXME doc
210 :     int runomp;
211 : agomez 1 /**
212 :     * \brief This is the flag used to denote whether the current simulation should print model output or not
213 :     */
214 :     int runprint;
215 :     /**
216 :     * \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
217 :     */
218 :     int forceprint;
219 :     /**
220 :     * \brief This is the flag used to denote whether the initial model information should be printed or not
221 :     */
222 :     int printInitialInfo;
223 :     /**
224 :     * \brief This is the flag used to denote whether the final model information should be printed or not
225 :     */
226 :     int printFinalInfo;
227 :     /**
228 :     * \brief This is the value used to decide on the level of warnings displayed during the model run
229 :     */
230 :     int printLogLevel;
231 :     /**
232 :     * \brief This is the maximum ratio of a stock that can be consumed on any given timestep
233 :     */
234 :     double maxratio;
235 : ulcessvp 11
236 :     //FIXME doc
237 :     //see[0] = seed; see[1] = seedM; see[2] = seedP;
238 :     unsigned* seed;
239 :     // unsigned seed = 0;
240 :     // unsigned seedM = 0;
241 :     // unsigned seedP = 0;
242 : agomez 1 };
243 :    
244 :     #endif
245 : ulcessvp 11

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

Powered By FusionForge