FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTreplanningtask.hpp>
Public Member Functions | |
FMTreplanningtask ()=default | |
FMTreplanningtask (const FMTreplanningtask &rhs)=default | |
FMTreplanningtask & | operator= (const FMTreplanningtask &rhs)=default |
virtual | ~FMTreplanningtask ()=default |
std::unique_ptr< FMTtask > | clone () const |
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) |
void | setreplanningperiods (const int &periodsnumber) |
virtual std::vector< std::unique_ptr< FMTtask > > | split (const unsigned int &numberoftasks) const |
virtual std::unique_ptr< FMTtask > | spawn () |
virtual void | work () |
virtual void | finalize () |
void | passinlogger (const std::shared_ptr< Logging::FMTlogger > &logger) override |
Public Member Functions inherited from Parallel::FMTtask | |
FMTtask () | |
virtual | ~FMTtask ()=default |
FMTtask (const FMTtask &rhs) | |
FMTtask & | operator= (const FMTtask &rhs) |
virtual std::unique_ptr< FMTtask > | clone () const |
virtual std::vector< std::unique_ptr< FMTtask > > | split (const unsigned int &numberoftasks) const |
virtual std::unique_ptr< FMTtask > | spawn () |
virtual void | work () |
virtual void | finalize () |
bool | isdone () const |
std::string | getthreadid () const |
Public Member Functions inherited from Core::FMTobject | |
FMTobject () | |
virtual | ~FMTobject () |
FMTobject (const std::shared_ptr< Exception::FMTexceptionhandler > exhandler) | |
FMTobject (const FMTobject &rhs) | |
FMTobject & | operator= (const FMTobject &rhs) |
virtual void | passinlogger (const std::shared_ptr< Logging::FMTlogger > &logger) |
void | passinexceptionhandler (const std::shared_ptr< Exception::FMTexceptionhandler > &exhandler) |
void | redirectlogtofile (const std::string &location) |
virtual void | setdefaultlogger () |
virtual void | setquietlogger () |
virtual void | settasklogger () |
virtual void | setdebuglogger () |
void | setdefaultexceptionhandler () |
void | setquietexceptionhandler () |
void | setdebugexceptionhandler () |
void | setfreeexceptionhandler () |
void | disablenestedexceptions () |
void | enablenestedexceptions () |
void | seterrorstowarnings (const std::vector< Exception::FMTexc > &errors) |
void | setmaxwarningsbeforesilenced (const size_t &maxwarningcount) |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::FMTobject | |
static std::string | getruntimelocation () |
static unsigned long long | getavailablememory () |
Protected Member Functions inherited from Parallel::FMTtask | |
void | setstatus (bool status) |
std::vector< size_t > | splitwork (int numberoftasks, const int &totalworksize) const |
Protected Member Functions inherited from Core::FMTobject | |
template<class Archive > | |
void | forcesave (Archive &ar, const unsigned int version) const |
template<class Archive > | |
void | forceload (Archive &ar, const unsigned int version) |
void | checksignals () const |
void | setCPLhandler () |
Static Protected Member Functions inherited from Core::FMTobject | |
static std::chrono::time_point< std::chrono::high_resolution_clock > | getclock () |
template<class chrono > | |
static double | getduration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
static std::string | getdurationinseconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
Protected Attributes inherited from Parallel::FMTtask | |
std::unique_ptr< Logging::FMTlogger > | tasklogger |
Static Protected Attributes inherited from Parallel::FMTtask | |
static boost::recursive_mutex | taskmutex |
Recursive mutex for the task. | |
Static Protected Attributes inherited from Core::FMTobject | |
static std::shared_ptr< Exception::FMTexceptionhandler > | _exhandler |
A shared pointer to the exception handler. | |
static std::shared_ptr< Logging::FMTlogger > | _logger |
A shared pointer to the logger. | |
The replanning uses global/stochastic/local as abstract model to simulate natural disturbances
over a certain amount of replanning periods for multiple replications. Those replications may generate different results caused by the pseudo random constraints and seed used in the simulations / optimization of each abstract models.
|
default |
Default constructor for FMTreplanningtask
|
default |
Default copy constructor for FMTreplanningtask
|
virtualdefault |
Default destructor
Parallel::FMTreplanningtask::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 | ||
) |
The models need to have common sections, outputs to write,outputlocation(outfile), gdaldriver of the output file, the number of replicates, the number of replanning period and the weight of the global schedule applied to the localschedule.
Parallel::FMTreplanningtask::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 | ||
) |
Short constructor for replanning task will use the output of globalmodel as outputs. 0.5 as minimal drift... You then need to set the number of replanning periods,globalweight, and the number of replicates.
|
virtual |
Clone function for FMTreplanningtask
Reimplemented from Parallel::FMTtask.
|
virtual |
We need to take care of writing drift probabilities.
Reimplemented from Parallel::FMTtask.
|
default |
Default copy assignement for FMTreplanningtask
|
overridevirtual |
Pass the logger
Reimplemented from Core::FMTobject.
void Parallel::FMTreplanningtask::setreplanningperiods | ( | const int & | periodsnumber | ) |
Set the number oof replanning periods.
void Parallel::FMTreplanningtask::setreplicates | ( | const int & | replicatesnumber | ) |
Set the number of replicates to use...
|
virtual |
Will spawn a minimal task from the master task
Reimplemented from Parallel::FMTtask.
|
virtual |
The split fonction that split the main task into multiple tasks of replanning.
Reimplemented from Parallel::FMTtask.
|
virtual |
Main function that do the replanning task
Reimplemented from Parallel::FMTtask.