FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Parallel::FMTplanningtask Class Reference

#include <FMTplanningtask.hpp>

Inheritance diagram for Parallel::FMTplanningtask:
[legend]
Collaboration diagram for Parallel::FMTplanningtask:
[legend]

Public Member Functions

 FMTplanningtask ()=default
 
 FMTplanningtask (const FMTplanningtask &rhs)
 
FMTplanningtaskoperator= (const FMTplanningtask &rhs)
 
virtual ~FMTplanningtask ()=default
 
std::unique_ptr< FMTtaskclone () 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< FMTtaskspawn ()
 
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)
 
FMTtaskoperator= (const FMTtask &rhs)
 
virtual std::unique_ptr< FMTtaskclone () const
 
virtual std::vector< std::unique_ptr< FMTtask > > split (const unsigned int &numberoftasks) const
 
virtual std::unique_ptr< FMTtaskspawn ()
 
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)
 
FMTobjectoperator= (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::FMTloggertasklogger
 
- 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.
 

Detailed Description

This task make it easier to carry multiple parallel optimization of different FMTmodel using the doplanning function.

Constructor & Destructor Documentation

◆ FMTplanningtask() [1/3]

Parallel::FMTplanningtask::FMTplanningtask ( )
default

Default constructor for FMTplanningtask

◆ FMTplanningtask() [2/3]

Parallel::FMTplanningtask::FMTplanningtask ( const FMTplanningtask rhs)

Default copy constructor for FMTplanningtask

◆ ~FMTplanningtask()

virtual Parallel::FMTplanningtask::~FMTplanningtask ( )
virtualdefault

We need to define a destructor to take care of writing drift probabilities.

◆ FMTplanningtask() [3/3]

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.

Member Function Documentation

◆ clone()

std::unique_ptr< FMTtask > Parallel::FMTplanningtask::clone ( ) const
virtual

Clone function for FMTplanningtask

Reimplemented from Parallel::FMTtask.

◆ finalize()

virtual void Parallel::FMTplanningtask::finalize ( )
virtual

Do nothing...

Reimplemented from Parallel::FMTtask.

◆ getmodelsfromdynamiccast()

template<class ptrtype >
const std::vector< const ptrtype * > Parallel::FMTplanningtask::getmodelsfromdynamiccast ( ) const
inline

Get the models pointer casted in a given model type.

◆ operator=()

FMTplanningtask & Parallel::FMTplanningtask::operator= ( const FMTplanningtask rhs)

Default copy assignement for FMTplanningtask

◆ passinlogger()

void Parallel::FMTplanningtask::passinlogger ( const std::shared_ptr< Logging::FMTlogger > &  logger)
overridevirtual

Pass the logger

Reimplemented from Core::FMTobject.

◆ push_back()

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.

◆ setkeepmodels()

void Parallel::FMTplanningtask::setkeepmodels ( )

This function will force the task to keep the models... may consume memory.

◆ spawn()

virtual std::unique_ptr< FMTtask > Parallel::FMTplanningtask::spawn ( )
virtual

Will spawn a minimal task from the master task

Reimplemented from Parallel::FMTtask.

◆ split()

virtual std::vector< std::unique_ptr< FMTtask > > Parallel::FMTplanningtask::split ( const unsigned int &  numberoftasks) const
virtual

The split fonction that split the main task into multiple tasks of planning.

Reimplemented from Parallel::FMTtask.

◆ work()

virtual void Parallel::FMTplanningtask::work ( )
virtual

Main function that do the planning task

Reimplemented from Parallel::FMTtask.


The documentation for this class was generated from the following file: