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 12 - (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 : ulcessvp 12 double getMaxRatio() const {
148 :     return maxratio;
149 :     }
150 :     /**
151 :     * \brief This function will return seeds used in SA
152 :     * \return seed array of unsigned int with the seeds used in SA
153 :     */
154 :     unsigned* getSeed() const {return seed;};
155 : ulcessvp 11
156 :    
157 : agomez 1 private:
158 :     /**
159 :     * \brief This function will read input from a file instead of the command line
160 :     * \param file is the CommentStream to read from
161 :     */
162 :     void read(CommentStream& file);
163 :     /**
164 :     * \brief This is the name of the file that optimisation parameters will be read from
165 :     */
166 :     char* strOptInfoFile;
167 :     /**
168 :     * \brief This is the name of the file that initial values for the model parameters will be read from
169 :     */
170 :     char* strInitialParamFile;
171 :     /**
172 :     * \brief This is the name of the file that the initial model information will be written to
173 :     */
174 :     char* strPrintInitialFile;
175 :     /**
176 :     * \brief This is the name of the file that the final model information will be written to
177 :     */
178 :     char* strPrintFinalFile;
179 :     /**
180 :     * \brief This is the name of the file that the main model information will be read from
181 :     */
182 :     char* strMainGadgetFile;
183 :     /**
184 :     * \brief This is the PrintInfo used to store information about the format the model parameters should be written to file
185 :     */
186 :     PrintInfo printinfo;
187 :     /**
188 :     * \brief This is the flag used to denote whether the optimisation parameters have been given or not
189 :     */
190 :     int givenOptInfo;
191 :     /**
192 :     * \brief This is the flag used to denote whether the initial values for the model parameters have been given or not
193 :     */
194 :     int givenInitialParam;
195 :     /**
196 :     * \brief This is the flag used to denote whether the likelihood score should be optimised or not
197 :     */
198 :     int runoptimise;
199 :     /**
200 :     * \brief This is the flag used to denote whether a simulation run should be performed or not
201 :     */
202 :     int runstochastic;
203 :     /**
204 :     * \brief This is the flag used to denote whether the current simulation has been started using paramin (PVM) or not
205 :     */
206 :     int runnetwork;
207 :     /**
208 :     * \brief This is the flag used to denote whether the current simulation should print model output or not
209 :     */
210 :     int runprint;
211 :     /**
212 :     * \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
213 :     */
214 :     int forceprint;
215 :     /**
216 :     * \brief This is the flag used to denote whether the initial model information should be printed or not
217 :     */
218 :     int printInitialInfo;
219 :     /**
220 :     * \brief This is the flag used to denote whether the final model information should be printed or not
221 :     */
222 :     int printFinalInfo;
223 :     /**
224 :     * \brief This is the value used to decide on the level of warnings displayed during the model run
225 :     */
226 :     int printLogLevel;
227 :     /**
228 :     * \brief This is the maximum ratio of a stock that can be consumed on any given timestep
229 :     */
230 :     double maxratio;
231 : ulcessvp 12 /**
232 :     * \brief vector with the seeds used in SA
233 :     * \note see[0] = seed | see[1] = seedM | see[2] = seedP
234 :     */
235 : ulcessvp 11 unsigned* seed;
236 : agomez 1 };
237 :    
238 :     #endif
239 : ulcessvp 11

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

Powered By FusionForge