FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTtransition.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifndef FMTTRA_H_INCLUDED
9#define FMTTRA_H_INCLUDED
10
11#include "FMTfork.hpp"
12#include "FMTlist.hpp"
13#include <boost/serialization/serialization.hpp>
14#include <boost/serialization/string.hpp>
15#include <boost/serialization/export.hpp>
16#include <vector>
17#include <map>
18#include <string>
19
20
21namespace Core
22{
23class FMTyieldrequest;
24class FMTdevelopment;
25class FMTmask;
26class FMTaction;
27class FMTyields;
28class FMTtheme;
29// DocString: FMTtransition
36class FMTEXPORT FMTtransition : public FMTlist<FMTfork>
37 {
38 public:
39 // DocString: FMTtransition::operator+=
45 FMTtransition& operator+=(const FMTtransition& OtherTransition);
46 // DocString: FMTtransition()
51 // DocString: ~FMTtransition()
55 ~FMTtransition() = default;
56 // DocString: FMTtransition(const std::string&)
60 FMTtransition(const std::string& lname);
61 // DocString: FMTtransition(const FMTtransition&)
66 // DocString: FMTtransition::operator=
70 FMTtransition& operator = (const FMTtransition& rhs);
71 // DocString: FMTtransition::operator std::string
75 operator std::string() const;
76 // DocString: FMTtransition::single
83 // DocString: FMTtransition::getname
87 inline std::string getname() const
88 {
89 return name;
90 }
91 // DocString: FMTtransition::isleaking
96 bool isleaking() const;
97 // DocString: FMTtransition::getfork
102 const FMTfork* getfork(const Core::FMTdevelopment& developement, const FMTyields& ylds) const;
103 // DocString: FMTtransition::getstaticthemes
108 std::vector<FMTtheme>getstaticthemes(const std::vector<FMTtheme>& themes) const;
109 // DocString: FMTtransition::canproduce
113 std::vector<Core::FMTmask> canproduce(const Core::FMTmask& testmask,const std::vector<Core::FMTtheme>& themes) const;
114 // DocString: FMTtransition::age_after
120 unsigned int age_after(const std::vector<FMTdevelopment>& devs,
121 const FMTaction& action,
122 const FMTyields& ylds,
123 const std::vector<FMTtheme>& themes) const;
124 // DocString: FMTtransition::main_target
129 FMTmask main_target(const std::vector<FMTdevelopment>& devs,
130 const FMTyields& ylds) const;
131 // DocString: FMTtransition::attribute_targets
136 std::map<std::string, std::vector<FMTdevelopment>> attribute_targets(const std::vector<FMTdevelopment>& devs,
137 const FMTyields& ylds, const std::vector<FMTtheme>& themes) const;
138 // DocString: FMTtransition::operator<
142 bool operator < (const FMTtransition& rhs) const;
143 // DocString: FMTtransition::operator==
147 bool operator == (const FMTtransition& rhs) const;
148 // DocString: FMTtransition::operator!=
152 bool operator != (const FMTtransition& rhs) const;
153 // DocString: FMTtransition::presolve
159 const std::vector<FMTtheme>& originalthemes,
160 std::vector<FMTtheme>& newthemes,bool compressdata=false) const;
161 protected:
162 // DocString: FMTtransition::name
164 std::string name;
165 private:
166 // DocString: FMTtransition::serialize
170 friend class boost::serialization::access;
171 template<class Archive>
172 void serialize(Archive& ar, const unsigned int version)
173 {
174 try {
175 ar& boost::serialization::make_nvp("data", boost::serialization::base_object<FMTlist<FMTfork>>(*this));
176 ar& BOOST_SERIALIZATION_NVP(name);
177 }
178 catch (...)
179 {
180 _exhandler->printexceptions("", "FMTtransition::serialize", __LINE__, __FILE__);
181 }
182 }
183 };
184
185// DocString: FMTtransitioncomparator
190{
191 // DocString: FMTtransitioncomparator::transition_name
193 std::string transition_name;
194public:
195 // DocString: FMTtransitioncomparator(std::string)
199 FMTtransitioncomparator(std::string name);
200 // DocString: FMTtransitioncomparator(const FMTtransition&)
204 bool operator()(const FMTtransition& transition) const;
205
206};
207
208}
209
210BOOST_CLASS_EXPORT_KEY(Core::FMTtransition)
211#endif // FMTTRA_H_INCLUDED
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTaction.hpp:42
Definition: FMTdevelopment.hpp:44
Definition: FMTfork.hpp:34
Definition: FMTlist.hpp:46
Definition: FMTmask.hpp:96
Definition: FMTmaskfilter.hpp:27
Definition: FMTtransition.hpp:37
FMTtransition(const std::string &lname)
FMTtransition(const FMTtransition &rhs)
std::vector< Core::FMTmask > canproduce(const Core::FMTmask &testmask, const std::vector< Core::FMTtheme > &themes) const
std::vector< FMTtheme > getstaticthemes(const std::vector< FMTtheme > &themes) const
std::map< std::string, std::vector< FMTdevelopment > > attribute_targets(const std::vector< FMTdevelopment > &devs, const FMTyields &ylds, const std::vector< FMTtheme > &themes) const
const FMTfork * getfork(const Core::FMTdevelopment &developement, const FMTyields &ylds) const
bool isleaking() const
~FMTtransition()=default
std::string getname() const
Definition: FMTtransition.hpp:87
FMTmask main_target(const std::vector< FMTdevelopment > &devs, const FMTyields &ylds) const
FMTtransition & operator+=(const FMTtransition &OtherTransition)
append OtherTransition to this transition needs to be unskrink or it will throw an exception.
std::string name
name of the FMTtranstion same name seen in FMTaction
Definition: FMTtransition.hpp:164
FMTtransition single() const
FMTtransition presolve(const FMTmaskfilter &filter, const std::vector< FMTtheme > &originalthemes, std::vector< FMTtheme > &newthemes, bool compressdata=false) const
unsigned int age_after(const std::vector< FMTdevelopment > &devs, const FMTaction &action, const FMTyields &ylds, const std::vector< FMTtheme > &themes) const
Definition: FMTtransition.hpp:190
bool operator()(const FMTtransition &transition) const
FMTtransitioncomparator(std::string name)
Definition: FMTyields.hpp:40
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31