FFSM++  1.1.0
French Forest Sector Model ++
Init.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2015 by Laboratoire d'Economie Forestière *
3  * http://ffsm-project.org *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version, given the compliance with the *
9  * exceptions listed in the file COPYING that is distribued together *
10  * with this file. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the *
19  * Free Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  ***************************************************************************/
22 #ifndef STDINIT_H
23 #define STDINIT_H
24 
25 #include <time.h>
26 
27 #include <string>
28 #include <vector>
29 #include <stdexcept>
30 #include <iostream>
31 #include <sstream>
32 
33 // FFSM include stuff..
34 #include "BaseClass.h"
35 #include "ModelData.h"
36 #include "Gis.h"
37 
38 /// %Init the environment, the objects and the agents of the model
39 /**
40 The Init class is responsable to ask to the various objects to Init themself, in a 7-steps procedures.
41 <br>The basic idea is to first init the environment: options, settings and space.
42 <br>Then objects and agents are mould up, objects are assigned to agents and finally agents and objects are collocated in the space.
43 @author Antonello Lobianco
44 */
45 class Init: public BaseClass{
46 
47 public:
48 
49  Init(ThreadManager* MTHREAD_h);
50  ~Init();
51  /// Wrapper to the correct setInitLevelX()
52  void setInitLevel(int level_h);
53  /// Unused, reserver for future use
54  void setInitLevel0();
55  /// Setting up the space, the model objects and the agents (definitions only)
56  void setInitLevel1();
57  /// Unused, reserver for future use
58  void setInitLevel2();
59  /// Linking object to agents and assigning space proprieties to objects and agents
60  void setInitLevel3();
61  /// Unused, reserver for future use
62  void setInitLevel4();
63  /// Simulation start
64  void setInitLevel5();
65  /// End of simulation (e.g. print summary statistics)
66  void setInitLevel6();
67  int getInitState(){return InitState;};
68 
69 private:
70  int InitState; ///< One of the 7 possible init states (0..6)
71  struct tm *current;
72  time_t now;
73 };
74 
75 #endif
Init the environment, the objects and the agents of the model
Definition: Init.h:45
void setInitLevel6()
End of simulation (e.g. print summary statistics)
Definition: Init.cpp:181
Thread manager. Responsable to manage the main thread and "speak" with the GUI.
Definition: ThreadManager.h:65
void setInitLevel2()
Unused, reserver for future use.
Definition: Init.cpp:148
int InitState
One of the 7 possible init states (0..6)
Definition: Init.h:67
void setInitLevel0()
Unused, reserver for future use.
Definition: Init.cpp:78
~Init()
Definition: Init.cpp:43
void setInitLevel5()
Simulation start.
Definition: Init.cpp:175
Base class for the regmas application.
Definition: BaseClass.h:239
Init(ThreadManager *MTHREAD_h)
Definition: Init.cpp:38
void setInitLevel3()
Linking object to agents and assigning space proprieties to objects and agents.
Definition: Init.cpp:156
void setInitLevel(int level_h)
Wrapper to the correct setInitLevelX()
Definition: Init.cpp:48
void setInitLevel1()
Setting up the space, the model objects and the agents (definitions only)
Definition: Init.cpp:94
struct tm * current
Definition: Init.h:71
This file is the header of BaseClass and it is included by ALL compiled code.
void setInitLevel4()
Unused, reserver for future use.
Definition: Init.cpp:167
int getInitState()
Definition: Init.h:67
time_t now
Definition: Init.h:72