FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTOperatingAreaCluster.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#ifdef FMTWITHOSI
9
10#ifndef FMToperatingareacluster_Hm_included
11#define FMToperatingareacluster_Hm_included
12
14#include <boost/serialization/serialization.hpp>
15#include <boost/serialization/nvp.hpp>
16#include <boost/serialization/export.hpp>
17#include <vector>
18
19namespace Heuristics
20{
21 // DocString: FMTOperatingAreaCluster
27 {
28 public:
29 // DocString: FMTOperatingAreaCluster::FMTOperatingAreaCluster()
34 // DocString: FMTOperatingAreaCluster::FMTOperatingAreaCluster(const FMTOperatingAreaClusterBinary&,const std::vector<FMTOperatingAreaClusterBinary>&)
41 const std::vector<FMTOperatingAreaClusterBinary>& p_neighborsbinaries);
42 // DocString: FMTOperatingAreaCluster::FMTOperatingAreaCluster(const FMTOperatingAreaCluster&,const double&,const double&)
50 const double& p_minimalarea,
51 const double& p_maximalarea);
52 // DocString: FMTOperatingAreaCluster::FMTOperatingAreaCluster(const FMTOperatingAreaCluster&)
57 // DocString: FMTOperatingAreaCluster::operator=
62 FMTOperatingAreaCluster& operator = (const FMTOperatingAreaCluster&) = default;
63 // DocString: FMTOperatingAreaCluster::~FMTOperatingAreaCluster()
68 // DocString: FMTOperatingAreaCluster::getBinary
75 // DocString: FMTOperatingAreaCluster::getCentroid
81 {
82 return m_centroid;
83 }
84 // DocString: FMTOperatingAreaCluster::getBinaries
89 inline std::vector<FMTOperatingAreaClusterBinary> getBinaries() const
90 {
91 return m_binaries;
92 }
93 // DocString: FMTOperatingAreaCluster::getMaximalObjectiveVariable
98 inline int getMaximalObjectiveVariable() const
99 {
100 return m_maxvar;
101 }
102 // DocString: FMTOperatingAreaCluster::getMinimalObjectiveVariable
108 {
109 return m_minvar;
110 }
111 // DocString: FMTOperatingAreaCluster::getMinimalArea
116 double getMinimalArea() const;
117 // DocString: FMTOperatingAreaCluster::getMaximalArea
122 double getMaximalArea() const;
123 // DocString: FMTOperatingAreaCluster::getMaximalStats
128 double getMaximalStats() const;
129 // DocString: FMTOperatingAreaCluster::getRealMinimalArea
134 inline double getRealMinimalArea() const
135 {
136 return m_minimalarea;
137 }
138 // DocString: FMTOperatingAreaCluster::getRealMaximalArea
143 inline double getRealMaximalArea() const
144 {
145 return m_maximalarea;
146 }
147 // DocString: FMTOperatingAreaCluster::getTotalPotentialArea
152 double getTotalPotentialArea() const;
153 // DocString: FMTOperatingAreaCluster::isValidArea
159 bool isValidArea(const double& area) const;
160 // DocString: FMTOperatingAreaCluster::setMaximalObjectiveVariable
165 void setMaximalObjectiveVariable(const int& lmaxvar);
166 // DocString: FMTOperatingAreaCluster::setMinimalObjectiveVariable
171 void setMinimalObjectiveVariable(const int& lminvar);
172 // DocString: FMTOperatingAreaCluster::setMinimalArea
177 void setMinimalArea(const double& newminimalarea);
178 // DocString: FMTOperatingAreaCluster::setMaximalArea
183 void setMaximalArea(const double& newmaximalarea);
184 // DocString: FMTOperatingAreaCluster::isValidAreaBounds
189 bool isValidAreaBounds() const;
190 // DocString: FMTOperatingAreaCluster::getFilteredCluster
197 // DocString: FMTOperatingAreaCluster::getAllMasks
202 std::vector<Core::FMTMask>getAllMasks() const;
203 private:
204 friend class boost::serialization::access;
205 // DocString: FMTOperatingAreaCluster::serialize
212 template<class Archive>
213 void serialize(Archive& ar, const unsigned int version)
214 {
215 ar & boost::serialization::make_nvp("maxvar", m_maxvar);
216 ar & boost::serialization::make_nvp("minvar", m_minvar);
217 ar & boost::serialization::make_nvp("minimalarea", m_minimalarea);
218 ar & boost::serialization::make_nvp("maximalarea", m_maximalarea);
219 ar & boost::serialization::make_nvp("binaries", m_binaries);
220 ar & boost::serialization::make_nvp("centroid", m_centroid);
221 }
222 // DocString: FMTOperatingAreaCluster::m_maxvar
224 int m_maxvar;
225 // DocString: FMTOperatingAreaCluster::m_minvar
227 int m_minvar;
228 // DocString: FMTOperatingAreaCluster::m_minimalarea
230 double m_minimalarea;
231 // DocString: FMTOperatingAreaCluster::m_maximalarea
233 double m_maximalarea;
234 // DocString: FMTOperatingAreaCluster::m_binaries
236 std::vector<FMTOperatingAreaClusterBinary>m_binaries;
237 // DocString: FMTOperatingAreaCluster::m_centroid
240 };
241}
242
243BOOST_CLASS_EXPORT_KEY(Heuristics::FMTOperatingAreaCluster)
244#endif
245#endif
#define FMTEXPORT
Definition: FMTutility.h:125
Core class holding, as a boost dynamic bitset, which theme attributes are part of a mask.
Definition: FMTMask.h:96
Definition of a non clustered operating area, used by the FMTOperatingAreaCluster.
Definition: FMTOperatingAreaClusterBinary.h:32
Potential cluster of multiple operating areas.
Definition: FMTOperatingAreaCluster.h:27
FMTOperatingAreaClusterBinary getCentroid() const
Return the centroid binary of the cluster.
Definition: FMTOperatingAreaCluster.h:80
void setMinimalArea(const double &newminimalarea)
Set the minimal area of the cluster.
const FMTOperatingAreaClusterBinary & getBinary(const Core::FMTMask &mask) const
Return the binary of the cluster corresponding to a given mask.
FMTOperatingAreaCluster(const FMTOperatingAreaCluster &)=default
Default copy constructor for FMTOperatingAreaCluster.
void setMinimalObjectiveVariable(const int &lminvar)
Set the minimal objective variable of the cluster.
FMTOperatingAreaCluster()=default
Default constructor for FMTOperatingAreaCluster.
void setMaximalObjectiveVariable(const int &lmaxvar)
Set the maximal objective variable of the cluster.
FMTOperatingAreaCluster getFilteredCluster(const Core::FMTMask &filterMask) const
Return a cluster with the binaries not falling in a mask definition removed, which can reduce the num...
double getMinimalArea() const
Get the minimal area of the potential cluster considering the number of binaries in the cluster.
double getRealMaximalArea() const
Return the maximal area member of the cluster.
Definition: FMTOperatingAreaCluster.h:143
double getTotalPotentialArea() const
Get the maximal potential area of the cluster.
int getMaximalObjectiveVariable() const
Return the maximal objective variable.
Definition: FMTOperatingAreaCluster.h:98
double getMaximalArea() const
Get the maximal area of the potential cluster considering the number of binaries in the cluster.
void setMaximalArea(const double &newmaximalarea)
Set the potential maximal area of the cluster.
FMTOperatingAreaCluster(const FMTOperatingAreaCluster &p_basecluster, const double &p_minimalarea, const double &p_maximalarea)
Complete constructor for FMTOperatingAreaCluster from a base cluster and its minimal and maximal area...
std::vector< FMTOperatingAreaClusterBinary > getBinaries() const
Return the binaries of the cluster.
Definition: FMTOperatingAreaCluster.h:89
bool isValidArea(const double &area) const
Check if an area is valid for the cluster (between the bounds).
double getMaximalStats() const
Get the maximal statistic for the whole cluster.
~FMTOperatingAreaCluster()=default
Default destructor for FMTOperatingAreaCluster.
int getMinimalObjectiveVariable() const
Return the minimal objective variable.
Definition: FMTOperatingAreaCluster.h:107
std::vector< Core::FMTMask > getAllMasks() const
Return all the masks contained by the cluster, including the operating area centroid.
double getRealMinimalArea() const
Return the minimal area member of the cluster.
Definition: FMTOperatingAreaCluster.h:134
FMTOperatingAreaCluster(const FMTOperatingAreaClusterBinary &p_localcentroid, const std::vector< FMTOperatingAreaClusterBinary > &p_neighborsbinaries)
Incomplete constructor for FMTOperatingAreaCluster from a centroid and its neighbors binaries.
bool isValidAreaBounds() const
Validate that the minimal and maximal area set by the user respect the binaries present in the cluste...
Namespace regrouping all tools for solving LP/MIP problems using an heuristic.
Definition: FMTAreaParser.h:47