8#ifndef FMTOSR_H_INCLUDED
9#define FMTOSR_H_INCLUDED
14#include <boost/serialization/serialization.hpp>
17#include <unordered_set>
23 class FMTgraphvertextoyield;
28 class FMToutputparser;
36 class FMTactualdevelopment;
37 class FMTdevelopmentpath;
41 friend class boost::serialization::access;
43 template<
class Archive>
44 void serialize(Archive& ar,
const unsigned int version)
46 ar & boost::serialization::make_nvp(
"specification", boost::serialization::base_object<FMTspec>(*
this));
47 ar & BOOST_SERIALIZATION_NVP(mask);
48 ar & BOOST_SERIALIZATION_NVP(target);
49 ar & BOOST_SERIALIZATION_NVP(action);
50 ar & BOOST_SERIALIZATION_NVP(yield);
51 ar & BOOST_SERIALIZATION_NVP(values);
52 ar & BOOST_SERIALIZATION_NVP(themetarget);
56 std::string action,yield,levelname;
57 std::vector<double>values;
63 void pushvalues(
const std::vector<double>& newvalues);
68 std::string lyield=
"", std::string laction =
"",
int origin=-1,
int ttarget=-1);
70 std::vector<double>lvalues,
int origin = -1,
int ttarget=-1, std::string llevelname =
"");
72 const FMTotar ltarget, std::string lyield=
"",
73 std::string laction =
"",
int origin = -1,
int ttarget=-1);
76 operator std::string()
const override;
121 return (target == FMTotar::level);
125 return (target == FMTotar::val);
129 return (!action.empty() && islevel());
142 return (target == FMTotar::timeyld);
144 std::vector<const FMTaction*>
targets(
const std::vector<FMTaction>& actions)
const;
145 std::unordered_set<int>
targetsset(
const std::vector<FMTaction>& actions)
const;
148 return (target == FMTotar::inventory);
152 return (target == FMTotar::inventory);
156 return (target == FMTotar::inventory && action.empty());
160 return (target == FMTotar::actual);
165 std::vector<FMTdevelopmentpath>
const * paths=
nullptr,
185 const std::vector<Core::FMTaction>&actions,
const FMTyields& yields)
const;
186 size_t hash(
int period = -1,
bool withyield =
false)
const;
192 return !action.empty();
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTaction.hpp:42
Definition: FMTdevelopment.hpp:44
const Core::FMTmask & getmask() const
Definition: FMTdevelopment.hpp:106
bool is(const FMTspec &specification, const Core::FMTyields &ylds, const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const
Definition: FMTmask.hpp:96
bool issubsetof(const boost::dynamic_bitset<> &rhs) const
Definition: FMTmask.hpp:352
Definition: FMTmaskfilter.hpp:27
Definition: FMToperator.hpp:36
Definition: FMToutputsource.hpp:40
FMToutputsource presolve(const FMTmaskfilter &filter, const std::vector< FMTtheme > &newthemes) const
const std::string & getyield() const
Definition: FMToutputsource.hpp:106
bool isaction() const
Definition: FMToutputsource.hpp:190
const std::string & getaction() const
Definition: FMToutputsource.hpp:102
double getconstantvalue(const std::vector< Core::FMTactualdevelopment > &area, const std::vector< Core::FMTaction > &actions, const FMTyields &yields) const
std::vector< const FMTaction * > targets(const std::vector< FMTaction > &actions) const
bool isvariablelevel() const
Definition: FMToutputsource.hpp:127
FMToutputsource(const FMTotar ltarget, double lvalue=0, std::string lyield="", std::string laction="", int origin=-1, int ttarget=-1)
void setmask(const FMTmask &newmask)
bool issubsetof(const FMToutputsource &rhs, const std::vector< Core::FMTaction > &actions) const
const FMTotar & gettarget() const
Definition: FMToutputsource.hpp:110
double getcoef(const FMTdevelopment &development, const FMTyields &yields, const Graph::FMTgraphvertextoyield *graphinfo=nullptr, std::vector< FMTdevelopmentpath > const *paths=nullptr, FMTaction const *action=nullptr) const
bool isvariable() const
Definition: FMToutputsource.hpp:115
bool canbededucedtoconstant() const
bool isconstant() const
Definition: FMToutputsource.hpp:123
void settarget(const FMTotar &newtype)
std::unordered_set< int > targetsset(const std::vector< FMTaction > &actions) const
size_t hash(int period=-1, bool withyield=false) const
void setthemetarget(const int &newttarget)
const std::string & getlevel() const
Definition: FMToutputsource.hpp:131
bool isinventory() const
Definition: FMToutputsource.hpp:146
~FMToutputsource()=default
bool isnextperiod() const
Definition: FMToutputsource.hpp:154
bool issum() const
Definition: FMToutputsource.hpp:179
bool isnull(const FMTyields &ylds) const
bool istimeyield() const
Definition: FMToutputsource.hpp:140
void fillhashspec(Core::FMTmask &basemask) const
double getvalue(int period=0) const
bool useoutedges() const
Definition: FMToutputsource.hpp:158
FMToutputsource(const FMTotar ltarget, std::vector< double >lvalues, int origin=-1, int ttarget=-1, std::string llevelname="")
FMToutputsource(const FMTspec &spec, const FMTmask &lmask, const FMTotar ltarget, std::string lyield="", std::string laction="", int origin=-1, int ttarget=-1)
const FMTmask & getmask() const
Definition: FMToutputsource.hpp:92
const std::vector< double > & getvalues() const
Definition: FMToutputsource.hpp:135
FMToutputsource(const FMToutputsource &rhs)
bool isaverage() const
Definition: FMToutputsource.hpp:174
void setaction(const std::string &actionname)
bool isinaggregate(const FMToutputsource &rhs, const std::vector< Core::FMTaction > &actions) const
bool issubsetof(const FMToutputsource &rhs) const
void fillhashmask(Core::FMTmask &basemask) const
bool use(const FMTdevelopment &development, const FMTyields &ylds, const Graph::FMTgraphvertextoyield *graphinfo=nullptr) const
Definition: FMToutputsource.hpp:167
bool useinedges() const
Definition: FMToutputsource.hpp:150
int getoutputorigin() const
Definition: FMToutputsource.hpp:80
int getthemetarget() const
Definition: FMToutputsource.hpp:84
void resetvalues(const FMToperator &op, const FMToutputsource &other)
void setoutputorigin(const int &neworigin)
bool issamebutdifferentaction(const FMToutputsource &rhs) const
bool isequalbyvalue(const FMToutputsource &rhs) const
bool islevel() const
Definition: FMToutputsource.hpp:119
Definition: FMToutputsource.hpp:197
FMToutputsourcecomparator(bool lvariable)
bool operator()(const FMToutputsource &source) const
Definition: FMTbounds.hpp:342
Definition: FMTyields.hpp:40
Definition: FMTgraphvertextoyield.hpp:27
Definition: FMToutputparser.hpp:35
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
FMTotar
Definition: FMTutility.hpp:74
Namespace for using/building unidirectional graphs in FMT.
Definition: FMTareaparser.hpp:31
Namespace handling all FMT's parsers. Everything related to I/O should be located in this namespace.
Definition: FMTactionparser.hpp:26