FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
PYexportModel.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 PYEXPORTMODEL_H_INCLUDED
9#define PYEXPORTMODEL_H_INCLUDED
10
11#include "FMTmodel.hpp"
12#include "FMTsrmodel.hpp"
13#include "FMTlpmodel.hpp"
14#include "FMTsemodel.hpp"
15#include "FMTsesmodel.hpp"
16#include "FMTnssmodel.hpp"
17#include "FMTsamodel.hpp"
18#include "FMTlpsolver.hpp"
19#include "FMTsaschedule.hpp"
20
21#include "boost/python.hpp"
22
23namespace Python
24{
25BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(greedyreferencebuild_overloads,greedyreferencebuild, 2, 4)
26BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(buildperiod_overloads, buildperiod, 0, 3)
27BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(get_outputs_overloads, get_outputs, 0, 1)
28BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getsolution_overloads, getsolution, 1, 2)
29BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getLPoutputoverloads, getoutput, 2, 3)
30BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getschedulesoverloads, getschedule, 0, 1)
31BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getpotentialscheduleoverloads, getpotentialschedule,2,3)
32BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(warmup_overloads, warmup, 2, 4)
33BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(evaluate_overloads, evaluate, 1, 2)
34BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getoperatingareaschedulerheuristics_overloads, getoperatingareaschedulerheuristics,2, 4)
35BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getoperatingareaclustererheuristics_overloads,getoperatingareaclustererheuristics,4,7)
36BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getareavariabilities_overloads, getareavariabilities,2,3)
37BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(boundsolution_overloads, boundsolution, 1, 2)
38BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(eraseperiod_overloads, eraseperiod,0,1)
39BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setsolution_overloads,setsolution, 2, 3)
40BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(setsolutionbylp_overloads,setsolutionbylp, 2, 3)
41BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(addscheduletoobjective_overloads, addscheduletoobjective, 1, 2)
42BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getarea_overloads, getarea, 0, 2)
43BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(doplanning_overloads,doplanning,1,2)
44BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(showparameters_overloads,showparameters,0,1)
45BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(eraseconstraint_overloads,eraseconstraint,1, 2)
46
48 {
49 namespace bp = boost::python;
50 bp::object ModelsModule(bp::handle<>(bp::borrowed(PyImport_AddModule("FMT.Models"))));
51 bp::scope().attr("Models") = ModelsModule;
52 bp::scope ModelsModule_scope = ModelsModule;
53 bp::scope().attr("__doc__") = ".. module:: Model\n"
54 "\n"
55 " :platform: Unix, Windows\n"
56 " :synopsis: Module used to generate all kind of Models (M2/M3).\n"
57 "\n";
58
59
60 bp::class_<Models::FMTmodel, bp::bases<Core::FMTobject>>("FMTmodel", "@DocString(FMTmodel)")
61 .def_pickle(FMT_pickle_suite<Models::FMTmodel>())
62 .def(bp::init<Models::FMTmodel>())
63 .def("getyields",&Models::FMTmodel::getyields,
64 "@DocString(FMTmodel::getyields)")
65 .def("setyields", &Models::FMTmodel::setyields,
66 "@DocString(FMTmodel::setyields)")
67 .def("setlifespan", &Models::FMTmodel::setlifespan,
68 "@DocString(FMTmodel::setlifespan)")
69 .def("addageyieldhandlers", &Models::FMTmodel::addyieldhandlers<Core::FMTageyieldhandler>,
70 "@DocString(FMTmodel::addyieldhandlers)")
71 .def("addtimeyieldhandlers", &Models::FMTmodel::addyieldhandlers<Core::FMTtimeyieldhandler>,
72 "@DocString(FMTmodel::addyieldhandlers)")
73 .def("getname", &Models::FMTmodel::getname,
74 "@DocString(FMTmodel::getname)")
75 .def("getarea",&Models::FMTmodel::getarea, getarea_overloads(bp::args("period","beforegrowanddeath"), "@DocString(FMTmodel::getarea)"))
76 .def("setarea", &Models::FMTmodel::setarea,
77 "@DocString(FMTmodel::setarea)")
78 .def("getthemes",&Models::FMTmodel::getthemes,
79 "@DocString(FMTmodel::getthemes)")
80 .def("setthemes", &Models::FMTmodel::setthemes,
81 "@DocString(FMTmodel::setthemes)")
82 .def("getactions",&Models::FMTmodel::getactions,
83 "@DocString(FMTmodel::getactions)")
84 .def("setactions", &Models::FMTmodel::setactions,
85 "@DocString(FMTmodel::setactions)")
86 .def("getoutputs", &Models::FMTmodel::getoutputs,
87 "@DocString(FMTmodel::getoutputs)")
88 .def("setoutputs", &Models::FMTmodel::setoutputs,
89 "@DocString(FMTmodel::setoutputs)")
90 .def("getconstraints", &Models::FMTmodel::getconstraints,
91 "@DocString(FMTmodel::getconstraints)")
92 .def("setconstraints", &Models::FMTmodel::setconstraints,
93 "@DocString(FMTmodel::setconstraints)")
94 .def("gettransitions",&Models::FMTmodel::gettransitions,
95 "@DocString(FMTmodel::gettransitions)")
96 .def("settransitions",&Models::FMTmodel::settransitions,
97 "@DocString(FMTmodel::settransitions)")
98 .def("setname", &Models::FMTmodel::setname,
99 "@DocString(FMTmodel::setname)")
100 .def("setareaperiod", &Models::FMTmodel::setareaperiod,
101 "@DocString(FMTmodel::setareaperiod)")
102 .def("getlifespan",&Models::FMTmodel::getlifespan,
103 "@DocString(FMTmodel::getlifespan)")
104 .def("isvalid",&Models::FMTmodel::isvalid,
105 "@DocString(FMTmodel::isvalid)")
106 .def("clearcache",&Models::FMTmodel::clearcache,
107 "@DocString(FMTmodel::clearcache)")
108 .def("getselectedmask",&Models::FMTmodel::getselectedmask,
109 "@DocString(FMTmodel::getselectedmask)")
110 .def("getpostsolvefilter",&Models::FMTmodel::getpostsolvefilter,
111 "@DocString(FMTmodel::getpostsolvefilter)")
112 .def("basepresolve",&Models::FMTmodel::basepresolve,
113 "@DocString(FMTmodel::basepresolve)")
114 .def("isoptimal", &Models::FMTmodel::isoptimal,
115 "@DocString(FMTmodel::isoptimal)")
116 .def("getobjectivevalue", &Models::FMTmodel::getobjectivevalue,
117 "@DocString(FMTmodel::getobjectivevalue)")
118 .def("getpotentialschedule", &Models::FMTmodel::getpotentialschedule,
119 getpotentialscheduleoverloads(bp::args("toremove","selection","withlock"),"@DocString(FMTmodel::getpotentialschedule)"))
120 //The way to expose overload member functions with different args
121 .def<bool (Models::FMTmodel::*)(const Models::FMTintmodelparameters& key, const int& value)>("setparameter", &Models::FMTmodel::setparameter,
122 "@DocString(FMTmodel::setparameter(const FMTintmodelparameters,const int&))")
123 .def<bool (Models::FMTmodel::*)(const Models::FMTdblmodelparameters& key, const double& value)>("setparameter", &Models::FMTmodel::setparameter,
124 "@DocString(FMTmodel::setparameter(const FMTdblmodelparameters,const double))")
125 .def<bool (Models::FMTmodel::*)(const Models::FMTboolmodelparameters& key, const bool& value)>("setparameter", &Models::FMTmodel::setparameter,
126 "@DocString(FMTmodel::setparameter(const FMTboolmodelparameters,const bool))")
127 .def<int (Models::FMTmodel::*)(const Models::FMTintmodelparameters& key)const>("getparameter", &Models::FMTmodel::getparameter,
128 "@DocString(FMTmodel::getparameter(const FMTintmodelparameters))")
129 .def<double (Models::FMTmodel::*)(const Models::FMTdblmodelparameters& key)const>("getparameter", &Models::FMTmodel::getparameter,
130 "@DocString(FMTmodel::getparameter(const FMTdblmodelparameters))")
131 .def<bool (Models::FMTmodel::*)(const Models::FMTboolmodelparameters& key)const>("getparameter", &Models::FMTmodel::getparameter,
132 "@DocString(FMTmodel::getparameter(const FMTboolmodelparameters))")
133 .def("setcompresstime",&Models::FMTmodel::setcompresstime,
134 "@DocString(FMTmodel::setcompresstime)")
135 .def("getcompresstime",&Models::FMTmodel::getcompresstime,
136 "@DocString(FMTmodel::getcompresstime)")
137 .def("showparameters",&Models::FMTmodel::showparameters,
138 showparameters_overloads(bp::args("showhelp"),"@DocString(FMTmodel::showparameters)"))
139 .def("doplanning",&Models::FMTmodel::doplanning,
140 doplanning_overloads(bp::args("solve"),"@DocString(FMTmodel::doplanning)"))
141 .def("getsolution", &Models::FMTmodel::getsolution,
142 getsolution_overloads(bp::args("period", "withlock"), "@DocString(FMTmodel::getsolution)"))
143 .def("getoutput", &Models::FMTmodel::getoutput,
144 getLPoutputoverloads(bp::args("output", "period", "level"), "@DocString(FMTsemodel::getoutput)"));
145
146 define_pylist<Models::FMTmodel>();
147
148
149
150 bp::to_python_converter<std::map<std::string, double>, MapToDict<std::string, double>>();
151
152 bp::class_<Models::FMTsemodel, bp::bases<Models::FMTmodel>>("FMTsemodel", "@DocString(FMTsemodel)")
153 .def(bp::init<Models::FMTmodel>())
154 .def_pickle(FMT_pickle_suite<Models::FMTsemodel>())
155 .def("getmapping", &Models::FMTsemodel::getmapping,
156 "@DocString(FMTsemodel::getmapping)")
157 .def("setinitialmapping", &Models::FMTsemodel::setinitialmapping,
158 "@DocString(FMTsemodel::setinitialmapping)")
159 .def("getschedule", &Models::FMTsemodel::getschedule,
160 getschedulesoverloads(bp::args("withlock"), "@DocString(FMTsemodel::getschedule)"))
161 .def("getdisturbancestats", &Models::FMTsemodel::getdisturbancestats,
162 "@DocString(FMTsemodel::getdisturbancestats)")
163 .def("getspatialoutput", &Models::FMTsemodel::getspatialoutput,
164 "@DocString(FMTsemodel::getspatialoutput)")
165 /*.def("getsolution", &Models::FMTsemodel::getsolution,
166 getsolution_overloads(bp::args("period", "withlock"),"@DocString(FMTsemodel::getsolution)"))
167 .def("getarea", &Models::FMTsemodel::getarea,
168 getarea_overloads(bp::args("period", "beforegrowanddeath"), "@DocString(FMTsemodel::getarea)"))
169 .def("getoutput", &Models::FMTsemodel::getoutput,
170 getLPoutputoverloads(bp::args("output", "period", "level"), "@DocString(FMTsemodel::getoutput)"))*/
171 .def("getspschedule", &Models::FMTsemodel::getspschedule,
172 "@DocString(FMTsemodel::getspschedule)");
173
174 define_pylist<Models::FMTsemodel>();
175
176
177 bp::class_<Models::FMTsesmodel, bp::bases<Models::FMTsemodel>>("FMTsesmodel", "@DocString(FMTsesmodel)")
178 .def(bp::init<Models::FMTmodel>())
179 .def_pickle(FMT_pickle_suite<Models::FMTsesmodel>())
180 .def("greedyreferencebuild", &Models::FMTsesmodel::greedyreferencebuild,
181 greedyreferencebuild_overloads(bp::args("schedule", "numberofiterations", "seed", "tolerance"), "@DocString(FMTsesmodel::greedyreferencebuild)"));
182
183 define_pylist<Models::FMTsesmodel>();
184
185 bp::enum_<Models::FMTintmodelparameters>("FMTintmodelparameters")
188 .value("NUMBER_OF_ITERATIONS", Models::FMTintmodelparameters::NUMBER_OF_ITERATIONS)
189 .value("PRESOLVE_ITERATIONS", Models::FMTintmodelparameters::PRESOLVE_ITERATIONS)
190 .value("NUMBER_OF_THREADS", Models::FMTintmodelparameters::NUMBER_OF_THREADS)
191 .value("MATRIX_TYPE", Models::FMTintmodelparameters::MATRIX_TYPE);
192
193 define_pylist<Models::FMTintmodelparameters>();
194
195 bp::enum_<Models::FMTdblmodelparameters>("FMTdblmodelparameters")
197 .value("GOALING_SCHEDULE_WEIGHT", Models::FMTdblmodelparameters::GOALING_SCHEDULE_WEIGHT);
198
199 define_pylist<Models::FMTdblmodelparameters>();
200
201 bp::enum_<Models::FMTboolmodelparameters>("FMTboolmodelparameters")
202 .value("FORCE_PARTIAL_BUILD", Models::FMTboolmodelparameters::FORCE_PARTIAL_BUILD)
203 .value("STRICTLY_POSITIVE", Models::FMTboolmodelparameters::STRICTLY_POSITIVE)
205 .value("SHOW_LOCK_IN_SCHEDULES", Models::FMTboolmodelparameters::SHOW_LOCK_IN_SCHEDULES)
206 .value("PRESOLVE_CAN_REMOVE_STATIC_THEMES", Models::FMTboolmodelparameters::PRESOLVE_CAN_REMOVE_STATIC_THEMES)
207 .value("DEBUG_MATRIX", Models::FMTboolmodelparameters::DEBUG_MATRIX);
208
209 define_pylist<Models::FMTboolmodelparameters>();
210
211
212
213 #ifdef FMTWITHOSI
214
215 bp::enum_<Models::FMTsolverinterface>("FMTsolverinterface")
217 #ifdef FMTWITHMOSEK
218 .value("MOSEK", Models::FMTsolverinterface::MOSEK)
219 #endif
220 .value("CPLEX", Models::FMTsolverinterface::CPLEX)
221 .value("GUROBI", Models::FMTsolverinterface::GUROBI);
222
223 define_pylist<Models::FMTsolverinterface>();
224
225 bp::class_<Models::FMTlpsolver>("FMTlpolver", "@DocString(FMTlpsolver)")
226 .def(bp::init<Models::FMTsolverinterface>())
227 .def("isProvenOptimal", &Models::FMTlpsolver::isProvenOptimal,
228 "@DocString(FMTlpsolver::isProvenOptimal)")
229 .def("getObjValue", &Models::FMTlpsolver::getObjValue,
230 "@DocString(FMTlpsolver::getObjValue)")
231 .def("getObjSense", &Models::FMTlpsolver::getObjSense,
232 "@DocString(FMTlpsolver::getObjSense)")
233 .def("setnumberofthreads", &Models::FMTlpsolver::setnumberofthreads,
234 "@DocString(FMTlpsolver::setnumberofthreads)")
235 .def("setMIPgaptolerance", &Models::FMTlpsolver::setMIPgaptolerance,
236 "@DocString(FMTlpsolver::setMIPgaptolerance)")
237 .def("setoptimizerMAXtime", &Models::FMTlpsolver::setoptimizerMAXtime,
238 "@DocString(FMTlpsolver::setoptimizerMAXtime)")
239 .def("writeLP", &Models::FMTlpsolver::writeLP,
240 "@DocString(FMTlpsolver::writeLP)")
241 .def("writeMPS", &Models::FMTlpsolver::writeMPS,
242 "@DocString(FMTlpsolver::writeMPS)");
243
244 bp::class_<Models::FMTsrmodel, bp::bases<Models::FMTmodel>>("FMTsrmodel", "@DocString(FMTsrmodel)")
245 .def_pickle(FMT_pickle_suite<Models::FMTsrmodel>())
246 .def("buildperiod", &Models::FMTsrmodel::buildperiod, buildperiod_overloads(bp::args("schedule", "forcepartialbuild", "compressageclass"), "@DocString(FMTsrmodel::buildperiod)"))
247
248 .def("setsolution", &Models::FMTsrmodel::setsolution,
249 setsolution_overloads(bp::args("period", "schedule", "tolerance"), "@DocString(FMTsrmodel::setsolution)"))
250 .def("forcesolution", &Models::FMTsrmodel::forcesolution, "@DocString(FMTsrmodel::forcesolution)")
251 .def("setsolutionbylp", &Models::FMTsrmodel::setsolutionbylp,
252 setsolutionbylp_overloads(bp::args("period", "schedule", "tolerance"), "@DocString(FMTsrmodel::setsolutionbylp)"))
253 //.def("getoutput", &Models::FMTsrmodel::getoutput, getLPoutputoverloads(bp::args("output", "period", "level"), "@DocString(FMTsrmodel::getoutput)"))
254 .def("cleargraphdevelopements", &Models::FMTsrmodel::cleargraphdevelopements,
255 "@DocString(FMTsrmodel::cleargraphdevelopements)")
256 .def("getstats", &Models::FMTsrmodel::getstats,
257 "@DocString(FMTsrmodel::getstats)")
258 .def("getavailablesolverinterface", &Models::FMTsrmodel::getavailablesolverinterface,
259 "@DocString(FMTsrmodel::getavailablesolverinterface)").staticmethod("getavailablesolverinterface")
260 .def("getscheduleproportions", &Models::FMTsrmodel::getscheduleproportions,
261 "@DocString(FMTsrmodel::getscheduleproportions)");
262
263 define_pylist<Models::FMTsrmodel>();
264
265 bp::class_<Models::FMTnssmodel, bp::bases<Models::FMTsrmodel>>("FMTnssmodel", "@DocString(FMTnssmodel)")
266 .def(bp::init<Models::FMTmodel, unsigned int>())
267 .def(bp::init<Models::FMTnssmodel>())
268 .def_pickle(FMT_pickle_suite<Models::FMTnssmodel>())
269 .def("simulate", &Models::FMTnssmodel::simulate);
270
271 define_pylist<Models::FMTnssmodel>();
272
273
274 bp::class_<Models::FMTlpmodel, bp::bases<Models::FMTsrmodel>>("FMTlpmodel", "@DocString(FMTlpmodel)")
275 .def(bp::init<Models::FMTmodel, Models::FMTsolverinterface>())
276 .def(bp::init<Models::FMTlpmodel>())
277 .def_pickle(FMT_pickle_suite<Models::FMTlpmodel>())
278 //.def("boundsolution", &Models::FMTlpmodel::boundsolution,
279 // boundsolution_overloads(bp::args("period", "tolerance"),
280 // "@DocString(FMTlpmodel::boundsolution)"))
281 .def("setobjective", &Models::FMTlpmodel::setobjective,
282 "@DocString(FMTlpmodel::setobjective)")
283 .def("clearcache", &Models::FMTlpmodel::clearcache,
284 "@DocString(FMTlpmodel::clearcache)")
285 .def("clearconstraintlocation", &Models::FMTlpmodel::clearconstraintlocation,
286 "@DocString(FMTlpmodel::clearconstraintlocation)")
287 .def("setstrictlypositivesoutputsmatrix", &Models::FMTlpmodel::setstrictlypositivesoutputsmatrix,
288 "@DocString(FMTlpmodel::setstrictlypositivesoutputsmatrix)")
289 .def("setconstraint", &Models::FMTlpmodel::setconstraint,
290 "@DocString(FMTlpmodel::setconstraint)")
291 .def("eraseconstraint", &Models::FMTlpmodel::eraseconstraint,
292 eraseconstraint_overloads(bp::args("constraint","period"),"@DocString(FMTlpmodel::eraseconstraint)"))
293 .def("eraseperiod", &Models::FMTlpmodel::eraseperiod,
294 eraseperiod_overloads(bp::args("constraintsonly"), "@DocString(FMTlpmodel::eraseperiod)"))
295 .def("resolve", &Models::FMTlpmodel::resolve,
296 "@DocString(FMTlpmodel::resolve)")
297 .def("initialsolve", &Models::FMTlpmodel::initialsolve,
298 "@DocString(FMTlpmodel::initialsolve)")
299 .def("__eq__", &Models::FMTlpmodel::operator ==,
300 "@DocString(FMTlpmodel::operator==)")
301 .def("__ne__", &Models::FMTlpmodel::operator !=,
302 "@DocString(FMTlpmodel::operator!=)")
303
304 .def("getObjValue", &Models::FMTlpmodel::getObjValue,
305 "@DocString(FMTlpmodel::getObjValue)")
306 .def("getlocalconstraints",
308 "@DocString(FMTlpmodel::getreplanningconstraints)")
309 .def("writeLP",
311 "@DocString(FMTlpmodel::writeLP)")
312 .def("getoperatingareaschedulerheuristics", &Models::FMTlpmodel::getoperatingareaschedulerheuristics, getoperatingareaschedulerheuristics_overloads(bp::args("opareas", "node", "numberofheuristics", "copysolver","updatematrixname"), "@DocString(FMTlpmodel::getoperatingareaschedulerheuristics)"))
313 .def("getoperatingareaclustererheuristics", &Models::FMTlpmodel::getoperatingareaclustererheuristics, getoperatingareaclustererheuristics_overloads(bp::args("opareas", "statisticoutput", "areaoutput", "period", "numberofheuristics"), "@DocString(FMTlpmodel::getoperatingareaschedulerheuristics)"))
314 .def("getvariabilities", &Models::FMTlpmodel::getvariabilities, "@DocString(FMTlpmodel::getvariabilities)")
315 .def("getareavariabilities", &Models::FMTlpmodel::getareavariabilities, getareavariabilities_overloads(bp::args("outputs", "globalmask", "tolerance"), "@DocString(FMTlpmodel::getareavariabilities)"))
316 .def("addscheduletoobjective", &Models::FMTlpmodel::addscheduletoobjective, addscheduletoobjective_overloads(bp::args("schedule", "weight"),"@DocString(FMTlpmodel::addscheduletoobjective)"));
317 //.def("doplanning", &Models::FMTlpmodel::doplanning, doplanning_overloads(bp::args("solve", "schedules"),"@DocString(FMTlpmodel::doplanning)"));
318
319
320 define_pylist<Models::FMTlpmodel>();
321 #endif
322
323
324
325
326 bp::class_<Models::FMTsamodel, bp::bases<Models::FMTsemodel>>("FMTsamodel", "@DocString(FMTsamodel)")
327 .def(bp::init<Models::FMTmodel>())
328 .def(bp::init<Models::FMTsamodel>())
329 .def("initialsolve", &Models::FMTsamodel::initialsolve,
330 "@DocString(FMTsamodel::initialsolve)");
331
332 define_pylist<Models::FMTsamodel>();
333
334 }
335}
336#endif // PYEXPORTMODEL_H_INCLUDED
Graph::FMTgraphstats eraseconstraint(const Core::FMTconstraint &constraint, int period=-1)
void clearconstraintlocation()
Graph::FMTgraphstats eraseperiod(bool constraintsonly=false)
Graph::FMTgraphstats setconstraint(const Core::FMTconstraint &constraint)
void writeLP(const std::string &location)
Graph::FMTgraphstats setobjective(const Core::FMTconstraint &objective)
void setstrictlypositivesoutputsmatrix()
std::map< std::string, std::vector< double > > getvariabilities(const std::vector< Core::FMToutput > &outputs, const int &periodstart, const int &periodstop)
double getObjValue() const
std::vector< Heuristics::FMToperatingareascheduler > getoperatingareaschedulerheuristics(const std::vector< Heuristics::FMToperatingareascheme > &opareas, const Core::FMToutputnode &node, size_t numberofheuristics=1, bool copysolver=true)
std::vector< Heuristics::FMToperatingareaclusterer > getoperatingareaclustererheuristics(const std::vector< Heuristics::FMToperatingareacluster > &clusters, const Core::FMToutput &statisticoutput, const Core::FMToutput &areaoutput, const int &period, size_t numberofheuristics=1, int minimalnumberofclusters=-1, int maximalnumberofclusters=-1) const
std::map< std::string, std::vector< double > > getareavariabilities(const std::vector< Core::FMToutput > &localoutputs, const std::vector< Core::FMTmask > &globalmasks, std::vector< double > tolerances=std::vector< double >()) const
void addscheduletoobjective(const Core::FMTschedule &schedule, double weight=1000)
virtual std::vector< Core::FMTconstraint > getreplanningconstraints(const std::string &modeltype, const std::vector< Core::FMTconstraint > &localconstraints, const int &period) const
bool isProvenOptimal() const
void setMIPgaptolerance(const double &gap)
double getObjValue() const
void setoptimizerMAXtime(const double &time)
void writeLP(const std::string &location) const
double getObjSense() const
void setnumberofthreads(const size_t &nthread)
void writeMPS(const std::string &location) const
Definition: FMTmodel.hpp:60
void setname(const std::string &newname)
virtual void clearcache()
std::vector< int > getcompresstime() const
void setyields(const Core::FMTyields &lylds)
virtual Core::FMTschedule getsolution(int period, bool withlock=false) const
Core::FMTlifespans getlifespan() const
Definition: FMTmodel.hpp:233
virtual bool setparameter(const FMTintmodelparameters &key, const int &value)
void setconstraints(const std::vector< Core::FMTconstraint > &lconstraint)
std::string getname() const
Definition: FMTmodel.hpp:193
void setarea(const std::vector< Core::FMTactualdevelopment > &ldevs)
std::vector< Core::FMToutput > getoutputs() const
Definition: FMTmodel.hpp:241
Core::FMTyields getyields() const
Definition: FMTmodel.hpp:225
virtual bool isoptimal() const
std::vector< Core::FMTtransition > gettransitions() const
Definition: FMTmodel.hpp:217
virtual void showparameters(const bool &showhelp=false) const
Core::FMTmaskfilter getpostsolvefilter(const std::vector< Core::FMTtheme > &originalthemes, const Core::FMTmask &devmask) const
std::vector< Core::FMTaction > getactions() const
Definition: FMTmodel.hpp:209
std::vector< Core::FMTtheme > getthemes() const
Definition: FMTmodel.hpp:201
virtual std::vector< Core::FMTactualdevelopment > getarea(int period=0, bool beforegrowanddeath=false) const
bool setcompresstime(const int &periodstart, const int &periodstop, const int &value)
void setareaperiod(const int &period)
void setlifespan(const Core::FMTlifespans &llifespan)
void settransitions(const std::vector< Core::FMTtransition > &ltransitions)
void setoutputs(const std::vector< Core::FMToutput > &newoutputs)
int getparameter(const FMTintmodelparameters &key) const
void setactions(const std::vector< Core::FMTaction > &lactions)
virtual bool doplanning(const bool &solve, std::vector< Core::FMTschedule > schedules=std::vector< Core::FMTschedule >())
virtual double getobjectivevalue() const
FMTmodel basepresolve() const
Core::FMTschedule getpotentialschedule(std::vector< Core::FMTactualdevelopment > toremove, std::vector< Core::FMTactualdevelopment > selection, bool withlock=true) const
void setthemes(const std::vector< Core::FMTtheme > &lthemes)
Core::FMTmask getselectedmask(const std::vector< Core::FMTtheme > &originalthemes) const
std::vector< Core::FMTconstraint > getconstraints() const
Definition: FMTmodel.hpp:249
virtual std::map< std::string, double > getoutput(const Core::FMToutput &output, int period, Core::FMToutputlevel level=Core::FMToutputlevel::standard) const
virtual Spatial::FMTlayer< double > getspatialoutput(const Core::FMToutput &output, int period) const
std::string getdisturbancestats() const
std::vector< Core::FMTschedule > getschedule(bool withlock=false) const
Spatial::FMTspatialschedule getspschedule() const
Definition: FMTsemodel.hpp:100
Spatial::FMTforest getmapping() const
bool setinitialmapping(Spatial::FMTforest forest)
std::map< std::string, double > greedyreferencebuild(const Core::FMTschedule &schedule, const size_t &randomiterations, unsigned int seed=0, double tolerance=FMT_DBL_TOLERANCE)
bool setsolutionbylp(int period, const Core::FMTschedule &schedule, double tolerance=FMT_DBL_TOLERANCE)
Graph::FMTgraphstats buildperiod(Core::FMTschedule schedule=Core::FMTschedule(), bool forcepartialbuild=false, int compressageclassoperability=1)
Graph::FMTgraphstats getstats() const
static std::vector< Models::FMTsolverinterface > getavailablesolverinterface()
Core::FMTschedule getscheduleproportions(int period, bool withlock) const
void cleargraphdevelopements()
bool forcesolution(int period, const Core::FMTschedule &proportionschedulewithlock)
bool setsolution(int period, const Core::FMTschedule &schedule, double tolerance=FMT_DBL_TOLERANCE)
FMTdblmodelparameters
Definition: FMTmodelparameters.hpp:37
@ TOLERANCE
Definition: FMTmodelparameters.hpp:38
@ GOALING_SCHEDULE_WEIGHT
Definition: FMTmodelparameters.hpp:39
FMTintmodelparameters
Definition: FMTmodelparameters.hpp:24
@ LENGTH
Definition: FMTmodelparameters.hpp:25
@ SEED
Definition: FMTmodelparameters.hpp:26
@ MATRIX_TYPE
Definition: FMTmodelparameters.hpp:30
@ NUMBER_OF_THREADS
Definition: FMTmodelparameters.hpp:29
@ PRESOLVE_ITERATIONS
Definition: FMTmodelparameters.hpp:28
@ NUMBER_OF_ITERATIONS
Definition: FMTmodelparameters.hpp:27
FMTboolmodelparameters
Definition: FMTmodelparameters.hpp:45
@ DEBUG_MATRIX
Definition: FMTmodelparameters.hpp:51
@ SHOW_LOCK_IN_SCHEDULES
Definition: FMTmodelparameters.hpp:49
@ PRESOLVE_CAN_REMOVE_STATIC_THEMES
Definition: FMTmodelparameters.hpp:50
@ STRICTLY_POSITIVE
Definition: FMTmodelparameters.hpp:47
@ FORCE_PARTIAL_BUILD
Definition: FMTmodelparameters.hpp:46
@ POSTSOLVE
Definition: FMTmodelparameters.hpp:48
Definition: PYdefinitions.hpp:14
void exportModel()
Definition: PYexportModel.hpp:47