9#ifndef FMTACT_H_INCLUDED
10#define FMTACT_H_INCLUDED
15#include <boost/serialization/string.hpp>
16#include <boost/serialization/serialization.hpp>
17#include <boost/serialization/nvp.hpp>
20#include <unordered_set>
21#include <boost/serialization/export.hpp>
24#define FMTGCBMDEATHID 15
25#define FMTGCBMGROWTHID 16
26#define FMTGCBMUNKNOWNID 17
27#define FMTGCBMWILDFIREID 10
71 FMTaction(
const std::string& lname,
const bool& lock,
const bool& reset);
105 const std::vector<FMTtheme>& originalthemes,
106 std::vector<FMTtheme>& newthemes,
bool compressdata =
false)
const;
113 return agelowerbound;
121 return ageupperbound;
129 return periodlowerbound;
137 return periodupperbound;
145 return boost::hash<std::string>()(name);
179 return !series.empty();
202 void setseries(std::vector<std::vector<std::string>> seriesnames);
243 operator std::string()
const;
281 std::vector<std::vector<std::string>>
series;
298 friend class boost::serialization::access;
299 template<
class Archive>
300 void serialize(Archive& ar,
const unsigned int version)
303 ar& boost::serialization::make_nvp(
"specs", boost::serialization::base_object<
FMTlist<FMTspec>>(*
this));
304 ar& BOOST_SERIALIZATION_NVP(partials);
305 ar& BOOST_SERIALIZATION_NVP(agelowerbound);
306 ar& BOOST_SERIALIZATION_NVP(ageupperbound);
307 ar& BOOST_SERIALIZATION_NVP(periodlowerbound);
308 ar& BOOST_SERIALIZATION_NVP(periodupperbound);
309 ar& BOOST_SERIALIZATION_NVP(name);
310 ar& BOOST_SERIALIZATION_NVP(aggregates);
311 ar& BOOST_SERIALIZATION_NVP(lock);
312 ar& BOOST_SERIALIZATION_NVP(reset);
316 _exhandler->printexceptions(
"",
"FMTaction::serialize", __LINE__, __FILE__);
330 std::string action_name;
346 std::vector<const FMTaction*>
getallaggregates(
const std::vector<FMTaction>&actions,
bool aggregateonly =
false)
const;
352 std::unordered_set<int>
getallaggregatesset(
const std::vector<FMTaction>&actions,
bool aggregateonly =
false)
const;
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTaction.hpp:42
std::vector< std::string > getaggregates() const
bool dorespectlock() const
Definition: FMTaction.hpp:160
bool isresetage() const
Definition: FMTaction.hpp:169
FMTaction(const FMTaction &rhs)
std::vector< std::vector< std::string > > series
The action series that the action is part of.
Definition: FMTaction.hpp:281
bool isallowedinserie(const std::vector< std::string > &serie) const
void setaggregates(const std::vector< std::string > &p_aggregates)
Set a new vector of aggregates.
std::string getname() const
Definition: FMTaction.hpp:151
std::string name
The name of the action.
Definition: FMTaction.hpp:272
bool lock
If lock is true the action is not _lockexempt when false the action is _LOCKEXEMPT.
Definition: FMTaction.hpp:275
bool reset
If reset is true then the action is age reset Y else the action doen't reset age.
Definition: FMTaction.hpp:278
virtual ~FMTaction()=default
void push_aggregate(const std::string &aggregate)
bool useyield(const std::string &yldname) const
FMTaction & operator+=(const FMTaction &OtherAction)
append OtherAction to this action actions need to be the same kind of age reset otherwise it will thr...
std::vector< std::string > getGCBMactiondef() const
FMTaction presolve(const FMTmaskfilter &filter, const std::vector< FMTtheme > &originalthemes, std::vector< FMTtheme > &newthemes, bool compressdata=false) const
std::vector< std::string > aggregates
An action can be part of a aggregate so this data member gets the name of all aggregate the action is...
Definition: FMTaction.hpp:262
size_t hash() const
Definition: FMTaction.hpp:143
const int & getperiodlowerbound() const
Definition: FMTaction.hpp:127
FMTaction(const std::string &lname)
int getGCBMactionid() const
bool ispartofaserie() const
Definition: FMTaction.hpp:177
std::vector< std::string > partials
Keeps the yields name for determining the amount of wood harvested in case of partial cut.
Definition: FMTaction.hpp:265
void push_partials(const std::string &yield)
size_t getlargestseriesize() const
std::vector< std::string > getpartials() const
std::string getGCBMactionname() const
std::vector< std::string > getseriesnames() const
const int & getagelowerbound() const
Definition: FMTaction.hpp:111
FMTaction(const std::string &lname, const bool &lock, const bool &reset)
const int & getperiodupperbound() const
Definition: FMTaction.hpp:135
int agelowerbound
Definition: FMTaction.hpp:269
void setseries(std::vector< std::vector< std::string > > seriesnames)
bool partial(const std::string &yield) const
const int & getageupperbound() const
Definition: FMTaction.hpp:119
Definition: FMTaction.hpp:327
std::vector< const FMTaction * > getallaggregates(const std::vector< FMTaction > &actions, bool aggregateonly=false) const
std::unordered_set< int > getallaggregatesset(const std::vector< FMTaction > &actions, bool aggregateonly=false) const
bool operator()(const FMTaction &action) const
FMTactioncomparator(std::string name, bool lcheckaggregate=false)
Definition: FMTlist.hpp:46
Definition: FMTmaskfilter.hpp:27
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
Definition: FMTaction.hpp:364
std::size_t operator()(const Core::FMTaction &act) const
Definition: FMTaction.hpp:372