FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMToperatingarea.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#ifdef FMTWITHOSI
9
10#ifndef FMToperatingarea_H_INCLUDED
11#define FMToperatingarea_H_INCLUDED
12
13#include "FMTmask.hpp"
14#include <vector>
15#include <map>
16#include <memory>
17#include <boost/serialization/serialization.hpp>
18#include <boost/serialization/nvp.hpp>
19#include <boost/serialization/export.hpp>
20
21namespace Heuristics
22 {
23 // DocString: FMToperatingarea
29 {
30 // DocString: FMToperatingarea::serialize
34 friend class boost::serialization::access;
35 template<class Archive>
36 void serialize(Archive& ar, const unsigned int version)
37 {
38 ar & BOOST_SERIALIZATION_NVP(mask);
39 ar & BOOST_SERIALIZATION_NVP(neighbors);
40 ar & BOOST_SERIALIZATION_NVP(neihgborsperimeter);
41 ar & BOOST_SERIALIZATION_NVP(_area);
42 }
43 protected:
44 // DocString: FMToperatingarea::mask
47 // DocString: FMToperatingarea::neighbors
49 std::vector<Core::FMTmask>neighbors;
50 // DocString: FMToperatingarea::neihgborsperimeter
53 // DocString: FMToperatingarea::_area
55 double _area;
56 public:
57 // DocString: FMToperatingarea::operator+=
61 FMToperatingarea& operator += (const double& value);
62 // DocString: FMToperatingarea::getneighbors
66 std::vector<Core::FMTmask> getneighbors() const;
67 // DocString: FMToperatingarea::getarea
71 double getarea() const;
72 // DocString: FMToperatingarea::getneihgborsperimeter
77 double getneihgborsperimeter() const;
78 // DocString: FMToperatingarea::getmask
83 // DocString: FMToperatingarea::setneighbors
87 void setneighbors(const std::vector<Core::FMTmask>& lneighbors);
88 // DocString: FMToperatingarea(const Core::FMTmask,const double)
93 FMToperatingarea(const Core::FMTmask& lmask,const double& lneihgborsperimeter);
94 // DocString: FMToperatingarea::setarea
98 void setarea(const double& newarea);
99
100 // DocString: FMToperatingarea()
105 // DocString: FMToperatingarea(const FMToperatingarea)
109 FMToperatingarea(const FMToperatingarea& rhs) = default;
110 // DocString: FMToperatingarea::operator=
114 FMToperatingarea& operator = (const FMToperatingarea& rhs)=default;
115 // DocString: FMToperatingarea::operator==
119 bool operator == (const FMToperatingarea& rhs) const;
120 // DocString: FMToperatingarea::operator!=
124 bool operator != (const FMToperatingarea& rhs) const;
125 // DocString: ~FMToperatingarea()
129 virtual ~FMToperatingarea()=default;
130 // DocString: FMToperatingarea::presolve
135 FMToperatingarea presolveoperatingarea(const Core::FMTmaskfilter& filter, const std::vector<Core::FMTtheme>&presolvedthemes) const;
136 // DocString: FMToperatingarea::postsolve
140 FMToperatingarea postsolveoperatingarea(const Core::FMTmaskfilter& filter, const std::vector<Core::FMTtheme>&basethemes) const;
141
142 };
143
144 // DocString: FMToperatingareacomparator
149 {
150 // DocString: FMToperatingareacomparator::mask
152 Core::FMTmask mask;
153 public:
154 // DocString: FMToperatingareacomparator(const Core::FMTmask)
159 // DocString: FMToperatingareacomparator(const FMToperatingarea& oparea)
164 // DocString: FMToperatingareacomparator::operator()
168 bool operator()(const FMToperatingarea& oparea) const;
169
170 };
171
172 }
173 BOOST_CLASS_EXPORT_KEY(Heuristics::FMToperatingarea)
174#endif
175#endif
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTmask.hpp:96
Definition: FMTmaskfilter.hpp:27
Definition: FMToperatingarea.hpp:29
std::vector< Core::FMTmask > neighbors
Neighbors mask of the operating area.
Definition: FMToperatingarea.hpp:49
FMToperatingarea(const FMToperatingarea &rhs)=default
FMToperatingarea(const Core::FMTmask &lmask, const double &lneihgborsperimeter)
void setarea(const double &newarea)
Core::FMTmask mask
The mask describing the operating area.
Definition: FMToperatingarea.hpp:46
double getneihgborsperimeter() const
FMToperatingarea postsolveoperatingarea(const Core::FMTmaskfilter &filter, const std::vector< Core::FMTtheme > &basethemes) const
double neihgborsperimeter
neighborsperimeter is the ratio a operatingarea needs to share to a other operatingarea to be conside...
Definition: FMToperatingarea.hpp:52
double _area
The initial area of the operating area used as big M for the MIP.
Definition: FMToperatingarea.hpp:55
Core::FMTmask getmask() const
virtual ~FMToperatingarea()=default
FMToperatingarea presolveoperatingarea(const Core::FMTmaskfilter &filter, const std::vector< Core::FMTtheme > &presolvedthemes) const
void setneighbors(const std::vector< Core::FMTmask > &lneighbors)
std::vector< Core::FMTmask > getneighbors() const
Definition: FMToperatingarea.hpp:149
FMToperatingareacomparator(const FMToperatingarea &oparea)
bool operator()(const FMToperatingarea &oparea) const
FMToperatingareacomparator(const Core::FMTmask &lmask)
Namespace regrouping all tools for solving LP/MIP problems using an heuristic.
Definition: FMTareaparser.hpp:43