FFSM++ 1.1.0
French Forest Sector Model ++
Loading...
Searching...
No Matches
Output.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 STDOUTPUT_H
23#define STDOUTPUT_H
24
25// Core C++ headers
26#include <string>
27#include <vector>
28#include <map>
29#include <stdexcept>
30#include <iostream>
31#include <sstream>
32#include <time.h>
33#include <tr1/array>
34
35//regmas headers
36#include "BaseClass.h"
37
38
39class Pixel;
40
41
42/// %Output methods
43
44/**
45Class responsable to output the data, both as all kind of log as well as georeferenciated one.
46@author Antonello Lobianco
47*/
48class Output: public BaseClass{
49public:
50 Output(ThreadManager* MTHREAD_h); ///< Constructor
51 ~Output();
52
53 void initOutput();
54 void commonInit();
55 void initOutputMaps();
59 void initDebugOutput();
61 void initCarbonBalance();
62 void print(bool earlyPrint=true); ///< Print output. If earlyPrinting it doesn't print some stuff for which we don't yet have values
63 void printMaps();
64 void printForestData(bool finalFlush);
65 void printProductData(bool finalFlush);
66 void printCarbonBalance();
67 void printFinalOutput();
68 void printDebugOutput();
69 void printDetailedHV(map<tr1::array<string, 4>,double> hVol_byPrd);
71 void printOptLog(bool optimal, int &nIterations, double &obj);
73 void cleanScenario(string fileName, string scenarioName, char d);
74
75 vector <vector < vector <vector <vector <double> > > > > expReturnsDebug; ///< l2_region, for type, d.c., pr prod, variable name
76 vector <string> expReturnsDebugVariables;
77
78private:
79 int oLevel;
80 char d;
81 int inYear;
82 int nYears;
83 string baseDir;
84 string oDir;
86 string oFileExt;
89 vector<int> oYears; // list of output years for data
90 vector<int> mapsOYears; // list of output years for maps
94 vector <string> outForVariables;
95 vector <string> outProdVariables;
101 vector<string> priPr;
102 vector<string> secPr;
103 vector<string> allPr;
104 vector<int> l1regIds;
105 vector < vector <int> > l2r;
106 vector <string> fTypes;
107 vector <string> dClasses; /// includes an empty string for variables without diameter attribute
108 vector <string> pDClasses; ///< production diameter classes: exclude the fist diameter class below 15 cm
112 int nL2r;
116 bool spMode; // spatial mode
117};
118#endif
This file is the header of BaseClass and it is included by ALL compiled code.
Base class for the regmas application.
Definition BaseClass.h:239
Output methods
Definition Output.h:48
vector< string > fTypes
Definition Output.h:106
int nAllPr
Definition Output.h:111
string oFileExt
Definition Output.h:86
string debugFilename
Definition Output.h:114
int wRegId_l1
Definition Output.h:91
void printMaps()
Definition Output.cpp:451
void initOutputForestData()
Definition Output.cpp:296
int nSecPr
Definition Output.h:110
void printDebugPixelValues()
Definition Output.cpp:880
void initDebugOutput()
Definition Output.cpp:170
~Output()
Definition Output.cpp:41
int nYears
Definition Output.h:82
vector< vector< int > > l2r
Definition Output.h:105
vector< string > priPr
Definition Output.h:101
void printDebugOutput()
Definition Output.cpp:843
void commonInit()
Definition Output.cpp:61
char getOutputFieldDelimiter()
Definition Output.cpp:802
void printFinalOutput()
Definition Output.cpp:462
vector< vector< vector< vector< vector< double > > > > > expReturnsDebug
l2_region, for type, d.c., pr prod, variable name
Definition Output.h:75
int nPriPr
Definition Output.h:109
void initOutput()
Definition Output.cpp:48
bool oSingleFile
Definition Output.h:88
bool spMode
Definition Output.h:116
bool oCarbonData
Definition Output.h:98
bool oForData
Definition Output.h:96
char d
Definition Output.h:80
void initOutputProductData()
Definition Output.cpp:338
void initDebugPixelValues()
Definition Output.cpp:207
vector< string > outProdVariables
Definition Output.h:95
void cleanScenario(string fileName, string scenarioName, char d)
Definition Output.cpp:1149
string baseDir
Definition Output.h:83
bool oHRedeable
Definition Output.h:87
vector< int > oYears
Definition Output.h:89
vector< string > expReturnsDebugVariables
Definition Output.h:76
string logFilename
Definition Output.h:113
string outFileName
Definition Output.h:93
int nL2r
Definition Output.h:112
int inYear
Definition Output.h:81
string debugPxValuesFilename
Definition Output.h:115
int oLevel
Definition Output.h:79
void printForestData(bool finalFlush)
Definition Output.cpp:474
void initOutputMaps()
Definition Output.cpp:406
string scenarioName
Definition Output.h:85
void printOptLog(bool optimal, int &nIterations, double &obj)
Definition Output.cpp:827
void printProductData(bool finalFlush)
Definition Output.cpp:589
int wRegId_l2
Definition Output.h:92
void print(bool earlyPrint=true)
Print output. If earlyPrinting it doesn't print some stuff for which we don't yet have values.
Definition Output.cpp:426
void printDetailedHV(map< tr1::array< string, 4 >, double > hVol_byPrd)
Definition Output.cpp:1173
vector< string > dClasses
Definition Output.h:107
void initOptimisationLog()
Definition Output.cpp:131
vector< string > pDClasses
includes an empty string for variables without diameter attribute
Definition Output.h:108
vector< string > allPr
Definition Output.h:103
void printCarbonBalance()
Definition Output.cpp:727
bool forestDiamDetailedOutput
Definition Output.h:100
vector< int > mapsOYears
Definition Output.h:90
void initCarbonBalance()
Definition Output.cpp:370
int outStepRange
Definition Output.h:99
vector< string > secPr
Definition Output.h:102
vector< int > l1regIds
Definition Output.h:104
string oDir
Definition Output.h:84
vector< string > outForVariables
Definition Output.h:94
bool oProdData
Definition Output.h:97
Pixel-level class.
Definition Pixel.h:47
Thread manager. Responsable to manage the main thread and "speak" with the GUI.