8#ifndef FMTDEV_Hm_included
9#define FMTDEV_Hm_included
12#include <boost/serialization/serialization.hpp>
13#include <boost/serialization/nvp.hpp>
14#include <boost/serialization/string.hpp>
18#include <boost/serialization/export.hpp>
23 class FMTGraphVertexToYield;
30class FMTFuturDevelopment;
35class FMTDevelopmentPath;
66 return static_cast<int>(m_age);
84 return static_cast<int>(m_lock);
93 return static_cast<int>(m_period);
175 virtual std::unique_ptr<FMTDevelopment>
clone()
const;
252 virtual operator std::string()
const;
277 const std::vector<FMTTheme>& themes)
const;
334 const std::vector<FMTAction>& allactions)
const noexcept;
343 boost::hash_combine(seed, boost::hash<Core::FMTMask>()(m_mask));
344 boost::hash_combine(seed, boost::hash<uint8_t>()(m_age));
345 boost::hash_combine(seed, boost::hash<uint8_t>()(m_lock));
346 boost::hash_combine(seed, boost::hash<uint8_t>()(m_period));
361 const Core::FMTYldBounds& p_bound,
362 const std::string& p_yield)
const;
370 friend class boost::serialization::access;
371 template<
class Archive>
372 void serialize(Archive& ar,
const unsigned int version)
375 ar& boost::serialization::make_nvp(
"FMTobject", boost::serialization::base_object<FMTObject>(*
this));
376 ar& boost::serialization::make_nvp(
"mask", m_mask);
377 ar& boost::serialization::make_nvp(
"age", m_age);
378 ar& boost::serialization::make_nvp(
"lock", m_lock);
379 ar& boost::serialization::make_nvp(
"period", m_period);
383 _exhandler->printExceptions(
"",
"FMTDevelopment::serialize", __LINE__, __FILE__);
407 struct hash<
Core::FMTDevelopment>
#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
uint8_t getShortAge() const
Get the age of the development as a short int.
Definition: FMTDevelopment.h:73
void setMask(const Core::FMTMask &p_mask)
Set the mask of the development.
void setLock(const int &llock)
Set the lock of the development.
bool anyOperable(const std::vector< const FMTAction * > &actions, const Core::FMTYields &ylds, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
Check if this development is operable to any of the actions based on multiple yields.
bool worthTestingOperability(const FMTAction &action) const
Return true if it is worth testing operability for the action, used for optimization.
virtual ~FMTDevelopment()=default
Default virtual destructor for FMTDevelopment.
size_t hash() const
Return the hash of the development combining its mask, age, lock and period.
Definition: FMTDevelopment.h:340
bool is(const FMTSpec &specification, const Core::FMTYields &ylds, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
Check if this development respects a specification based on multiple yields.
const Core::FMTMask & getMask() const
Get a const reference to the mask of the development.
Definition: FMTDevelopment.h:100
std::string getNonOperabilityInfo(const FMTAction &p_action, const Core::FMTYields &p_yields, const Graph::FMTGraphVertexToYield *p_yieldRequest) const
Check why this developpement is not operable for p_action and return the info.
FMTFuturDevelopment grow() const
Return a grown copy of this development, increasing the age and period and decreasing the lock level ...
int getLock() const
Get the lock of the development.
Definition: FMTDevelopment.h:82
void setPeriod(const int &lperiod)
Set the period of the development.
void setAge(const int &lage)
Set the age of the development.
int getPeriod() const
Get the period of the development.
Definition: FMTDevelopment.h:91
bool operable(const FMTAction &action, const Core::FMTYields &ylds, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
Check if this development is operable to an action based on multiple yields.
Core::FMTMask getMaskCopy() const
Get a copy of the mask of the development.
Definition: FMTDevelopment.h:109
std::vector< FMTDevelopmentPath > operate(const FMTAction &action, const FMTTransition &Transition, const Core::FMTYields &ylds, const std::vector< FMTTheme > &themes) const
Return the development paths resulting from operating this development with an action and a transitio...
int getAge() const
Get the age of the development.
Definition: FMTDevelopment.h:64
FMTYieldRequest getYieldRequest(const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
Get a yield request for this development, without reference to a graph unless one is provided.
FMTDevelopment(const FMTDevelopment &rhs)
Copy constructor for FMTDevelopment.
FMTDevelopment()
Default constructor for FMTDevelopment.
FMTDevelopment(FMTDevelopment &&rhs)
Move copy constructor.
FMTDevelopment(const FMTMask &p_mask, const int &p_age, const int &p_lock, const int &p_period)
Construct a development from a mask, an age, a lock level and a period.
virtual double getArea() const
Return the area of the development.
std::vector< bool > isAnyWorthTestingOperability(const std::vector< const FMTAction * > &actions, const std::vector< FMTAction > &allactions) const noexcept
Return a vector of booleans, true if the corresponding action is worth testing for operability.
double getInventoryCoef(const Core::FMTYields &ylds, const std::string &target_yield, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
Return the inventory coefficient of the development for a given yield based on the yields.
FMTDevelopment(const FMTMask &p_mask, const int &p_age, const int &p_lock)
Construct a development from a mask, an age and a lock level.
virtual std::unique_ptr< FMTDevelopment > clone() const
Virtual clone function for FMTDevelopment.
double getHarvestCoef(const std::vector< FMTDevelopmentPath > &topaths, const FMTAction &action, const Core::FMTYields &ylds, const std::string &target_yield, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
Return the harvest coefficient of the development for a given yield following multiple development pa...
FMTDevelopment clearLock() const
Return a copy of this development with the lock level set to 0.
std::vector< int > anyWorthTestingOperability(const std::vector< const FMTAction * > &actions, const FMTAction &firstaction) const
Return the pointer distances from the first action of the actions worth testing for operability.
FMTDevelopment & operator=(FMTDevelopment &&rhs)
Move assignment operator for FMTDevelopment.
Child class of FMTDevelopment representing a future stand generated by growth or transition,...
Definition: FMTFuturDevelopment.h:23
Core class holding, as a boost dynamic bitset, which theme attributes are part of a mask.
Definition: FMTMask.h:96
Base class of multiple FMT classes holding a shared exception handler pointer and logger.
Definition: FMTObject.h:49
List of FMTFork describing the transition of an action, disturbing a development to generate new deve...
Definition: FMTTransition.h:35
Request for yield values using a development and optionally a graph vertex.
Definition: FMTYieldRequest.h:37
FMTList containing multiple yield handlers as seen in the yield section, holding the information rela...
Definition: FMTYields.h:44
Adapter pointing to a vertex of a line graph or a full graph and its model, used to answer a generic ...
Definition: FMTGraphVertexToYield.h:31
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34
Definition: FMTAreaParser.h:35
Definition: FMTAction.h:463
std::size_t operator()(const Core::FMTDevelopment &dev) const
Definition: FMTDevelopment.h:409