FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTbaseedgeproperties.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 FMTbaseedgeproperties_H_INCLUDED
9#define FMTbaseedgeproperties_H_INCLUDED
10
11
12#include <boost/serialization/serialization.hpp>
13#include <boost/serialization/nvp.hpp>
14#include <boost/serialization/export.hpp>
15#include <vector>
16#include <string>
17
18namespace Core
19{
20 class FMTaction;
21}
22
23namespace Graph
24{
26 {
28 template<class Archive>
29 void serialize(Archive& ar, const unsigned int version)
30 {
31 ar & BOOST_SERIALIZATION_NVP(action);
32 }
33 protected:
34 int8_t action;
35 public:
36 virtual ~FMTbaseedgeproperties() = default;
40 FMTbaseedgeproperties(const int& laction,
41 const int& lvariableID,
42 const double& lproportion);
43 constexpr FMTbaseedgeproperties(const int& laction) : action(static_cast<int8_t>(laction)) {}
44 virtual inline int getvariableID() const
45 {
46 return 0;
47 }
48 virtual inline double getproportion() const
49 {
50 return 100;
51 }
52 inline int getactionID() const
53 {
54 return static_cast<int>(action);
55 }
56 void setactionID(const int& newid);
57 bool isaction(const std::vector<Core::FMTaction>& actions,
58 const Core::FMTaction& rhsaction) const;
59 /*virtual*/ bool operator == (const FMTbaseedgeproperties & rhs) const;
60 /*virtual*/ bool operator != (const FMTbaseedgeproperties& rhs) const;
61 bool operator < (const FMTbaseedgeproperties& rhs) const;
62 /*inline const short int* getactionptr() const
63 {
64 return &action;
65 }*/
66
67 };
68}
69
70BOOST_CLASS_EXPORT_KEY(Graph::FMTbaseedgeproperties)
71
72#endif
Definition: FMTaction.hpp:42
Definition: FMTbaseedgeproperties.hpp:26
virtual ~FMTbaseedgeproperties()=default
bool operator==(const FMTbaseedgeproperties &rhs) const
int8_t action
Definition: FMTbaseedgeproperties.hpp:34
virtual double getproportion() const
Definition: FMTbaseedgeproperties.hpp:48
void setactionID(const int &newid)
virtual int getvariableID() const
Definition: FMTbaseedgeproperties.hpp:44
bool operator<(const FMTbaseedgeproperties &rhs) const
int getactionID() const
Definition: FMTbaseedgeproperties.hpp:52
FMTbaseedgeproperties(const FMTbaseedgeproperties &rhs)=default
bool operator!=(const FMTbaseedgeproperties &rhs) const
constexpr FMTbaseedgeproperties(const int &laction)
Definition: FMTbaseedgeproperties.hpp:43
bool isaction(const std::vector< Core::FMTaction > &actions, const Core::FMTaction &rhsaction) const
friend class boost::serialization::access
Definition: FMTbaseedgeproperties.hpp:27
FMTbaseedgeproperties(const int &laction, const int &lvariableID, const double &lproportion)
FMTbaseedgeproperties & operator=(const FMTbaseedgeproperties &rhs)=default
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