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

#include <FMTtransition.hpp>

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

Public Member Functions

FMTtransitionoperator+= (const FMTtransition &OtherTransition)
 append OtherTransition to this transition needs to be unskrink or it will throw an exception.
 
 FMTtransition ()
 
 ~FMTtransition ()=default
 
 FMTtransition (const std::string &lname)
 
 FMTtransition (const FMTtransition &rhs)
 
FMTtransitionoperator= (const FMTtransition &rhs)
 
 operator std::string () const
 
FMTtransition single () const
 
std::string getname () const
 
bool isleaking () const
 
const FMTforkgetfork (const Core::FMTdevelopment &developement, const FMTyields &ylds) const
 
std::vector< FMTthemegetstaticthemes (const std::vector< FMTtheme > &themes) const
 
std::vector< Core::FMTmaskcanproduce (const Core::FMTmask &testmask, const std::vector< Core::FMTtheme > &themes) const
 
unsigned int age_after (const std::vector< FMTdevelopment > &devs, const FMTaction &action, const FMTyields &ylds, const std::vector< FMTtheme > &themes) const
 
FMTmask main_target (const std::vector< FMTdevelopment > &devs, const FMTyields &ylds) const
 
std::map< std::string, std::vector< FMTdevelopment > > attribute_targets (const std::vector< FMTdevelopment > &devs, const FMTyields &ylds, const std::vector< FMTtheme > &themes) const
 
bool operator< (const FMTtransition &rhs) const
 
bool operator== (const FMTtransition &rhs) const
 
bool operator!= (const FMTtransition &rhs) const
 
FMTtransition presolve (const FMTmaskfilter &filter, const std::vector< FMTtheme > &originalthemes, std::vector< FMTtheme > &newthemes, bool compressdata=false) const
 
- Public Member Functions inherited from Core::FMTlist< FMTfork >
Core::FMTlist< FMTfork > & operator+= (const Core::FMTlist< FMTfork > &OtherList)
 append OtherList to this list actions both list had to be non shrinked, will throw exception if shrinked.
 
void swap (Core::FMTlist< FMTfork > &rhs)
 
FMTmask getunion (const std::vector< FMTtheme > &themes) const
 
 FMTlist ()
 
 FMTlist (const FMTlist< FMTfork > &rhs)
 
FMTlistoperator= (const FMTlist< FMTfork > &rhs)
 
bool operator== (const FMTlist< FMTfork > &rhs) const
 
 ~FMTlist ()=default
 
bool empty () const
 
bool canshrink () const
 
virtual void clearcache ()
 
size_t size () const
 
std::vector< const FMTfork * > findsets (const FMTmask &mask) const
 
std::vector< const FMTfork * > 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 FMTfork &value)
 
void push_back (const FMTmask &mask, const FMTfork &value)
 
void push_back (const FMTlist< FMTfork > &rhs)
 
void push_back (const FMTmask &mask, const std::unique_ptr< Core::FMTyieldhandler > &value)
 
virtual void update ()
 
void push_front (const FMTmask &mask, const FMTfork &value)
 
void pop_back ()
 
void erase (const size_t &location)
 
void insert (const size_t &location, const FMTmask &mask, const FMTfork &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 Attributes

std::string name
 name of the FMTtranstion same name seen in FMTaction
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Public Types inherited from Core::FMTlist< FMTfork >
typedef std::vector< std::pair< FMTmask, FMTfork > >::value_type value_type
 Value typedef of the FMTlist.
 
typedef std::vector< std::pair< FMTmask, FMTfork > >::iterator iterator
 Iterator typedef of the FMTlist.
 
typedef std::vector< std::pair< FMTmask, FMTfork > >::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< FMTfork >
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< FMTfork > &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.
 

Detailed Description

FMTtransition is a list of FMTfork (FMTspec). Each FMTaction has it's FMTtransition. Using a FMTdevelopment you can simulate the impact of harvesting that development with a FMTtransition. Each fork is a transition source and its linked targets. FMTaction test for operability and FMTtransition only "disturb" the FMTdevelopement and generates new FMTdevelopementpath.

Constructor & Destructor Documentation

◆ FMTtransition() [1/3]

Core::FMTtransition::FMTtransition ( )

Default constructor for FMTtransition

◆ ~FMTtransition()

Core::FMTtransition::~FMTtransition ( )
default

Default destructor for FMTtransition

◆ FMTtransition() [2/3]

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

FMTtransition constructor keeping only the name of the FMTtransition.

◆ FMTtransition() [3/3]

Core::FMTtransition::FMTtransition ( const FMTtransition rhs)

FMTtransition copy constructor.

Member Function Documentation

◆ age_after()

unsigned int Core::FMTtransition::age_after ( const std::vector< FMTdevelopment > &  devs,
const FMTaction action,
const FMTyields ylds,
const std::vector< FMTtheme > &  themes 
) const

For GCBM a GCBMtransition is described by the age of the stand after the disturbance of the stand. Using a vector of FMTdevelopement (devs) this functions return the average age after disturbances optained calculating the return age for each FMTdevelopement in the list.

◆ attribute_targets()

std::map< std::string, std::vector< FMTdevelopment > > Core::FMTtransition::attribute_targets ( const std::vector< FMTdevelopment > &  devs,
const FMTyields ylds,
const std::vector< FMTtheme > &  themes 
) const

This function classify the FMTdevelopement list (devs) by FMTmask key based on a FMTyields section (ylds). The returned map key is an FMTmask string separed by "-"

◆ canproduce()

std::vector< Core::FMTmask > Core::FMTtransition::canproduce ( const Core::FMTmask testmask,
const std::vector< Core::FMTtheme > &  themes 
) const

The function return all the possibles masks, if pass as a source for the transition, that can produce the given(mask).

◆ getfork()

const FMTfork * Core::FMTtransition::getfork ( const Core::FMTdevelopment developement,
const FMTyields ylds 
) const

Returns the FMTfork pointer for which the FMTdevelopment (dev) can be disturbed based on a given FMTyields section (ylds). Looking at every possible fork returns only the first usefull fork.

◆ getname()

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

Getter for the FMTtransition name

◆ getstaticthemes()

std::vector< FMTtheme > Core::FMTtransition::getstaticthemes ( const std::vector< FMTtheme > &  themes) const

Using a list of (themes) this function returns a subset of the theme list for which their's no attribute change in the FMTtransitionmask (what we call here static themes).

◆ isleaking()

bool Core::FMTtransition::isleaking ( ) const

This function checks if each FMTfork has a total proportion equal to 1 if the transition proportion != 1 then isleaking returns true.

◆ main_target()

FMTmask Core::FMTtransition::main_target ( const std::vector< FMTdevelopment > &  devs,
const FMTyields ylds 
) const

Again for GCBM each GCBMtransition needs to have only one possible mask target. So this function returns the most targeted FMTmask across the developements list (devs) based on a given yields section (ylds).

◆ operator std::string()

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

FMTtransition conversion to string value like into a transition file.

◆ operator!=()

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

FMTtransition nonequality operator check if FMTtransition (rhs) have not the same name.

◆ operator+=()

FMTtransition & Core::FMTtransition::operator+= ( const FMTtransition OtherTransition)

append OtherTransition to this transition needs to be unskrink or it will throw an exception.

Parameters
OtherTransitionthe other transition to append to this one.
Returns
A reference the the newly appended transition.

◆ operator<()

bool Core::FMTtransition::operator< ( const FMTtransition rhs) const

FMTtransition less than operator.

◆ operator=()

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

FMTtransition assignment operator.

◆ operator==()

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

FMTtransition equality operator check if FMTtransition (rhs) have the same name.

◆ presolve()

FMTtransition Core::FMTtransition::presolve ( const FMTmaskfilter filter,
const std::vector< FMTtheme > &  originalthemes,
std::vector< FMTtheme > &  newthemes,
bool  compressdata = false 
) const

Returns a presolved FMTtransition based on a (basemask), the actual model FMTtheme (originalthemes), a (presolvedmask) and the new presolved themes list.

◆ single()

FMTtransition Core::FMTtransition::single ( ) const

A transition can lead to multiple FMTdevelopementpath but for cell basesd models the FMTtransition should lead to only one futurdevelopementtype. Calling this function returns the a new FMTtransition that does not allow multiple FMTdevelopementpath. It select the path where the area proportion is the higher.

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)

Member Data Documentation

◆ name

std::string Core::FMTtransition::name
protected

name of the FMTtranstion same name seen in FMTaction


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