FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTFork.h
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 FMTFORK_Hm_included
9#define FMTFORK_Hm_included
10
11#include "FMTTransitionMask.h"
12#include "FMTBounds.hpp"
13#include <vector>
14#include <boost/serialization/serialization.hpp>
15#include <boost/serialization/split_member.hpp>
16#include <boost/serialization/nvp.hpp>
17#include <boost/serialization/export.hpp>
18#include <boost/serialization/unique_ptr.hpp>
19#include <boost/serialization/vector.hpp>
20#include "FMTObject.h"
21
22namespace Core
23{
24
25class FMTDevelopment;
26class FMTDevelopmentPath;
27class FMTYieldRequest;
28class FMTYields;
29class FMTTheme;
30class FMTMaskFilter;
31
32
33// DocString: FMTFork
37class FMTEXPORT FMTFork : public FMTSpec, public FMTObject
38 {
39 public:
40 // DocString: FMTFork()
45 // DocString: FMTFork(const FMTFork&)
50 FMTFork(const FMTFork& rhs)=default;
51 // DocString: ~FMTFork()
56 // DocString: FMTFork::operator=
62 FMTFork& operator = (const FMTFork& rhs)=default;
63 // DocString: FMTFork::add
68 void add(const FMTTransitionMask& transition);
69 // DocString: FMTFork::clear
73 void clear();
74 // DocString: FMTFork::getPaths
83 std::vector<FMTDevelopmentPath> getPaths(const Core::FMTDevelopment& base, const Core::FMTYields& ylds,
84 const std::vector<FMTTheme>& themes,const bool& reset_age) const;
85 // DocString: FMTFork::getMax
94 FMTDevelopment getMax(const FMTDevelopment& base,const FMTYields& ylds,const std::vector<FMTTheme>& themes, const bool& reset_age) const;
95 // DocString: FMTFork::getMaskTrans
100 std::vector<FMTTransitionMask> getMaskTrans() const;
101 // DocString: FMTFork::operator==
107 bool operator == (const FMTFork& rhs) const;
108 // DocString: FMTFork::single
114 // DocString: FMTFork::sumProp
119 double sumProp() const;
120 // DocString: FMTFork::size
125 size_t size() const;
126 // DocString: FMTFork::preSolve
133 FMTFork preSolve(const FMTMaskFilter& filter, const std::vector<FMTTheme>&presolvedthemes) const;
134 // DocString: FMTFork::preSolveRef
140 void preSolveRef(const FMTMaskFilter& filter, const std::vector<FMTTheme>& presolvedthemes);
141 // DocString: FMTFork::operator std::string
146 operator std::string() const override;
147 private:
148 friend class boost::serialization::access;
149 // DocString: FMTFork::serialize
156 template<class Archive>
157 void serialize(Archive& ar, const unsigned int version)
158 {
159 ar& boost::serialization::make_nvp("specifications", boost::serialization::base_object<FMTSpec>(*this));
160 ar& m_transitions;
161 }
162 std::vector<FMTTransitionMask>m_transitions;
163 // DocString: FMTFork::_getPath
173 FMTDevelopmentPath _getPath(const FMTTransitionMask& p_target,
174 const Core::FMTDevelopment& p_base, const Core::FMTYields& p_yields,
175 const std::vector<FMTTheme>& p_themes, bool p_AgeReset) const;
176 };
177
178}
179
180BOOST_CLASS_EXPORT_KEY(Core::FMTFork)
181
182#endif // FMTFORK_Hm_included
#define FMTEXPORT
Definition: FMTutility.h:125
Development path holding a generated development and the proportion of area going to it.
Definition: FMTDevelopmentPath.h:26
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
FMTDevelopment getMax(const FMTDevelopment &base, const FMTYields &ylds, const std::vector< FMTTheme > &themes, const bool &reset_age) const
Return the development with the maximal proportion generated by the fork on a base development.
double sumProp() const
Return the sum of the proportions of the transition masks.
size_t size() const
Return the number of transition masks of the fork.
FMTFork preSolve(const FMTMaskFilter &filter, const std::vector< FMTTheme > &presolvedthemes) const
Return a presolved copy of the fork using a mask filter and the presolved themes.
~FMTFork()
Destructor for FMTFork.
std::vector< FMTTransitionMask > getMaskTrans() const
Return the transition masks of the fork.
void add(const FMTTransitionMask &transition)
Add a transition mask to the fork.
FMTFork()
Default constructor for FMTFork.
FMTFork single() const
Return a fork keeping only a single transition mask.
void clear()
Clear the transition masks of the fork.
void preSolveRef(const FMTMaskFilter &filter, const std::vector< FMTTheme > &presolvedthemes)
Presolve the fork in place using a mask filter and the presolved themes.
FMTFork(const FMTFork &rhs)=default
Copy constructor for FMTFork.
std::vector< FMTDevelopmentPath > getPaths(const Core::FMTDevelopment &base, const Core::FMTYields &ylds, const std::vector< FMTTheme > &themes, const bool &reset_age) const
Return the development paths generated by the fork on a base development.
Filter built from masks used to preSolve and postsolve FMTMask objects.
Definition: FMTMaskFilter.h:31
Base class of multiple FMT classes holding a shared exception handler pointer and logger.
Definition: FMTObject.h:49
Transition mask holding a target mask and a proportion, used to disturb a development in a transition...
Definition: FMTTransitionMask.h:35
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