FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTplanningtask.hpp>
Public Member Functions | |
FMTplanningtask ()=default | |
FMTplanningtask (const FMTplanningtask &rhs) | |
FMTplanningtask & | operator= (const FMTplanningtask &rhs) |
virtual | ~FMTplanningtask ()=default |
std::unique_ptr< FMTtask > | clone () const |
void | setkeepmodels () |
void | push_back (const Models::FMTmodel &model, std::vector< Core::FMTschedule >schedules=std::vector< Core::FMTschedule >(), std::vector< Core::FMToutput >louputs=std::vector< Core::FMToutput >()) |
FMTplanningtask (const int &minoutputperiod, const int &maxoutputperiod, const std::string &outputlocation, std::string gdaldriver="CSV", std::vector< std::string >creationoptions=std::vector< std::string >(), Core::FMToutputlevel outputlevel=Core::FMToutputlevel::standard, std::string primaryfilelocatiron=std::string()) | |
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 |
template<class ptrtype > | |
const std::vector< const ptrtype * > | getmodelsfromdynamiccast () const |
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. | |
This task make it easier to carry multiple parallel optimization of different FMTmodel using the doplanning function.
|
default |
Default constructor for FMTplanningtask
Parallel::FMTplanningtask::FMTplanningtask | ( | const FMTplanningtask & | rhs | ) |
Default copy constructor for FMTplanningtask
|
virtualdefault |
We need to define a destructor to take care of writing drift probabilities.
Parallel::FMTplanningtask::FMTplanningtask | ( | const int & | minoutputperiod, |
const int & | maxoutputperiod, | ||
const std::string & | outputlocation, | ||
std::string | gdaldriver = "CSV" , |
||
std::vector< std::string > | creationoptions = std::vector< std::string >() , |
||
Core::FMToutputlevel | outputlevel = Core::FMToutputlevel::standard , |
||
std::string | primaryfilelocatiron = std::string() |
||
) |
You need to initialize the task mainly with the output parser parameters.
|
virtual |
Clone function for FMTplanningtask
Reimplemented from Parallel::FMTtask.
|
virtual |
Do nothing...
Reimplemented from Parallel::FMTtask.
|
inline |
Get the models pointer casted in a given model type.
FMTplanningtask & Parallel::FMTplanningtask::operator= | ( | const FMTplanningtask & | rhs | ) |
Default copy assignement for FMTplanningtask
|
overridevirtual |
Pass the logger
Reimplemented from Core::FMTobject.
void Parallel::FMTplanningtask::push_back | ( | const Models::FMTmodel & | model, |
std::vector< Core::FMTschedule > | schedules = std::vector< Core::FMTschedule >() , |
||
std::vector< Core::FMToutput > | louputs = std::vector< Core::FMToutput >() |
||
) |
Push a new FMTmodel in the task queue with optional schedule. Dont forget to just keep FMToutput that you want to get values in the FMTmodel.
void Parallel::FMTplanningtask::setkeepmodels | ( | ) |
This function will force the task to keep the models... may consume memory.
|
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 planning.
Reimplemented from Parallel::FMTtask.
|
virtual |
Main function that do the planning task
Reimplemented from Parallel::FMTtask.