FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTaction.hpp>
Public Member Functions | |
FMTaction & | operator+= (const FMTaction &OtherAction) |
append OtherAction to this action actions need to be the same kind of age reset otherwise it will throw an exception. | |
FMTaction () | |
virtual | ~FMTaction ()=default |
FMTaction (const std::string &lname) | |
FMTaction (const std::string &lname, const bool &lock, const bool &reset) | |
void | push_aggregate (const std::string &aggregate) |
void | push_partials (const std::string &yield) |
FMTaction (const FMTaction &rhs) | |
FMTaction & | operator= (const FMTaction &rhs) |
void | update () override |
FMTaction | presolve (const FMTmaskfilter &filter, const std::vector< FMTtheme > &originalthemes, std::vector< FMTtheme > &newthemes, bool compressdata=false) const |
const int & | getagelowerbound () const |
const int & | getageupperbound () const |
const int & | getperiodlowerbound () const |
const int & | getperiodupperbound () const |
size_t | hash () const |
std::string | getname () const |
bool | dorespectlock () const |
bool | isresetage () const |
bool | ispartofaserie () const |
bool | isallowedinserie (const std::vector< std::string > &serie) const |
std::vector< std::string > | getseriesnames () const |
size_t | getlargestseriesize () const |
void | setseries (std::vector< std::vector< std::string > > seriesnames) |
bool | useyield (const std::string &yldname) const |
std::vector< std::string > | getaggregates () const |
void | setaggregates (const std::vector< std::string > &p_aggregates) |
Set a new vector of aggregates. | |
std::vector< std::string > | getpartials () const |
bool | operator< (const FMTaction &rhs) const |
bool | operator== (const FMTaction &rhs) const |
bool | operator!= (const FMTaction &rhs) const |
operator std::string () const | |
bool | partial (const std::string &yield) const |
int | getGCBMactionid () const |
std::string | getGCBMactionname () const |
Public Member Functions inherited from Core::FMTlist< FMTspec > | |
Core::FMTlist< FMTspec > & | operator+= (const Core::FMTlist< FMTspec > &OtherList) |
append OtherList to this list actions both list had to be non shrinked, will throw exception if shrinked. | |
void | swap (Core::FMTlist< FMTspec > &rhs) |
FMTmask | getunion (const std::vector< FMTtheme > &themes) const |
FMTlist () | |
FMTlist (const FMTlist< FMTspec > &rhs) | |
FMTlist & | operator= (const FMTlist< FMTspec > &rhs) |
bool | operator== (const FMTlist< FMTspec > &rhs) const |
~FMTlist ()=default | |
bool | empty () const |
bool | canshrink () const |
virtual void | clearcache () |
size_t | size () const |
std::vector< const FMTspec * > | findsets (const FMTmask &mask) const |
std::vector< const FMTspec * > | 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 FMTspec &value) |
void | push_back (const FMTmask &mask, const FMTspec &value) |
void | push_back (const FMTlist< FMTspec > &rhs) |
void | push_back (const FMTmask &mask, const std::unique_ptr< Core::FMTyieldhandler > &value) |
virtual void | update () |
void | push_front (const FMTmask &mask, const FMTspec &value) |
void | pop_back () |
void | erase (const size_t &location) |
void | insert (const size_t &location, const FMTmask &mask, const FMTspec &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) |
Protected Member Functions | |
void | setbounds () |
std::vector< std::string > | getGCBMactiondef () const |
Protected Member Functions inherited from Core::FMTlist< FMTspec > | |
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< FMTspec > &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 () |
Protected Attributes | |
std::vector< std::string > | aggregates |
An action can be part of a aggregate so this data member gets the name of all aggregate the action is being part of. | |
std::vector< std::string > | partials |
Keeps the yields name for determining the amount of wood harvested in case of partial cut. | |
int | agelowerbound |
int | ageupperbound |
int | periodlowerbound |
int | periodupperbound |
std::string | name |
The name of the action. | |
bool | lock |
If lock is true the action is not _lockexempt when false the action is _LOCKEXEMPT. | |
bool | reset |
If reset is true then the action is age reset Y else the action doen't reset age. | |
std::vector< std::vector< std::string > > | series |
The action series that the action is part of. | |
Friends | |
class | FMTactioncomparator |
class | boost::serialization::access |
Additional Inherited Members | |
Public Types inherited from Core::FMTlist< FMTspec > | |
typedef std::vector< std::pair< FMTmask, FMTspec > >::value_type | value_type |
Value typedef of the FMTlist. | |
typedef std::vector< std::pair< FMTmask, FMTspec > >::iterator | iterator |
Iterator typedef of the FMTlist. | |
typedef std::vector< std::pair< FMTmask, FMTspec > >::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 () |
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. | |
FMTaction hold informations to check if a FMTdevelopement is operable or not to this. The operability testing for a given action is in the FMTdevelopement class. FMTaction consist of a list of specifications that dictate the operability of a subsets of FMTdevelopments.
Core::FMTaction::FMTaction | ( | ) |
Default constructor for FMTaction
|
virtualdefault |
Destructor for FMTaction
Core::FMTaction::FMTaction | ( | const std::string & | lname | ) |
Construct a empty FMTaction with a given name
Core::FMTaction::FMTaction | ( | const std::string & | lname, |
const bool & | lock, | ||
const bool & | reset | ||
) |
Construct a empty FMTaction with a given name, respectlock? and resetage?
|
inline |
If True the action needs to respect the _lock stade of the developement. Else the action doesn't car about the _lock of the developement.
|
inline |
Get the age lower bound for all FMTspecs.
|
inline |
Get the age upper bound for all FMTspecs.
std::vector< std::string > Core::FMTaction::getaggregates | ( | ) | const |
Gets all the aggregates name of which the action is part of.
|
protected |
Returns the corresponding GCBM action definition.
int Core::FMTaction::getGCBMactionid | ( | ) | const |
Returns the corresponding GCBM action id.
std::string Core::FMTaction::getGCBMactionname | ( | ) | const |
Returns the corresponding GCBM action name.
size_t Core::FMTaction::getlargestseriesize | ( | ) | const |
Returns the size of the largest serie.
|
inline |
Get action name of the FMTaction.
std::vector< std::string > Core::FMTaction::getpartials | ( | ) | const |
Gets all the partial yields name of the FMTaction.
|
inline |
Get the period lower bound for all FMTspecs.
|
inline |
Get the period upper bound for all FMTspecs.
std::vector< std::string > Core::FMTaction::getseriesnames | ( | ) | const |
Returns the series names of the action.
|
inline |
Return the hash value base on the action name.
bool Core::FMTaction::isallowedinserie | ( | const std::vector< std::string > & | serie | ) | const |
Return true if the serie mask is part of one serie of the action if not return false.
|
inline |
Return true if the action is part of a serie.
|
inline |
If True When operated by this the FMTdevelopement is set to 0. Else it stays the same
Core::FMTaction::operator std::string | ( | ) | const |
Convert the FMTaction to a string (like in a regular .act file)
bool Core::FMTaction::operator!= | ( | const FMTaction & | rhs | ) | const |
FMTaction nonequality operator check if FMTactions have the not same name.
append OtherAction to this action actions need to be the same kind of age reset otherwise it will throw an exception.
OtherAction | the other action to append to this one. |
bool Core::FMTaction::operator< | ( | const FMTaction & | rhs | ) | const |
FMTaction less than operator (first test the action length and then the string name to place the action).
bool Core::FMTaction::operator== | ( | const FMTaction & | rhs | ) | const |
FMTaction equality operator check if FMTactions have the same name.
bool Core::FMTaction::partial | ( | const std::string & | yield | ) | const |
Check if the yield needs to be considered has partial for this action.
FMTaction Core::FMTaction::presolve | ( | const FMTmaskfilter & | filter, |
const std::vector< FMTtheme > & | originalthemes, | ||
std::vector< FMTtheme > & | newthemes, | ||
bool | compressdata = false |
||
) | const |
Eliminate FMTspecification and presolve all masks base on a basemask a preolved mask and presolved themes. The returned action can also be empty.
void Core::FMTaction::push_aggregate | ( | const std::string & | aggregate | ) |
Push back aggregate to the aggregates data member vector
void Core::FMTaction::push_partials | ( | const std::string & | yield | ) |
Push back a partiel yield name to the partials data member vector
void Core::FMTaction::setaggregates | ( | const std::vector< std::string > & | p_aggregates | ) |
Set a new vector of aggregates.
[in] | p_aggregates | the vector of aggregates to set. |
|
protected |
This function is for optimization it iterates on the specifications to get the agelowerbound, ageupperbound,periodlowerbound,periodupperbound and sets all member data.
void Core::FMTaction::setseries | ( | std::vector< std::vector< std::string > > | seriesnames | ) |
Giving a serie complete names, and the actions id of the serie occuring before this action, Will go across all series and check if part of it and build it if in.
|
overridevirtual |
Every FMTlist container need to have a update() function this function calls setbounds() to update all bounds and also shrink the FMTlist (all for optimization of the process)
Reimplemented from Core::FMTlist< FMTspec >.
bool Core::FMTaction::useyield | ( | const std::string & | yldname | ) | const |
Return true if the yield is used by the action to set operability.
|
friend |
serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)
|
friend |
|
protected |
Those data members are for optimization only, the class determine within which bounds the aciton can take place for a given development.
|
protected |
|
protected |
An action can be part of a aggregate so this data member gets the name of all aggregate the action is being part of.
|
protected |
If lock is true the action is not _lockexempt when false the action is _LOCKEXEMPT.
|
protected |
The name of the action.
|
protected |
Keeps the yields name for determining the amount of wood harvested in case of partial cut.
|
protected |
|
protected |
|
protected |
If reset is true then the action is age reset Y else the action doen't reset age.
|
protected |
The action series that the action is part of.