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

Transition mask holding a target mask and a proportion, used to disturb a development in a transition. More...

#include <FMTTransitionMask.h>

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

Public Member Functions

 FMTTransitionMask ()
 Default constructor for FMTTransitionMask.
 
 ~FMTTransitionMask ()=default
 Default destructor for FMTTransitionMask.
 
 FMTTransitionMask (const std::string &lmask, const std::vector< FMTTheme > &themes, const double &lproportion)
 Construct a transition mask from a mask string, the themes and a proportion.
 
FMTMask trans (const FMTMask &p_baseMask, const std::vector< FMTTheme > &p_themes) const
 Apply the transition mask to a base mask.
 
 FMTTransitionMask (const FMTTransitionMask &rhs)
 Copy constructor for FMTTransitionMask.
 
 FMTTransitionMask (const FMTTransitionMask &rhs, const FMTMask &lmask, const std::vector< FMTTheme > &themes)
 Construct a transition mask from another transition mask, a mask and the themes.
 
FMTTransitionMaskoperator= (const FMTTransitionMask &rhs)
 Copy assignment operator for FMTTransitionMask.
 
FMTDevelopmentPath disturb (const Core::FMTDevelopment &dev, const FMTYields &yields, const std::vector< FMTTheme > &themes, const bool &reset_age) const
 Disturb a development using the transition mask.
 
std::map< std::string, std::string > get (const std::vector< FMTTheme > &themes) const
 Return the transition mask as a map of theme name to attribute.
 
bool operator== (const FMTTransitionMask &rhs) const
 Equality comparison operator of FMTTransitionMask.
 
double getProportion () const
 Return the proportion of the transition mask.
 
FMTMask getMask () const
 Return the mask of the transition mask.
 
const FMTMaskgetMaskReference () const
 Return the reference mask of the transition mask.
 
void setMask (const Core::FMTMask &mtmask)
 Set the mask of the transition mask.
 
void setProportion (double newproportion)
 Set the proportion of the transition mask.
 
FMTTransitionMask preSolve (const FMTMaskFilter &filter, const std::vector< FMTTheme > &presolvedthemes) const
 Return a presolved copy of the transition mask.
 
void preSolveRef (const FMTMaskFilter &filter, const std::vector< FMTTheme > &presolvedthemes)
 Presolve the transition mask in place.
 
 operator std::string () const override
 Return the string representation of the transition mask.
 
- Public Member Functions inherited from Core::FMTMaskFilter
 FMTMaskFilter ()
 Default constructor for FMTMaskFilter.
 
virtual ~FMTMaskFilter ()=default
 Default virtual destructor for FMTMaskFilter.
 
 FMTMaskFilter (const FMTMaskFilter &rhs)
 Copy constructor for FMTMaskFilter.
 
FMTMaskFilteroperator= (const FMTMaskFilter &rhs)
 Copy assignment operator for FMTMaskFilter.
 
 FMTMaskFilter (const FMTMask &presolveselection, const FMTMask &buffermask)
 Construct a filter from a preSolve selection mask and a buffer mask.
 
 FMTMaskFilter (const FMTMask &presolveselection)
 Construct a filter from a preSolve selection mask.
 
 FMTMaskFilter (std::vector< FMTMask > &masks)
 Construct a filter from a vector of masks.
 
 FMTMaskFilter (std::vector< FMTMask > &masks, const std::vector< FMTTheme > &themes)
 Construct a filter from a vector of masks and the themes.
 
FMTMask filter (const FMTMask &devmask) const
 Filter a development mask.
 
void swap (FMTMaskFilter &rhs)
 Swap this filter with another.
 
FMTMaskFilter preSolve (const std::vector< FMTTheme > &themes) const
 Return a presolved copy of the filter.
 
bool canPreSolve (const FMTMask &mask, const std::vector< const Core::FMTTheme * > &themes) const
 Return true if the mask can be presolved with the filter.
 
std::vector< const Core::FMTTheme * > getSelectedThemes (const std::vector< Core::FMTTheme > &themes) const
 Return the themes selected by the filter.
 
bool emptyFlipped () const
 Return true if the flipped selection is empty.
 
bool empty () const
 Return true if the selection is empty.
 
size_t hash () const
 Return the hash of the filter.
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from Core::FMTMaskFilter
boost::dynamic_bitset< uint8_t > selection
 
boost::dynamic_bitset< uint8_t > flippedselection
 

Detailed Description

Transition mask holding a target mask and a proportion, used to disturb a development in a transition.

Constructor & Destructor Documentation

◆ FMTTransitionMask() [1/4]

Core::FMTTransitionMask::FMTTransitionMask ( )

Default constructor for FMTTransitionMask.

◆ ~FMTTransitionMask()

Core::FMTTransitionMask::~FMTTransitionMask ( )
default

Default destructor for FMTTransitionMask.

◆ FMTTransitionMask() [2/4]

Core::FMTTransitionMask::FMTTransitionMask ( const std::string &  lmask,
const std::vector< FMTTheme > &  themes,
const double &  lproportion 
)

Construct a transition mask from a mask string, the themes and a proportion.

Parameters
[in]lmaskthe mask string.
[in]themesthe themes.
[in]lproportionthe proportion.

◆ FMTTransitionMask() [3/4]

Core::FMTTransitionMask::FMTTransitionMask ( const FMTTransitionMask rhs)

Copy constructor for FMTTransitionMask.

Parameters
[in]rhsthe FMTTransitionMask to copy.

◆ FMTTransitionMask() [4/4]

Core::FMTTransitionMask::FMTTransitionMask ( const FMTTransitionMask rhs,
const FMTMask lmask,
const std::vector< FMTTheme > &  themes 
)

Construct a transition mask from another transition mask, a mask and the themes.

Parameters
[in]rhsthe transition mask to copy.
[in]lmaskthe mask.
[in]themesthe themes.

Member Function Documentation

◆ disturb()

FMTDevelopmentPath Core::FMTTransitionMask::disturb ( const Core::FMTDevelopment dev,
const FMTYields yields,
const std::vector< FMTTheme > &  themes,
const bool &  reset_age 
) const

Disturb a development using the transition mask.

Parameters
[in]devthe development to disturb.
[in]yieldsthe yields.
[in]themesthe themes.
[in]reset_ageif true resets the age.
Returns
the resulting development path.

◆ get()

std::map< std::string, std::string > Core::FMTTransitionMask::get ( const std::vector< FMTTheme > &  themes) const

Return the transition mask as a map of theme name to attribute.

Parameters
[in]themesthe themes.
Returns
a map of theme name to attribute.

◆ getMask()

FMTMask Core::FMTTransitionMask::getMask ( ) const

Return the mask of the transition mask.

Returns
the mask.

◆ getMaskReference()

const FMTMask & Core::FMTTransitionMask::getMaskReference ( ) const

Return the reference mask of the transition mask.

Returns
the mask.

◆ getProportion()

double Core::FMTTransitionMask::getProportion ( ) const

Return the proportion of the transition mask.

Returns
the proportion.

◆ operator std::string()

Core::FMTTransitionMask::operator std::string ( ) const
override

Return the string representation of the transition mask.

Returns
the string representation of the transition mask.

◆ operator=()

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

Copy assignment operator for FMTTransitionMask.

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

◆ operator==()

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

Equality comparison operator of FMTTransitionMask.

Parameters
[in]rhsthe transition mask to compare with.
Returns
true if both transition masks are equal else false.

◆ preSolve()

FMTTransitionMask Core::FMTTransitionMask::preSolve ( const FMTMaskFilter filter,
const std::vector< FMTTheme > &  presolvedthemes 
) const

Return a presolved copy of the transition mask.

Parameters
[in]filterthe mask filter.
[in]presolvedthemesthe presolved themes.
Returns
the presolved transition mask.

◆ preSolveRef()

void Core::FMTTransitionMask::preSolveRef ( const FMTMaskFilter filter,
const std::vector< FMTTheme > &  presolvedthemes 
)

Presolve the transition mask in place.

Parameters
[in]filterthe mask filter.
[in]presolvedthemesthe presolved themes.

◆ setMask()

void Core::FMTTransitionMask::setMask ( const Core::FMTMask mtmask)

Set the mask of the transition mask.

Parameters
[in]mtmaskthe mask to set.

◆ setProportion()

void Core::FMTTransitionMask::setProportion ( double  newproportion)

Set the proportion of the transition mask.

Parameters
[in]newproportionthe proportion to set.

◆ trans()

FMTMask Core::FMTTransitionMask::trans ( const FMTMask p_baseMask,
const std::vector< FMTTheme > &  p_themes 
) const

Apply the transition mask to a base mask.

Parameters
[in]p_baseMaskthe base mask.
[in]p_themesthe themes.
Returns
the transitioned mask.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

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