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

List of FMTFork describing the transition of an action, disturbing a development to generate new development paths. More...

#include <FMTTransition.h>

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

Public Member Functions

FMTTransitionoperator+= (const FMTTransition &OtherTransition)
 Append another transition to this transition, which needs to be unshrunk otherwise an exception is thrown.
 
 FMTTransition ()
 Default constructor for FMTTransition.
 
 ~FMTTransition ()=default
 Default destructor for FMTTransition.
 
 FMTTransition (const std::string &lname)
 Construct a transition keeping only its name.
 
 FMTTransition (const FMTTransition &rhs)
 Copy constructor for FMTTransition.
 
FMTTransitionoperator= (const FMTTransition &rhs)
 Copy assignment operator for FMTTransition.
 
 operator std::string () const
 Convert the transition to a string as in a transition file.
 
FMTTransition single () const
 Return a transition that leads to a single development path, selecting the one with the highest area proportion, for cell based models.
 
std::string getName () const
 Get the name of the transition.
 
void setName (const std::string &p_name)
 Set the name of the transition.
 
bool isLeaking () const
 Return true if a fork has a total proportion different from 1.
 
const FMTForkgetFork (const Core::FMTDevelopment &development, const FMTYields &ylds) const
 Return the first useful fork for which the development can be disturbed based on the yields.
 
std::vector< const FMTTheme * > getStaticThemes (const std::vector< const FMTTheme * > &themes) const
 Return the themes that have no attribute change in the transition masks (static themes).
 
std::vector< Core::FMTMaskcanProduce (const Core::FMTMask &testmask, const std::vector< Core::FMTTheme > &themes) const
 Return all the source masks that can produce the given mask through the transition.
 
unsigned int ageAfter (const std::vector< FMTDevelopment > &devs, const FMTAction &action, const FMTYields &ylds, const std::vector< FMTTheme > &themes) const
 Return the average age after disturbance across the developments, for GCBM.
 
FMTMask mainTarget (const std::vector< FMTDevelopment > &devs, const FMTYields &ylds) const
 Return the most targeted mask across the developments based on the yields, for GCBM.
 
std::map< std::string, std::vector< FMTDevelopment > > attributeTargets (const std::vector< FMTDevelopment > &devs, const FMTYields &ylds, const std::vector< FMTTheme > &themes) const
 Classify the developments by mask key based on the yields.
 
bool operator< (const FMTTransition &rhs) const
 Less than comparison operator of FMTTransition.
 
bool operator== (const FMTTransition &rhs) const
 Equality comparison operator of FMTTransition, checking if they have the same name.
 
bool operator!= (const FMTTransition &rhs) const
 Inequality comparison operator of FMTTransition, checking if they have a different name.
 
FMTTransition preSolve (const FMTMaskFilter &filter, const std::vector< FMTTheme > &originalthemes, std::vector< FMTTheme > &newthemes, bool compressdata=false) const
 Return a presolved transition based on a filter, the original themes and the new presolved themes.
 
void preSolveRef (const FMTMaskFilter &p_filter, const std::vector< FMTTheme > &p_originalThemes, std::vector< FMTTheme > &p_newthemes, bool p_compressdata=false)
 Presolve the transition in place based on a filter, the original themes and the new presolved themes.
 

Protected Attributes

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

Friends

class boost::serialization::access
 Serialize the FMTTransition through its base FMTList<FMTFork> for multiprocessing across multiple cpus (pickle in Python).
 

Detailed Description

List of FMTFork describing the transition of an action, disturbing a development to generate new development paths.

Each FMTAction has its FMTTransition. Each fork is a transition source with its linked targets.

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)

Construct a transition keeping only its name.

Parameters
[in]lnamethe name of the transition.

◆ FMTTransition() [3/3]

Core::FMTTransition::FMTTransition ( const FMTTransition rhs)

Copy constructor for FMTTransition.

Parameters
[in]rhsthe FMTTransition to copy.

Member Function Documentation

◆ ageAfter()

unsigned int Core::FMTTransition::ageAfter ( const std::vector< FMTDevelopment > &  devs,
const FMTAction action,
const FMTYields ylds,
const std::vector< FMTTheme > &  themes 
) const

Return the average age after disturbance across the developments, for GCBM.

Parameters
[in]devsthe developments.
[in]actionthe action.
[in]yldsthe yields.
[in]themesthe themes.
Returns
the average age after disturbance.

◆ attributeTargets()

std::map< std::string, std::vector< FMTDevelopment > > Core::FMTTransition::attributeTargets ( const std::vector< FMTDevelopment > &  devs,
const FMTYields ylds,
const std::vector< FMTTheme > &  themes 
) const

Classify the developments by mask key based on the yields.

Parameters
[in]devsthe developments.
[in]yldsthe yields.
[in]themesthe themes.
Returns
a map of mask string (separated by -) to developments.

◆ canProduce()

std::vector< Core::FMTMask > Core::FMTTransition::canProduce ( const Core::FMTMask testmask,
const std::vector< Core::FMTTheme > &  themes 
) const

Return all the source masks that can produce the given mask through the transition.

Parameters
[in]testmaskthe mask to produce.
[in]themesthe themes.
Returns
the source masks that can produce the mask.

◆ getFork()

const FMTFork * Core::FMTTransition::getFork ( const Core::FMTDevelopment development,
const FMTYields ylds 
) const

Return the first useful fork for which the development can be disturbed based on the yields.

Parameters
[in]developmentthe development.
[in]yldsthe yields.
Returns
a pointer to the fork, or nullptr.

◆ getName()

std::string Core::FMTTransition::getName ( ) const
inline

Get the name of the transition.

Returns
the name of the transition.

◆ getStaticThemes()

std::vector< const FMTTheme * > Core::FMTTransition::getStaticThemes ( const std::vector< const FMTTheme * > &  themes) const

Return the themes that have no attribute change in the transition masks (static themes).

Parameters
[in]themesthe themes to filter.
Returns
the static themes.

◆ isLeaking()

bool Core::FMTTransition::isLeaking ( ) const

Return true if a fork has a total proportion different from 1.

Returns
true if the transition is leaking else false.

◆ mainTarget()

FMTMask Core::FMTTransition::mainTarget ( const std::vector< FMTDevelopment > &  devs,
const FMTYields ylds 
) const

Return the most targeted mask across the developments based on the yields, for GCBM.

Parameters
[in]devsthe developments.
[in]yldsthe yields.
Returns
the main target mask.

◆ operator std::string()

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

Convert the transition to a string as in a transition file.

Returns
the string representation of the transition.

◆ operator!=()

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

Inequality comparison operator of FMTTransition, checking if they have a different name.

Parameters
[in]rhsthe transition to compare with.
Returns
true if both transitions have a different name else false.

◆ operator+=()

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

Append another transition to this transition, which needs to be unshrunk otherwise an exception is thrown.

Parameters
[in]OtherTransitionthe other transition to append to this one.
Returns
a reference to this appended transition.

◆ operator<()

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

Less than comparison operator of FMTTransition.

Parameters
[in]rhsthe transition to compare with.
Returns
true if this transition is less than rhs else false.

◆ operator=()

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

Copy assignment operator for FMTTransition.

Parameters
[in]rhsthe FMTTransition to copy.
Returns
a reference to this FMTTransition.

◆ operator==()

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

Equality comparison operator of FMTTransition, checking if they have the same name.

Parameters
[in]rhsthe transition to compare with.
Returns
true if both transitions have the same name else false.

◆ preSolve()

FMTTransition Core::FMTTransition::preSolve ( const FMTMaskFilter filter,
const std::vector< FMTTheme > &  originalthemes,
std::vector< FMTTheme > &  newthemes,
bool  compressdata = false 
) const

Return a presolved transition based on a filter, the original themes and the new presolved themes.

Parameters
[in]filterthe mask filter.
[in]originalthemesthe original themes.
[in,out]newthemesthe presolved themes.
[in]compressdataif true compresses the data.
Returns
the presolved transition.

◆ preSolveRef()

void Core::FMTTransition::preSolveRef ( const FMTMaskFilter p_filter,
const std::vector< FMTTheme > &  p_originalThemes,
std::vector< FMTTheme > &  p_newthemes,
bool  p_compressdata = false 
)

Presolve the transition in place based on a filter, the original themes and the new presolved themes.

Parameters
[in]p_filterthe mask filter.
[in]p_originalThemesthe original themes.
[in,out]p_newthemesthe presolved themes.
[in]p_compressdataif true compresses the data.

◆ setName()

void Core::FMTTransition::setName ( const std::string &  p_name)

Set the name of the transition.

Parameters
[in]p_namethe name to set.

◆ single()

FMTTransition Core::FMTTransition::single ( ) const

Return a transition that leads to a single development path, selecting the one with the highest area proportion, for cell based models.

Returns
the single path transition.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialize the FMTTransition through its base FMTList<FMTFork> for multiprocessing across multiple cpus (pickle in Python).

Template Parameters
Archivethe archive type.
Parameters
[in,out]arthe archive to serialize to or from.
[in]versionthe serialization version.

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: