8#ifndef FMTTRA_Hm_included
9#define FMTTRA_Hm_included
13#include <boost/serialization/serialization.hpp>
14#include <boost/serialization/string.hpp>
15#include <boost/serialization/export.hpp>
78 operator std::string()
const;
120 std::vector<const FMTTheme*>
getStaticThemes(
const std::vector<const FMTTheme*>& themes)
const;
138 unsigned int ageAfter(
const std::vector<FMTDevelopment>& devs,
141 const std::vector<FMTTheme>& themes)
const;
159 std::map<std::string, std::vector<FMTDevelopment>>
attributeTargets(
const std::vector<FMTDevelopment>& devs,
160 const FMTYields& ylds,
const std::vector<FMTTheme>& themes)
const;
192 const std::vector<FMTTheme>& originalthemes,
193 std::vector<FMTTheme>& newthemes,
bool compressdata=
false)
const;
203 const std::vector<FMTTheme>& p_originalThemes,
204 std::vector<FMTTheme>& p_newthemes,
bool p_compressdata =
false);
217 friend class boost::serialization::access;
218 template<
class Archive>
219 void serialize(Archive& ar,
const unsigned int version)
222 ar& boost::serialization::make_nvp(
"data", boost::serialization::base_object<
FMTList<FMTFork>>(*
this));
223 ar& BOOST_SERIALIZATION_NVP(name);
227 _exhandler->printExceptions(
"",
"FMTTransition::serialize", __LINE__, __FILE__);
256 std::string m_transitionName;
#define FMTEXPORT
Definition: FMTutility.h:125
List of specifications dictating the operability of a subset of developments to this action.
Definition: FMTAction.h:43
Base class of FMTActualDevelopment and FMTFuturDevelopment representing a forest stand.
Definition: FMTDevelopment.h:44
Fork of a transition, holding the transition masks (targets and proportions) applied to a development...
Definition: FMTFork.h:38
Definition: FMTAreaParser.h:32
Filter built from masks used to preSolve and postsolve FMTMask objects.
Definition: FMTMaskFilter.h:31
Core class holding, as a boost dynamic bitset, which theme attributes are part of a mask.
Definition: FMTMask.h:96
Comparator used to compare FMTTransition with std::find_if when transitions are in a std container.
Definition: FMTTransition.h:237
FMTTransitionComparator(std::string name)
Construct the comparator from the transition name to match.
bool operator()(const FMTTransition &transition) const
Matching test operator for the comparator.
List of FMTFork describing the transition of an action, disturbing a development to generate new deve...
Definition: FMTTransition.h:35
FMTTransition()
Default constructor for FMTTransition.
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).
FMTTransition(const std::string &lname)
Construct a transition keeping only its name.
bool isLeaking() const
Return true if a fork has a total proportion different from 1.
FMTTransition & operator+=(const FMTTransition &OtherTransition)
Append another transition to this transition, which needs to be unshrunk otherwise an exception is th...
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.
const FMTFork * 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.
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 setName(const std::string &p_name)
Set the name of the transition.
std::string getName() const
Get the name of the transition.
Definition: FMTTransition.h:90
FMTTransition single() const
Return a transition that leads to a single development path, selecting the one with the highest area ...
~FMTTransition()=default
Default destructor for FMTTransition.
std::vector< Core::FMTMask > 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.
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.
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.
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.
std::string name
name of the FMTtranstion same name seen in FMTAction
Definition: FMTTransition.h:208
FMTTransition(const FMTTransition &rhs)
Copy constructor for FMTTransition.
FMTList containing multiple yield handlers as seen in the yield section, holding the information rela...
Definition: FMTYields.h:44
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34