FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Core::FMTaction Class Reference

#include <FMTaction.hpp>

Inheritance diagram for Core::FMTaction:
[legend]
Collaboration diagram for Core::FMTaction:
[legend]

Public Member Functions

FMTactionoperator+= (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)
 
FMTactionoperator= (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)
 
FMTlistoperator= (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)
 
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)
 

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FMTaction() [1/4]

Core::FMTaction::FMTaction ( )

Default constructor for FMTaction

◆ ~FMTaction()

virtual Core::FMTaction::~FMTaction ( )
virtualdefault

Destructor for FMTaction

◆ FMTaction() [2/4]

Core::FMTaction::FMTaction ( const std::string &  lname)

Construct a empty FMTaction with a given name

◆ FMTaction() [3/4]

Core::FMTaction::FMTaction ( const std::string &  lname,
const bool &  lock,
const bool &  reset 
)

Construct a empty FMTaction with a given name, respectlock? and resetage?

◆ FMTaction() [4/4]

Core::FMTaction::FMTaction ( const FMTaction rhs)

Copy constructor of FMTaction

Member Function Documentation

◆ dorespectlock()

bool Core::FMTaction::dorespectlock ( ) const
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.

◆ getagelowerbound()

const int & Core::FMTaction::getagelowerbound ( ) const
inline

Get the age lower bound for all FMTspecs.

◆ getageupperbound()

const int & Core::FMTaction::getageupperbound ( ) const
inline

Get the age upper bound for all FMTspecs.

◆ getaggregates()

std::vector< std::string > Core::FMTaction::getaggregates ( ) const

Gets all the aggregates name of which the action is part of.

◆ getGCBMactiondef()

std::vector< std::string > Core::FMTaction::getGCBMactiondef ( ) const
protected

Returns the corresponding GCBM action definition.

◆ getGCBMactionid()

int Core::FMTaction::getGCBMactionid ( ) const

Returns the corresponding GCBM action id.

◆ getGCBMactionname()

std::string Core::FMTaction::getGCBMactionname ( ) const

Returns the corresponding GCBM action name.

◆ getlargestseriesize()

size_t Core::FMTaction::getlargestseriesize ( ) const

Returns the size of the largest serie.

◆ getname()

std::string Core::FMTaction::getname ( ) const
inline

Get action name of the FMTaction.

◆ getpartials()

std::vector< std::string > Core::FMTaction::getpartials ( ) const

Gets all the partial yields name of the FMTaction.

◆ getperiodlowerbound()

const int & Core::FMTaction::getperiodlowerbound ( ) const
inline

Get the period lower bound for all FMTspecs.

◆ getperiodupperbound()

const int & Core::FMTaction::getperiodupperbound ( ) const
inline

Get the period upper bound for all FMTspecs.

◆ getseriesnames()

std::vector< std::string > Core::FMTaction::getseriesnames ( ) const

Returns the series names of the action.

◆ hash()

size_t Core::FMTaction::hash ( ) const
inline

Return the hash value base on the action name.

◆ isallowedinserie()

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.

◆ ispartofaserie()

bool Core::FMTaction::ispartofaserie ( ) const
inline

Return true if the action is part of a serie.

◆ isresetage()

bool Core::FMTaction::isresetage ( ) const
inline

If True When operated by this the FMTdevelopement is set to 0. Else it stays the same

◆ operator std::string()

Core::FMTaction::operator std::string ( ) const

Convert the FMTaction to a string (like in a regular .act file)

◆ operator!=()

bool Core::FMTaction::operator!= ( const FMTaction rhs) const

FMTaction nonequality operator check if FMTactions have the not same name.

◆ operator+=()

FMTaction & Core::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.

Parameters
OtherActionthe other action to append to this one.
Returns
A reference the the newly appended action.

◆ operator<()

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).

◆ operator=()

FMTaction & Core::FMTaction::operator= ( const FMTaction rhs)

Copy assignement of FMTaction

◆ operator==()

bool Core::FMTaction::operator== ( const FMTaction rhs) const

FMTaction equality operator check if FMTactions have the same name.

◆ partial()

bool Core::FMTaction::partial ( const std::string &  yield) const

Check if the yield needs to be considered has partial for this action.

◆ presolve()

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.

◆ push_aggregate()

void Core::FMTaction::push_aggregate ( const std::string &  aggregate)

Push back aggregate to the aggregates data member vector

◆ push_partials()

void Core::FMTaction::push_partials ( const std::string &  yield)

Push back a partiel yield name to the partials data member vector

◆ setaggregates()

void Core::FMTaction::setaggregates ( const std::vector< std::string > &  p_aggregates)

Set a new vector of aggregates.

Parameters
[in]p_aggregatesthe vector of aggregates to set.

◆ setbounds()

void Core::FMTaction::setbounds ( )
protected

This function is for optimization it iterates on the specifications to get the agelowerbound, ageupperbound,periodlowerbound,periodupperbound and sets all member data.

◆ setseries()

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.

◆ update()

void Core::FMTaction::update ( )
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 >.

◆ useyield()

bool Core::FMTaction::useyield ( const std::string &  yldname) const

Return true if the yield is used by the action to set operability.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)

◆ FMTactioncomparator

friend class FMTactioncomparator
friend

Member Data Documentation

◆ agelowerbound

int Core::FMTaction::agelowerbound
protected

Those data members are for optimization only, the class determine within which bounds the aciton can take place for a given development.

◆ ageupperbound

int Core::FMTaction::ageupperbound
protected

◆ aggregates

std::vector<std::string> Core::FMTaction::aggregates
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.

◆ lock

bool Core::FMTaction::lock
protected

If lock is true the action is not _lockexempt when false the action is _LOCKEXEMPT.

◆ name

std::string Core::FMTaction::name
protected

The name of the action.

◆ partials

std::vector<std::string> Core::FMTaction::partials
protected

Keeps the yields name for determining the amount of wood harvested in case of partial cut.

◆ periodlowerbound

int Core::FMTaction::periodlowerbound
protected

◆ periodupperbound

int Core::FMTaction::periodupperbound
protected

◆ reset

bool Core::FMTaction::reset
protected

If reset is true then the action is age reset Y else the action doen't reset age.

◆ series

std::vector<std::vector<std::string> > Core::FMTaction::series
protected

The action series that the action is part of.


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