FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTdevelopment.hpp>
Public Member Functions | |
int | getage () const |
int | getlock () const |
int | getperiod () const |
const Core::FMTmask & | getmask () const |
Core::FMTmask | getmaskcopy () const |
void | setage (const int &lage) |
void | setlock (const int &llock) |
void | setperiod (const int &lperiod) |
void | setmask (const Core::FMTmask &lmask) |
FMTdevelopment () | |
virtual | ~FMTdevelopment ()=default |
FMTdevelopment (const FMTmask &mask, const int &age, const int &lock) | |
FMTdevelopment (const FMTmask &lmask, const int &lage, const int &llock, const int &lperiod) | |
FMTdevelopment (const FMTdevelopment &rhs) | |
virtual std::unique_ptr< FMTdevelopment > | Clone () const |
FMTdevelopment & | operator= (const FMTdevelopment &rhs) |
bool | operator== (const FMTdevelopment &rhs) const |
bool | operator!= (const FMTdevelopment &rhs) const |
bool | operator< (const FMTdevelopment &rhs) const |
FMTfuturdevelopment | grow () const |
FMTyieldrequest | getyieldrequest (const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const |
bool | operable (const FMTaction &action, const Core::FMTyields &ylds, const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const |
bool | anyoperable (const std::vector< const FMTaction * > &actions, const Core::FMTyields &ylds, const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const |
virtual | operator std::string () const |
virtual double | getarea () const |
FMTdevelopment | clearlock () const |
std::vector< FMTdevelopmentpath > | operate (const FMTaction &action, const FMTtransition &Transition, const Core::FMTyields &ylds, const std::vector< FMTtheme > &themes) const |
double | getinventorycoef (const Core::FMTyields &ylds, const std::string &target_yield, const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const |
double | getharvestcoef (const std::vector< FMTdevelopmentpath > &topaths, const FMTaction &action, const Core::FMTyields &ylds, const std::string &target_yield, const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const |
bool | is (const FMTspec &specification, const Core::FMTyields &ylds, const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const |
bool | worthtestingoperability (const FMTaction &action) const |
std::vector< int > | anyworthtestingoperability (const std::vector< const FMTaction * > &actions, const FMTaction &firstaction) const |
std::vector< bool > | isanyworthtestingoperability (const std::vector< const FMTaction * > &actions, const std::vector< FMTaction > &allactions) const noexcept |
size_t | hash () 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 |
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 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. | |
FMTdevelopment is the base class of FMTactualdevelopement and FMTfuturdevelopement. This class is the thing that look like a forest stand. It holds informations about it's age, at which period it exist, the lock level of the stand and finaly the mask hold a description of the growth/spatial reference/ and other potential sutff.
Core::FMTdevelopment::FMTdevelopment | ( | ) |
Default constructor for FMTdevelopement
|
virtualdefault |
Default destructor for FMTdevelopement.
Core::FMTdevelopment::FMTdevelopment | ( | const FMTmask & | mask, |
const int & | age, | ||
const int & | lock | ||
) |
FMTdevelopement constructor using a FMTmask the age and the lock level of the FMTdevelopment.
Core::FMTdevelopment::FMTdevelopment | ( | const FMTmask & | lmask, |
const int & | lage, | ||
const int & | llock, | ||
const int & | lperiod | ||
) |
FMTdevelopement constructor using a FMTmask the age and the lock level and the period of the FMTdevelopment.
Core::FMTdevelopment::FMTdevelopment | ( | const FMTdevelopment & | rhs | ) |
FMTdevelopement copy constructor.
bool Core::FMTdevelopment::anyoperable | ( | const std::vector< const FMTaction * > & | actions, |
const Core::FMTyields & | ylds, | ||
const Graph::FMTgraphvertextoyield * | graphyieldrequest = nullptr |
||
) | const |
Check if this FMTdevelopement is operable to any of FMTaction in the (actions) vector based on multiple yields (yields).
std::vector< int > Core::FMTdevelopment::anyworthtestingoperability | ( | const std::vector< const FMTaction * > & | actions, |
const FMTaction & | firstaction | ||
) | const |
Check if any action in the actions vector worth testing the operability and returns it's pointer distance from the firestaction.
FMTdevelopment Core::FMTdevelopment::clearlock | ( | ) | const |
Returns a copy of this FMTdevelopment but set the lock level to 0.
|
virtual |
Virtual clone function for FMTdevelopement for abstraction
Reimplemented in Core::FMTactualdevelopment, and Core::FMTfuturdevelopment.
|
inline |
Get the age of the development.
|
virtual |
Returns the area of the FMTdevelopment
Reimplemented in Core::FMTactualdevelopment, and Core::FMTfuturdevelopment.
double Core::FMTdevelopment::getharvestcoef | ( | const std::vector< FMTdevelopmentpath > & | topaths, |
const FMTaction & | action, | ||
const Core::FMTyields & | ylds, | ||
const std::string & | target_yield, | ||
const Graph::FMTgraphvertextoyield * | graphyieldrequest = nullptr |
||
) | const |
Returns the harvest coefficiant of the FMTdevelopement for a given yield (target_yield) if it follows multiple developement path for a given action and based on yields. It gives the amount of yield the action produce if the *this FMTdevelopement is operated.
double Core::FMTdevelopment::getinventorycoef | ( | const Core::FMTyields & | ylds, |
const std::string & | target_yield, | ||
const Graph::FMTgraphvertextoyield * | graphyieldrequest = nullptr |
||
) | const |
Returns inventory coefficiant of the FMTdevelopement for a given yield (target_yield) based on (yields). The amount of (yield) do this FMTdevelopement has.
|
inline |
Get the lock of the developement.
|
inline |
Get the mask of the developement.
|
inline |
Get the mask of the developement.
|
inline |
Get the period of the developement.
FMTyieldrequest Core::FMTdevelopment::getyieldrequest | ( | const Graph::FMTgraphvertextoyield * | graphyieldrequest = nullptr | ) | const |
Get a yieldrequest without any reference to a FMTgraph for a given (ylds) and this FMTdevelopement.
FMTfuturdevelopment Core::FMTdevelopment::grow | ( | ) | const |
The function returns a grown up copy of this FMTdevelopement increasing the age and the period and decreasing the lock level if the lock level was > 0.
|
inline |
Hash function for FMTdevelopment combining mask,age,lock and period of the FMTdevelopement.
bool Core::FMTdevelopment::is | ( | const FMTspec & | specification, |
const Core::FMTyields & | ylds, | ||
const Graph::FMTgraphvertextoyield * | graphyieldrequest = nullptr |
||
) | const |
Check if this FMTdevelopment respects some specifications based on multiple yields.
|
noexcept |
Return a vector if true worth testting if false dont test for operability.
bool Core::FMTdevelopment::operable | ( | const FMTaction & | action, |
const Core::FMTyields & | ylds, | ||
const Graph::FMTgraphvertextoyield * | graphyieldrequest = nullptr |
||
) | const |
Check if this FMTdevelopement is operable to an FMTaction (action) based on multiple yields (yields).
std::vector< FMTdevelopmentpath > Core::FMTdevelopment::operate | ( | const FMTaction & | action, |
const FMTtransition & | Transition, | ||
const Core::FMTyields & | ylds, | ||
const std::vector< FMTtheme > & | themes | ||
) | const |
Returns a vector of FMTdevelopementpath if the FMTdevelopement is operated by an (action), a (Transition) bases on multiple yields and the sorted FMTthemes of the model.
|
virtual |
Returns the string reprensentation of a FMTdevelopment like in the area section.
Reimplemented in Core::FMTactualdevelopment.
bool Core::FMTdevelopment::operator!= | ( | const FMTdevelopment & | rhs | ) | const |
FMTdevelopement nonequality operator.
bool Core::FMTdevelopment::operator< | ( | const FMTdevelopment & | rhs | ) | const |
FMTdevelopement less than operator.
FMTdevelopment & Core::FMTdevelopment::operator= | ( | const FMTdevelopment & | rhs | ) |
FMTdevelopement copy assignment.
bool Core::FMTdevelopment::operator== | ( | const FMTdevelopment & | rhs | ) | const |
FMTdevelopement equality operator.
void Core::FMTdevelopment::setage | ( | const int & | lage | ) |
Set the age of the development.
void Core::FMTdevelopment::setlock | ( | const int & | llock | ) |
Set the lock of the developement.
void Core::FMTdevelopment::setmask | ( | const Core::FMTmask & | lmask | ) |
Set the mask of the developement.
void Core::FMTdevelopment::setperiod | ( | const int & | lperiod | ) |
Set the period of the developement.
bool Core::FMTdevelopment::worthtestingoperability | ( | const FMTaction & | action | ) | const |
This function returns true if the function worth testing for operability for the action. Use for optimization.
|
friend |
Serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)