FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTyields.hpp>
Public Member Functions | |
void | generatedefaultyields (const std::vector< Core::FMTtheme > &themes) |
void | swap (FMTyields &rhs) |
bool | gotyieldtype (FMTyldtype type) const |
void | setactionsmappingtomodelhandlers (const std::vector< int > &actionids) |
std::vector< std::string > | getallyieldnames () const |
FMTyields () | |
~FMTyields ()=default | |
FMTyields (const FMTyields &rhs) | |
FMTyields & | operator= (const FMTyields &rhs) |
void | clearcache () final |
bool | isyld (const std::string &value, bool fromsource=false) const |
bool | isnullyld (const std::string &value) const |
int | getage (const FMTyieldrequest &request, const FMTspec &spec) const |
std::map< std::string, std::map< std::string, std::vector< double > > > | getallyields (const FMTtheme &target, FMTyldtype type) const |
bool | operator== (const FMTyields &rhs) const |
bool | operator!= (const FMTyields &rhs) const |
void | update () override |
FMTyields | presolve (const FMTmaskfilter &filter, const std::vector< FMTtheme > &originalthemes, const std::vector< FMTtheme > &newthemes) const |
std::vector< std::string > | getstacked () const |
FMTyields | getfromfactor (const double &factor, std::vector< std::string >yieldnames=std::vector< std::string >()) const |
double | get (const FMTyieldrequest &request, const std::string &yld) const |
void | push_backagehandler (const FMTmask &mask, const FMTageyieldhandler &value) |
void | push_backtimehandler (const FMTmask &mask, const FMTtimeyieldhandler &value) |
Public Member Functions inherited from Core::FMTlist< std::unique_ptr< FMTyieldhandler > > | |
Core::FMTlist< std::unique_ptr< FMTyieldhandler > > & | operator+= (const Core::FMTlist< std::unique_ptr< FMTyieldhandler > > &OtherList) |
append OtherList to this list actions both list had to be non shrinked, will throw exception if shrinked. | |
void | swap (Core::FMTlist< std::unique_ptr< FMTyieldhandler > > &rhs) |
FMTmask | getunion (const std::vector< FMTtheme > &themes) const |
FMTlist () | |
FMTlist (const FMTlist< std::unique_ptr< FMTyieldhandler > > &rhs) | |
FMTlist & | operator= (const FMTlist< std::unique_ptr< FMTyieldhandler > > &rhs) |
bool | operator== (const FMTlist< std::unique_ptr< FMTyieldhandler > > &rhs) const |
~FMTlist ()=default | |
bool | empty () const |
bool | canshrink () const |
virtual void | clearcache () |
size_t | size () const |
std::vector< const std::unique_ptr< FMTyieldhandler > * > | findsets (const FMTmask &mask) const |
std::vector< const std::unique_ptr< FMTyieldhandler > * > | findsetswithfiltered (const FMTmask &newkey) const |
FMTmask | filtermask (const FMTmask &basemask) const |
void | shrink () |
void | unshrink (const std::vector< FMTtheme > &themes) |
void | APIpush_back (const FMTmask &mask, const std::unique_ptr< FMTyieldhandler > &value) |
void | push_back (const FMTmask &mask, const std::unique_ptr< FMTyieldhandler > &value) |
void | push_back (const FMTlist< std::unique_ptr< FMTyieldhandler > > &rhs) |
void | push_back (const FMTmask &mask, const std::unique_ptr< Core::FMTyieldhandler > &value) |
virtual void | update () |
void | push_front (const FMTmask &mask, const std::unique_ptr< FMTyieldhandler > &value) |
void | pop_back () |
void | erase (const size_t &location) |
void | insert (const size_t &location, const FMTmask &mask, const std::unique_ptr< FMTyieldhandler > &value) |
void | insert (const size_t &location, const FMTmask &mask, const std::unique_ptr< Core::FMTyieldhandler > &value) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () 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) |
Friends | |
class | boost::serialization::access |
class | FMTyieldrequest |
Additional Inherited Members | |
Public Types inherited from Core::FMTlist< std::unique_ptr< FMTyieldhandler > > | |
typedef std::vector< std::pair< FMTmask, std::unique_ptr< FMTyieldhandler > > >::value_type | value_type |
Value typedef of the FMTlist. | |
typedef std::vector< std::pair< FMTmask, std::unique_ptr< FMTyieldhandler > > >::iterator | iterator |
Iterator typedef of the FMTlist. | |
typedef std::vector< std::pair< FMTmask, std::unique_ptr< FMTyieldhandler > > >::const_iterator | const_iterator |
Const_Iterator typedef of the FMTlist. | |
Static Public Member Functions inherited from Core::FMTobject | |
static std::string | getruntimelocation () |
static unsigned long long | getavailablememory () |
Protected Member Functions inherited from Core::FMTlist< std::unique_ptr< FMTyieldhandler > > | |
void | compressmasks (std::vector< FMTtheme > &newthemes) |
void | compressmasks (std::vector< FMTtheme > &newthemes) |
void | presolvelist (const FMTmaskfilter &filter, const std::vector< FMTtheme > &originalthemes, const std::vector< FMTtheme > &newthemes) |
void | copydata (const Core::FMTlist< std::unique_ptr< FMTyieldhandler > > &rhs) |
void | copydata (const FMTlist< std::unique_ptr< Core::FMTyieldhandler > > &rhs) |
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) |
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. | |
FMTyields is one FMTlist containing multiple yieldhandlers has seen in the yield section. FMTyields hold all the information related to the forest productivity this class is sometime super large. FMTyields is a class used to check if a given FMTdevelopement can be operable to an action, calculate outputs, constraints and disturb a forest stand in a FMTtransition.
Core::FMTyields::FMTyields | ( | ) |
Default constructor for FMTyields.
|
default |
Default destructor for FMTyields.
|
finalvirtual |
Clear caching from all FMTdata.
Reimplemented from Core::FMTlist< std::unique_ptr< FMTyieldhandler > >.
void Core::FMTyields::generatedefaultyields | ( | const std::vector< Core::FMTtheme > & | themes | ) |
Generate the default yields like _TSLA in the yield class.
double Core::FMTyields::get | ( | const FMTyieldrequest & | request, |
const std::string & | yld | ||
) | const |
This function is the main function used to get the yields value (targets) for a given FMTdevelopement (dev), looking at age,period,lock,mask etc... it returns a map of yield name (keys) and there vlues(items).
int Core::FMTyields::getage | ( | const FMTyieldrequest & | request, |
const FMTspec & | spec | ||
) | const |
This function is the main function used to get the yields value (targets) for a given FMTdevelopement (dev), looking at age,period,lock,mask etc... it returns a map of yield name (keys) and there vlues(items). This function is the main function used to get the yield value (target) for a given FMTdevelopement (dev), looking at age,period,lock,mask etc... it returns the yield value. This function gets the yields used and its values (map) by a given specification (spec) for a given developement (dev). This function is used to get the new age of a FMTdevelopement (dev) when disturbed by a given FMTtransition specification (sepc).
std::vector< std::string > Core::FMTyields::getallyieldnames | ( | ) | const |
return all yield names from the FMTlist.
std::map< std::string, std::map< std::string, std::vector< double > > > Core::FMTyields::getallyields | ( | const FMTtheme & | target, |
FMTyldtype | type | ||
) | const |
This function returns a map with mask has key (with only one FMTtheme) for only given FMTyieldhandler type (type). The map contains all the yield values for each yield name (map key). This function is used for generating a text file containing all the yields values for GCBM (might be only usefull for Forestier en chef) .
FMTyields Core::FMTyields::getfromfactor | ( | const double & | factor, |
std::vector< std::string > | yieldnames = std::vector< std::string >() |
||
) | const |
This function multiply yields section with a factor and returns a new yields function. If vector of yieldnames is given by the user then only the data within this names list is going to be multiplied by the factor.
std::vector< std::string > Core::FMTyields::getstacked | ( | ) | const |
This function returns the FMTyields has a string in a vector.
bool Core::FMTyields::gotyieldtype | ( | FMTyldtype | type | ) | const |
Returns true if the yield section has a given yield type.
bool Core::FMTyields::isnullyld | ( | const std::string & | value | ) | const |
This function returns true if the FMTyields section contains a given (value) null yield.
bool Core::FMTyields::isyld | ( | const std::string & | value, |
bool | fromsource = false |
||
) | const |
This function returns true if the FMTyields section contains a given (value) non null yield.
bool Core::FMTyields::operator!= | ( | const FMTyields & | rhs | ) | const |
Default copy assignment for FMTyields.
bool Core::FMTyields::operator== | ( | const FMTyields & | rhs | ) | const |
FMTyields Core::FMTyields::presolve | ( | const FMTmaskfilter & | filter, |
const std::vector< FMTtheme > & | originalthemes, | ||
const std::vector< FMTtheme > & | newthemes | ||
) | const |
void Core::FMTyields::push_backagehandler | ( | const FMTmask & | mask, |
const FMTageyieldhandler & | value | ||
) |
Push back ageyield for R
void Core::FMTyields::push_backtimehandler | ( | const FMTmask & | mask, |
const FMTtimeyieldhandler & | value | ||
) |
Push back timeyield for R
void Core::FMTyields::setactionsmappingtomodelhandlers | ( | const std::vector< int > & | actionids | ) |
Clear the actual actionsmapping of every yield model handlers and replace it with the new.
void Core::FMTyields::swap | ( | FMTyields & | rhs | ) |
Swap FMTyield.
|
overridevirtual |
FMTyields being an FMTlist an update function needs to be implemented to update the yieldnames and nullyieldsname caching.
Reimplemented from Core::FMTlist< std::unique_ptr< FMTyieldhandler > >.
|
friend |
serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)
|
friend |