FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTbasevertexproperties.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 FMTbasevertexproperties_H_INCLUDED
9#define FMTbasevertexproperties_H_INCLUDED
10
13#include <boost/serialization/serialization.hpp>
14#include <boost/serialization/unique_ptr.hpp>
15#include <boost/serialization/split_member.hpp>
16#include <memory>
17
18
19
20namespace Graph
21{
23 {
24 // DocString: FMTbasevertexproperties::save
28 friend class boost::serialization::access;
29 template<class Archive>
30 void save(Archive& ar, const unsigned int version) const
31 {
32 ar & development->getarea();
33 ar & (*development); //turn it to a non virtual class
34 }
35 // DocString: FMTbasevertexproperties::load
39 template<class Archive>
40 void load(Archive& ar, const unsigned int version)
41 {
42 double areavalue = 0;
43 ar & areavalue;
45 ar & base;
46 if (areavalue!=0)
47 {
48
49 development = std::unique_ptr<Core::FMTdevelopment>(new Core::FMTactualdevelopment(base, areavalue));
50 }else {
51 development = std::unique_ptr<Core::FMTfuturdevelopment>(new Core::FMTfuturdevelopment(base));
52 }
53 }
54 BOOST_SERIALIZATION_SPLIT_MEMBER()
55 protected:
56 std::unique_ptr<Core::FMTdevelopment>development;
57 public:
58 virtual ~FMTbasevertexproperties() = default;
61 virtual inline int getconstraintID() const
62 {
63 return 0;
64 }
65 inline const Core::FMTdevelopment& get() const
66 {
67 return (*development);
68 }
69 bool operator < (const FMTbasevertexproperties& rhs) const;
75 const int& lconstraintID);
77 const int& lconstraintID);
79 const int& lconstraintID);
80 void setdevlopementmask(const Core::FMTmask& newmask);
81 double getbaseRHS() const;
82 size_t hash() const;
83 bool operator == (const FMTbasevertexproperties& rhs) const;
84 bool operator != (const FMTbasevertexproperties& rhs) const;
85 };
86}
87
88
89BOOST_CLASS_EXPORT_KEY(Graph::FMTbasevertexproperties)
90
91
92namespace boost {
93
94 template <>
95 struct hash<Graph::FMTbasevertexproperties>
96 {
97 std::size_t operator()(const Graph::FMTbasevertexproperties& vertex_properties) const
98 {
99 return vertex_properties.hash();
100 }
101 };
102
103
104}
105
106
107#endif
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTactualdevelopment.hpp:25
Definition: FMTdevelopment.hpp:44
Definition: FMTfuturdevelopment.hpp:24
Definition: FMTmask.hpp:96
Definition: FMTbasevertexproperties.hpp:23
void setdevlopementmask(const Core::FMTmask &newmask)
const Core::FMTdevelopment & get() const
Definition: FMTbasevertexproperties.hpp:65
FMTbasevertexproperties(const Core::FMTdevelopment &ldevelopment, const int &lconstraintID)
FMTbasevertexproperties(const Core::FMTfuturdevelopment &ldevelopment, const int &lconstraintID)
FMTbasevertexproperties(const Core::FMTfuturdevelopment &ldevelopment)
FMTbasevertexproperties(const Core::FMTdevelopment &ldevelopment)
FMTbasevertexproperties(const Core::FMTactualdevelopment &ldevelopment, const int &lconstraintID)
FMTbasevertexproperties(const Core::FMTactualdevelopment &ldevelopment)
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
Namespace for using/building unidirectional graphs in FMT.
Definition: FMTareaparser.hpp:31
Definition: FMTaction.hpp:364
std::size_t operator()(const Graph::FMTbasevertexproperties &vertex_properties) const
Definition: FMTbasevertexproperties.hpp:97