FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTreplanningtask.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifndef FMTreplanningtask_H_INCLUDED
9#define FMTreplanningtask_H_INCLUDED
10
11#include "FMTtask.hpp"
13#include "FMTschedule.hpp"
14#include <vector>
15#include <queue>
16#include <memory>
17#include <string>
18#include "FMTutility.hpp"
19
20
21namespace Models
22{
23 class FMTmodel;
24}
25
26namespace Core
27{
28 class FMToutput;
29}
30
31
32
34namespace Parallel
35{
36 class FMTparallelwriter;
37 // DocString: FMTreplanningtask
44 {
45 // DocString: FMTreplanningtask::resultswriter
47 std::shared_ptr<FMTparallelwriter>resultswriter;
48 // DocString: FMTreplanningtask::baseschedule
50 std::shared_ptr<Core::FMTschedule>baseschedule;
51 // DocString: FMTreplanningtask::global
53 std::shared_ptr<Models::FMTmodel>global;//base area is in here.
54 // DocString: FMTreplanningtask::stochastic
56 std::shared_ptr<Models::FMTmodel>stochastic;
57 // DocString: FMTreplanningtask::local
59 std::shared_ptr<Models::FMTmodel>local;
60 // DocString: FMTreplanningtask::replicateids
62 std::queue<int>replicateids;
63 // DocString: FMTreplanningtask::dynamicarea
65 std::vector<Core::FMTactualdevelopment>dynamicarea;
66 // DocString: FMTreplanningtask::iterationglobalschedule
68 Core::FMTschedule iterationglobalschedule;
69 // DocString: FMTreplanningtask::dynamicconstraints
71 std::vector<Core::FMTconstraint>dynamicconstraints;
72 // DocString: FMTreplanningtask::replanningperiods
74 int replanningperiods;
75 // DocString: FMTreplanningtask::copysharedmodel
80 std::unique_ptr<Models::FMTmodel>copysharedmodel(const std::shared_ptr<Models::FMTmodel>model);
81 // DocString: FMTreplanningtask::domodelplanning
86 std::unique_ptr<Models::FMTmodel>domodelplanning(
87 const std::shared_ptr<Models::FMTmodel>model,
88 const int& replanningperiod,
89 bool getsolutionandlocal = false,
90 bool applyscheduleweight = false,
91 bool setdynamicconstraints=true);
92 // DocString: FMTreplanningtask::writeresults
96 void writeresults(const std::string& modelname,const int& modellength,
97 const std::unique_ptr<Models::FMTmodel>& modelptr, const int& replanningperiod,bool onlyfirstperiod = false);
98 // DocString: FMTreplanningtask::getiteration
102 const int getiteration() const;
103 // DocString: FMTreplanningtask::setreignore
107 void setreignore(std::unique_ptr<Models::FMTmodel>& modelcpy, const int& replanningperiod) const;
108 // DocString: FMTreplanningtask::setreplicate
112 void setreplicate(std::unique_ptr<Models::FMTmodel>& modelcpy, const int& replanningperiod) const;
113 public:
114 // DocString: FMTreplanningtask::FMTreplanningtask()
118 FMTreplanningtask() = default;
119 // DocString: FMTreplanningtask::FMTreplanningtask(const FMTreplanningtask&)
124 // DocString: FMTreplanningtask::operator=(const FMTreplanningtask&)
128 FMTreplanningtask& operator = (const FMTreplanningtask& rhs) = default;
129 // DocString: FMTreplanningtask::~FMTreplanningtask()
133 virtual ~FMTreplanningtask() = default;
134 // DocString: FMTreplanningtask::clone
138 std::unique_ptr<FMTtask>clone() const;
139 // DocString: FMTreplanningtask::FMTreplanningtask(...)
146 const Models::FMTmodel& stochasticm,
147 const Models::FMTmodel& localm,
148 const std::vector<Core::FMToutput>& outputs,
149 const std::string& outputlocation,
150 const std::string& gdaldriver,
151 const std::vector<std::string>& creationoptions,
152 const int& replicates,
153 const int& replanningperiodssize,
154 const double& minimaldrift,
155 Core::FMToutputlevel outputlevel);
156 // DocString: FMTreplanningtask::FMTreplanningtask(const Models::FMTmodel&,const Models::FMTmodel&,const Models::FMTmodel&)
163 const Models::FMTmodel& stochasticm,
164 const Models::FMTmodel& localm,
165 const std::string& outputlocation,
166 const std::string& gdaldriver,
167 const std::vector<std::string>& creationoptions,
168 Core::FMToutputlevel outputlevel);
169 // DocString: FMTreplanningtask::setreplicates
173 void setreplicates(const int& replicatesnumber);
174 // DocString: FMTreplanningtask::setreplanningperiods
178 void setreplanningperiods(const int& periodsnumber);
179 // DocString: FMTreplanningtask::split
183 virtual std::vector<std::unique_ptr<FMTtask>>split(const unsigned int& numberoftasks) const;
184 // DocString: FMTreplanningtask::spwan
188 virtual std::unique_ptr<FMTtask>spawn();
189 // DocString: FMTreplanningtask::work
193 virtual void work();
194 // DocString: FMTreplanningtask::finalize
198 virtual void finalize();
199 // DocString: FMTreplanningtask::passinlogger
203 void passinlogger(const std::shared_ptr<Logging::FMTlogger>& logger) override;
204
205 };
206
207}
208
209
210
211#endif
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTschedule.hpp:31
Definition: FMTmodel.hpp:60
Definition: FMTreplanningtask.hpp:44
FMTreplanningtask(const Models::FMTmodel &globalm, const Models::FMTmodel &stochasticm, const Models::FMTmodel &localm, const std::vector< Core::FMToutput > &outputs, const std::string &outputlocation, const std::string &gdaldriver, const std::vector< std::string > &creationoptions, const int &replicates, const int &replanningperiodssize, const double &minimaldrift, Core::FMToutputlevel outputlevel)
FMTreplanningtask(const Models::FMTmodel &globalm, const Models::FMTmodel &stochasticm, const Models::FMTmodel &localm, const std::string &outputlocation, const std::string &gdaldriver, const std::vector< std::string > &creationoptions, Core::FMToutputlevel outputlevel)
void setreplicates(const int &replicatesnumber)
FMTreplanningtask(const FMTreplanningtask &rhs)=default
void setreplanningperiods(const int &periodsnumber)
virtual std::unique_ptr< FMTtask > spawn()
virtual std::vector< std::unique_ptr< FMTtask > > split(const unsigned int &numberoftasks) const
virtual ~FMTreplanningtask()=default
void passinlogger(const std::shared_ptr< Logging::FMTlogger > &logger) override
std::unique_ptr< FMTtask > clone() const
Definition: FMTtask.hpp:28
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
FMToutputlevel
Definition: FMTutility.hpp:17
Namespace containing all enumerator and classes used to construct or manipulate the different type of...
Definition: FMTareaparser.hpp:50
Namespace for parallel tasking may include multithreading / multiprocessing.
Definition: FMTopareaschedulertask.hpp:40