FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMToperatingareaclusterer.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#include "FMTlpheuristic.hpp"
10#include <boost/serialization/serialization.hpp>
11#include <boost/serialization/nvp.hpp>
12#include <boost/serialization/export.hpp>
13#include <boost/serialization/vector.hpp>
14#include <vector>
15
16#ifdef FMTWITHOSI
17
18#ifndef FMToperatingareaclusterer_H_INCLUDED
19#define FMToperatingareaclusterer_H_INCLUDED
20namespace Heuristics
21{
22// DocString: FMToperatingareaclusterer
30 {
31 friend class boost::serialization::access;
32 template<class Archive>
33 void serialize(Archive& ar, const unsigned int version)
34 {
35 ar & boost::serialization::make_nvp("FMTlpheuristic", boost::serialization::base_object<FMTlpheuristic>(*this));
36 ar & BOOST_SERIALIZATION_NVP(clusters);
37 ar & BOOST_SERIALIZATION_NVP(numberofsimulationpass);
38
39 }
40 // DocString: FMToperatingareaclusterer::clusters
42 std::vector<FMToperatingareacluster>clusters;
43 // DocString: FMToperatingareaclusterer::numberofsimulationpass
45 int numberofsimulationpass;
46 // DocString: FMToperatingareaclusterer::minimalnumberofclusters
48 int minimalnumberofclusters;
49 // DocString: FMToperatingareaclusterer::maximalnumberofclusters
51 int maximalnumberofclusters;
52 // DocString: FMToperatingareaclusterer::totalarea
54 double totalarea;
55 // DocString: FMToperatingareaclusterer::getallbinaries
59 std::map<Core::FMTmask,std::vector<FMToperatingareaclusterbinary>>getallbinaries() const;
60 // DocString: FMToperatingareaclusterer::gettotalarea()
64 double calculatetotalarea() const;
65 // DocString: FMToperatingareaclusterer::gettotalarea
69 inline const double& gettotalarea() const
70 {
71 return totalarea;
72 }
73 // DocString: FMToperatingareaclusterer::addmaxminobjective
77 void addmaxminobjective(const FMToperatingareacluster& cluster, const FMToperatingareaclusterbinary& binary,
78 const std::vector<FMToperatingareaclusterbinary>& binaries,
79 const int& clusterid);
80 // DocString: FMToperatingareaclusterer::buildclustersvariables
85 void buildclustersvariables();
86 // DocString: FMToperatingareaclusterer::addobjective
91 void addobjective();
92 // DocString: FMToperatingareaclusterer::addlinksrows
97 void addlinksrows();
98 // DocString: FMToperatingareaclusterer::addlinksrows
103 void addforcingrows();
104 // DocString: FMToperatingareaclusterer::addnumberofclusterrows
108 void addnumberofclusterrows();
109 // DocString: FMToperatingareaclusterer::addareaconstraints
113 void addareaconstraints();
114
115 // DocString: FMToperatingareaclusterer::setallinteger
119 void setallinteger();
120 // DocString: FMToperatingareaclusterer::getspreadprobability
125 double getspreadprobability(const std::vector<FMToperatingareaclusterbinary>& incluster,const FMToperatingareaclusterbinary& target) const;
126 // DocString: FMToperatingareaclusterer::spread
131 bool spread(const FMToperatingareacluster& ignition,std::vector<FMToperatingareaclusterbinary>& assigned);
132 // DocString: FMToperatingareaclusterer::gettargetedoperatingareasize
136 double gettargetedoperatingareasize(const FMToperatingareacluster& target);
137 // DocString: FMToperatingareaclusterer::isvalidarea
141 bool isvalidarea(const FMToperatingareacluster& cluster,
142 const double& area, const size_t& actives) const;
143 // DocString: FMToperatingareaclusterer::unboundall
147 void unboundall();
148 // DocString: FMToperatingareaclusterer::getbinariesvariables
152 std::vector<int>getbinariesvariables() const;
153 public:
154 // DocString: FMToperatingareaclusterer::FMToperatingareaclusterer()
159 // DocString: FMToperatingareaclusterer::FMToperatingareaclusterer(const Models::FMTsolverinterface&,const size_t&,const std::vector<FMToperatingareacluster>&)
164 const size_t& lseed,const std::vector<FMToperatingareacluster>& lclusters,
165 int minimalnumberofclusters = -1,int maximalnumberofclusters = -1);
166 // DocString: FMToperatingareaclusterer::FMToperatingareaclusterer(const FMToperatingareaclusterer&)
171 // DocString: FMToperatingareaclusterer::operator =
176 // DocString: FMToperatingareaclusterer::setnumberofsimulationpass
181 void setnumberofsimulationpass(const int& pass);
182 // DocString: FMToperatingareaclusterer::~FMToperatingareaclusterer()
187 // DocString: FMToperatingareaclusterer::getbinariescount
191 size_t getbinariescount() const;
192 // DocString: FMToperatingareaclusterer::initialsolve
197 bool initialsolve() final;
198 // DocString: FMToperatingareaclusterer::branchnboundsolve
203 bool branchnboundsolve() final;
204 // DocString: FMToperatingareaclusterer::getsolution
208 std::vector<FMToperatingareacluster>getsolution() const;
209 // DocString: FMToperatingareaclusterer::buildproblem
214 void buildproblem();
215
216 };
217}
218
219BOOST_CLASS_EXPORT_KEY(Heuristics::FMToperatingareaclusterer)
220
221
222#endif
223#endif
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTlpheuristic.hpp:40
Definition: FMToperatingareacluster.hpp:28
Definition: FMToperatingareaclusterer.hpp:30
void setnumberofsimulationpass(const int &pass)
FMToperatingareaclusterer(const Models::FMTsolverinterface &interfacetype, const size_t &lseed, const std::vector< FMToperatingareacluster > &lclusters, int minimalnumberofclusters=-1, int maximalnumberofclusters=-1)
FMToperatingareaclusterer(const FMToperatingareaclusterer &)
Namespace regrouping all tools for solving LP/MIP problems using an heuristic.
Definition: FMTareaparser.hpp:43
FMTsolverinterface
Definition: FMTsolverinterface.hpp:21