FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
PYexportCore.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 PYEXPORTCORE_H_INCLUDED
9#define PYEXPORTCORE_H_INCLUDED
10
11#include "FMTGCBMtransition.hpp"
12#include "FMTobject.hpp"
13#include "FMTmask.hpp"
14#include "FMTtheme.hpp"
15#include "FMTbounds.hpp"
16#include "FMTdevelopment.hpp"
19#include "FMTaction.hpp"
20#include "FMTtransition.hpp"
21#include "FMToutput.hpp"
22#include "FMTconstraint.hpp"
23#include "FMTschedule.hpp"
24#include "FMTyields.hpp"
25#include "FMTconstants.hpp"
26#include "boost/python.hpp"
27//#include "FMTdata.hpp"
30#include "FMTmaskfilter.hpp"
31#include "FMTtransitionmask.hpp"
32
33namespace Python
34{
35
36BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getattributes_overloads, getattributes, 1, 2)
37//BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getnodes_overloads, getnodes, 3, 4)
38BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getnodes_overloads, getnodes, 1, 4)
39BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getyieldrequest_overloads, getyieldrequest, 0, 0)
40BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(operable_overloads, operable, 2, 3)
41
43 {
44 namespace bp = boost::python;
45 bp::object CoreModule(bp::handle<>(bp::borrowed(PyImport_AddModule("FMT.Core"))));
46 bp::scope().attr("Core") = CoreModule;
47 bp::scope Core_scope = CoreModule;
48 bp::scope().attr("__doc__") = ".. module:: Core\n"
49 "\n"
50 " :platform: Unix, Windows\n"
51 " :synopsis: Core class for generating Forest Models.\n"
52 "\n";
53
54 bp::enum_<Core::FMTsection>("FMTsection")
55 .value("Control", Core::FMTsection::Control)
56 .value("Landscape", Core::FMTsection::Landscape)
57 .value("Area", Core::FMTsection::Area)
58 .value("Action", Core::FMTsection::Action)
59 .value("Transition", Core::FMTsection::Transition)
60 .value("Yield", Core::FMTsection::Yield)
61 .value("Outputs", Core::FMTsection::Outputs)
62 .value("Optimize", Core::FMTsection::Optimize)
63 .value("Constants", Core::FMTsection::Constants)
64 .value("Schedule", Core::FMTsection::Schedule)
65 .value("Empty", Core::FMTsection::Empty)
66 .export_values();
67
68 bp::enum_<Core::FMToutputlevel>("FMToutputlevel")
69 .value("standard", Core::FMToutputlevel::standard)
70 .value("totalonly", Core::FMToutputlevel::totalonly)
71 .value("developpement", Core::FMToutputlevel::developpement)
72 .export_values();
73
74 bp::enum_<Core::FMTconstrainttype>("FMTconstrainttype")
75 .value("FMTMAXobjective", Core::FMTconstrainttype::FMTMAXobjective)
76 .value("FMTMINobjective", Core::FMTconstrainttype::FMTMINobjective)
77 .value("FMTMAXMINobjective", Core::FMTconstrainttype::FMTMAXMINobjective)
78 .value("FMTMINMAXobjective", Core::FMTconstrainttype::FMTMINMAXobjective)
79 .value("FMTevenflow", Core::FMTconstrainttype::FMTevenflow)
80 .value("FMTnondeclining", Core::FMTconstrainttype::FMTnondeclining)
81 .value("FMTsequence", Core::FMTconstrainttype::FMTsequence)
82 .value("FMTstandard", Core::FMTconstrainttype::FMTstandard)
83 .value("FMTspatialsize", Core::FMTconstrainttype::FMTspatialsize)
84 .value("FMTspatialadjacency", Core::FMTconstrainttype::FMTspatialadjacency)
85 .value("FMTspatialgreenup", Core::FMTconstrainttype::FMTspatialgreenup)
86 .export_values();
87
88 bp::class_<Core::FMTobject>("FMTobject", "@DocString(FMTobject)")
89 .def("setdefaultexceptionhandler", &Core::FMTobject::setdefaultexceptionhandler,
90 "@DocString(FMTobject::setdefaultexceptionhandler)")
91 .def("setquietexceptionhandler", &Core::FMTobject::setquietexceptionhandler,
92 "@DocString(FMTobject::setquietexceptionhandler)")
93 .def("setdebugexceptionhandler", &Core::FMTobject::setdebugexceptionhandler,
94 "@DocString(FMTobject::setdebugexceptionhandler)")
95 .def("setfreeexceptionhandler", &Core::FMTobject::setfreeexceptionhandler,
96 "@DocString(FMTobject::setfreeexceptionhandler)")
97 .def("enablenestedexceptions", &Core::FMTobject::enablenestedexceptions,
98 "@DocString(FMTobject::enablenestedexceptions)")
99 .def("disablenestedexceptions", &Core::FMTobject::disablenestedexceptions,
100 "@DocString(FMTobject::disablenestedexceptions)")
101 .def("setdefaultlogger", &Core::FMTobject::setdefaultlogger,
102 "@DocString(FMTobject::setdefaultlogger)")
103 .def("setdebuglogger", &Core::FMTobject::setdebuglogger,
104 "@DocString(FMTobject::setdebuglogger)")
105 .def("setquietlogger", &Core::FMTobject::setquietlogger,
106 "@DocString(FMTobject::setquietlogger)")
107 .def("settasklogger", &Core::FMTobject::settasklogger,
108 "@DocString(FMTobject::settasklogger")
109 .def("redirectlogtofile", &Core::FMTobject::redirectlogtofile,
110 "@DocString(FMTobject::redirectlogtofile)")
111 .def("seterrorstowarnings", &Core::FMTobject::seterrorstowarnings,
112 "@DocString(FMTobject::seterrorstowarnings)");
113
114 bp::class_<Core::FMTmaskfilter>("FMTmaskfilter", "@DocString(FMTmaskfilter)");
115
116 define_pylist<Core::FMTmaskfilter>();
117 define_pylist<Core::FMTmask>();
118 define_pylist<Core::FMTdevelopment>();
119 define_pylist<Core::FMTfuturdevelopment>();
120 define_pylist<Core::FMTactualdevelopment>();
121 define_pydict<std::string, std::vector<Core::FMTdevelopment>>();
122
123 define_pylist<Core::FMTtheme>();
124 define_pylist<Core::FMTaction>();
125 define_pylist<Core::FMTtransition>();
126 define_pylist<Core::FMToutput>();
127 define_pylist<Core::FMTschedule>();
128 define_pylist<std::vector<Core::FMTschedule>>();
129 define_pylist<Core::FMTyieldhandler>();
130 define_pylist<Core::FMToutputsource>();
131 define_pylist<Core::FMToperator>();
132
133 define_pydict<Core::FMTdevelopment, std::vector<double>>();
134 define_pydict<Core::FMTaction,std::map<Core::FMTdevelopment, std::vector<double>>>();
135 py_pair<Core::FMTaction, std::map<Core::FMTdevelopment, std::vector<double>>>();
136 py_pair<Core::FMTaction const, std::map<Core::FMTdevelopment, std::vector<double>>>();
137
138 define_FMTlist<Core::FMTspec>();
139 define_pylist<std::vector<std::string>>();
140
141 bool (Core::FMTmask::*issubsetof)(const Core::FMTmask&) const = &Core::FMTmask::issubsetof;
142
143 bp::class_<Core::FMTmask>("FMTmask", "@DocString(FMTmask)")
144 .def(bp::init<Core::FMTmask>())
145 .def_pickle(FMT_pickle_suite<Core::FMTmask>())
146 .def(bp::init<const std::vector<std::string>&,const std::vector<Core::FMTtheme>&>())
147 .def(bp::init<const std::string&, const std::vector<Core::FMTtheme>&>())
148 .def("__len__", &Core::FMTmask::operator bool,
149 "@DocString(FMTmask::operator bool)")
150 .def("__str__",&Core::FMTmask::operator std::string,
151 "@DocString(FMTmask::operator std::string)")
152 .def("__eq__", &Core::FMTmask::operator ==,
153 "@DocString(FMTmask::operator==)")
154 .def("__ne__", &Core::FMTmask::operator !=,
155 "@DocString(FMTmask::operator!=)")
156 .def("__lt__", &Core::FMTmask::operator <,
157 "@DocString(FMTmask::operator<)")
158 .def("__hash__",&boost::pyhash<Core::FMTmask>)
159 .def("issubsetof",issubsetof,
160 "@DocString(FMTmask::issubsetof)")
161 .def("presolve",&Core::FMTmask::presolve,
162 "@DocString(FMTmask::presolve)")
163 .def("postsolve",&Core::FMTmask::postsolve,
164 "@DocString(FMTmask::postsolve)");
165
166 bp::class_<Core::FMTdevelopment>("FMTdevelopment", "@DocString(FMTdevelopment)")
167 .def_pickle(FMT_pickle_suite<Core::FMTdevelopment>())
168 .def(bp::init<Core::FMTdevelopment>())
169 .def("getage", &Core::FMTdevelopment::getage,
170 "@DocString(FMTdevelopment::getage)")
171 .def("getlock", &Core::FMTdevelopment::getlock,
172 "@DocString(FMTdevelopment::getlock)")
173 .def("getperiod", &Core::FMTdevelopment::getperiod,
174 "@DocString(FMTdevelopment::getperiod)")
175 .def("getmask", &Core::FMTdevelopment::getmaskcopy,
176 "@DocString(FMTdevelopment::getmask)")
177 .def("setage", &Core::FMTdevelopment::setage,
178 "@DocString(FMTdevelopment::setage)")
179 .def("setlock", &Core::FMTdevelopment::setlock,
180 "@DocString(FMTdevelopment::setlock)")
181 .def("setperiod", &Core::FMTdevelopment::setperiod,
182 "@DocString(FMTdevelopment::setperiod)")
183 .def("setmask", &Core::FMTdevelopment::setmask,
184 "@DocString(FMTdevelopment::setmask)")
185 .def("__eq__", &Core::FMTdevelopment::operator ==,
186 "@DocString(FMTdevelopment::operator==)")
187 .def("__ne__", &Core::FMTdevelopment::operator !=,
188 "@DocString(FMTdevelopment::operator!=)")
189 .def("__lt__",&Core::FMTdevelopment::operator <,
190 "@DocString(FMTdevelopment::operator<")
191 .def("grow",&Core::FMTdevelopment::grow,
192 "@DocString(FMTdevelopment::grow)")
193 .def("operable",&Core::FMTdevelopment::operable,operable_overloads(bp::args("action,yields,yieldrequest"),"@DocString(FMTdevelopment::operable)"))
194 .def("operate",&Core::FMTdevelopment::operate,
195 "@DocString(FMTdevelopment::operate)")
196 .def("getyieldrequest",&Core::FMTdevelopment::getyieldrequest,getyieldrequest_overloads("@DocString(FMTdevelopment::getyieldrequest)"))
197 .def("__str__", &Core::FMTdevelopment::operator std::string,
198 "@DocString(FMTdevelopment::operator std::string)")
199 .setattr("__hash__",&boost::pyhash<Core::FMTdevelopment>);
200
201
202
203 bp::class_<Core::FMTagebounds>("FMTagebounds", "@DocString(FMTagebounds)")
204 .def(bp::init<Core::FMTagebounds>())
205 .def(bp::init<Core::FMTsection, int, int>());
206
207 bp::class_<Core::FMTperbounds>("FMTperbounds", "@DocString(FMTperbounds)")
208 .def(bp::init<Core::FMTperbounds>())
209 .def(bp::init<Core::FMTsection, int, int>());
210
211 bp::class_<Core::FMTyldbounds>("FMTyldbounds", "@DocString(FMTyldbounds)")
212 .def(bp::init<Core::FMTyldbounds>())
213 .def(bp::init<Core::FMTsection, std::string, double, double>());
214
215 bp::class_<Core::FMTlockbounds>("FMTlockbounds", "@DocString(FMTlockbounds)")
216 .def(bp::init<Core::FMTlockbounds>())
217 .def(bp::init<Core::FMTsection, int, int>());
218
219 bp::class_<Core::FMTspec>("FMTspec", "@DocString(FMTspec)")
220 .def(bp::init<Core::FMTspec>())
221 .def("getperiodlowerbound", &Core::FMTspec::getperiodlowerbound,
222 "@DocString(FMTspec::getperiodlowerbound)")
223 .def("getperiodupperbound", &Core::FMTspec::getperiodupperbound,
224 "@DocString(FMTspec::getperiodupperbound)")
225 .def("setbounds", &Core::FMTspec::setbounds, "@DocString(Core::FMTspec::setbounds())")
226 .def<bool(Core::FMTspec::*)(const Core::FMTagebounds&)>("addbounds", &Core::FMTspec::addbounds,
227 "@DocString(Core::FMTspec::addbounds(const FMTagebounds&))")
228 .def<bool(Core::FMTspec::*)(const Core::FMTyldbounds&)>("addbounds",&Core::FMTspec::addbounds,
229 "@DocString(Core::FMTspec::addbounds(const FMTyldbounds&))")
230 .def<bool(Core::FMTspec::*)(const Core::FMTlockbounds&)>("addbounds",&Core::FMTspec::addbounds,
231 "@DocString(Core::FMTspec::addbounds(const FMTlockbounds&))");
232
233 bp::class_<Core::FMTtransitionmask>("FMTtransitionmask", "@DocString(FMTtransitionmask)")
234 .def(bp::init<const std::string&, const std::vector<Core::FMTtheme>&, const double&>())
235 .def(bp::init<Core::FMTtransitionmask>());
236
237 bp::class_<Core::FMTfork, bp::bases<Core::FMTlist<Core::FMTspec>>>("FMTfork", "@DocString(FMTfork)")
238 .def(bp::init<Core::FMTfork>())
239 .def("add", &Core::FMTfork::add,
240 "@DocString(FMTfork::add)");
241
242
243
244
245 bp::class_<Core::FMTactualdevelopment, bp::bases<Core::FMTdevelopment>>("FMTactualdevelopment", "@DocString(FMTactualdevelopment)")
246 .def(bp::init<const Core::FMTmask&, const int&, const int&, const double&>())
247 .def(bp::init<Core::FMTactualdevelopment>())
249 "@DocString(FMTactualdevelopment::getarea)")
251 "@DocString(FMTactualdevelopment::setarea)")
252 .def("__eq__", &Core::FMTactualdevelopment::operator ==,
253 "@DocString(FMTactualdevelopment::operator==)")
254 .def("__ne__", &Core::FMTactualdevelopment::operator !=,
255 "@DocString(FMTactualdevelopment::operator!=)")
256 .def("__lt__", &Core::FMTactualdevelopment::operator <,
257 "@DocString(FMTactualdevelopment::operator<)");
258
259 bp::class_<Core::FMTfuturdevelopment, bp::bases<Core::FMTdevelopment>>("FMTfuturdevelopment", "@DocString(FMTfuturdevelopment)");
260
261 //Need preprocessor here
262
263
264 define_FMTlist<int>();
265 //define_pylist<string>();
266 //define_FMTlist<std::unique_ptr<Core::FMTyieldhandler>>();
267 define_FMTlist<Core::FMTfork>();
268
269
270
271 bp::class_<Core::FMTaction, bp::bases<Core::FMTlist<Core::FMTspec>>>("FMTaction", "@DocString(FMTaction)")
272 .def_pickle(FMT_pickle_suite<Core::FMTaction>())
273 .def(bp::init<Core::FMTaction>())
274 .def(bp::init<const std::string&,const bool&,const bool&>())
275 .def("__eq__",&Core::FMTaction::operator ==,
276 "@DocString(FMTaction::operator==)")
277 .def("__ne__",&Core::FMTaction::operator !=,
278 "@DocString(FMTaction::operator!=)")
279 .def("__lt__",&Core::FMTaction::operator <,
280 "@DocString(FMTaction::operator<)")
281 .def("__str__", &Core::FMTaction::operator std::string,
282 "@DocString(FMTaction::operator std::string)")
283 .def("getname",&Core::FMTaction::getname,
284 "@DocString(FMTaction::getname)")
285 .def("dorespectlock",&Core::FMTaction::dorespectlock,
286 "@DocString(FMTaction::dorespectlock)")
287 .def("useyield", &Core::FMTaction::useyield,
288 "@DocString(FMTaction::useyield)")
289 .def("push_aggregate", &Core::FMTaction::push_aggregate,
290 "@DocString(FMTaction::push_aggregate)")
291 .def("getaggregates", &Core::FMTaction::getaggregates,
292 "@DocString(FMTaction::getaggregates)")
293 .def("update", &Core::FMTaction::update,
294 "@DocString(FMTaction::update)")
295 .def_readwrite("isresetage",&Core::FMTaction::isresetage,
296 "@DocString(FMTaction::isresetage)")
297 .setattr("__hash__",&boost::pyhash<Core::FMTaction>);
298
299 bp::class_<Core::FMTlifespans, bp::bases<Core::FMTlist<int>>>("FMTlifespans", "@DocString(FMTlifespans)")
300 .def(bp::init<Core::FMTlifespans>());
301
302
303 bp::enum_<Core::FMTyldtype>("FMTyldtype")
304 .value("FMTageyld", Core::FMTyldtype::FMTageyld)
305 .value("FMTtimeyld", Core::FMTyldtype::FMTtimeyld)
306 .value("FMTcomplexyld", Core::FMTyldtype::FMTcomplexyld)
307 .export_values();
308
309 define_pydict<std::string, std::map<std::string,std::vector<double>>>();
310
311 define_pydict<std::string, std::vector<double>>();
312
313 bp::class_<Core::FMTyieldhandler>("FMTyieldhandler", "@DocString(FMTyieldhandler)")
314 .def(bp::init<Core::FMTyieldhandler>())
315 .def<bool (Core::FMTyieldhandler::*)(const std::string& yld, const double& value)>("push_data",&Core::FMTyieldhandler::push_data,
316 "@DocString(FMTyieldhandler::push_data(const std::string&,const double&))")
317 .def("push_base", &Core::FMTyieldhandler::push_base,
318 "@DocString(FMTyieldhandler::push_base)");
319
320
321 bp::class_<Core::FMTageyieldhandler,bp::bases<Core::FMTyieldhandler>>("FMTageyieldhandler", "@DocString(FMTageyieldhandler)")
322 .def(bp::init<const Core::FMTmask&>())
323 .def_pickle(FMT_pickle_suite<Core::FMTageyieldhandler>())
324 .def("__str__", &Core::FMTageyieldhandler::operator std::string,
325 "@DocString(FMTageyieldhandler::operator std::string)")
326 .def("setyieldvalues", &Core::FMTageyieldhandler::setyieldvalues,
327 "@DocString(FMTageyieldhandler::setyieldvalues)");
328
329 define_pylist<Core::FMTageyieldhandler>();
330
331 bp::class_<Core::FMTtimeyieldhandler,bp::bases<Core::FMTyieldhandler>>("FMTtimeyieldhandler", "@DocString(FMTtimeyieldhandler)")
332 .def(bp::init<const Core::FMTmask&>())
333 .def_pickle(FMT_pickle_suite<Core::FMTtimeyieldhandler>())
334 .def("__str__", &Core::FMTtimeyieldhandler::operator std::string,
335 "@DocString(FMTtimeyieldhandler::operator std::string)")
336 .def("setyieldvalues", &Core::FMTtimeyieldhandler::setyieldvalues,
337 "@DocString(FMTtimeyieldhandler::setyieldvalues)");
338
339 define_pylist<Core::FMTtimeyieldhandler>();
340
341 bp::class_<Core::FMTyields/*, bp::bases<Core::FMTlist<std::unique_ptr<Core::FMTyieldhandler>>>*/>("FMTyields", "@DocString(FMTyields)")
342 .def(bp::init<Core::FMTyields>())
343 .def_pickle(FMT_pickle_suite<Core::FMTyields>())
344 .def("getallyields", &Core::FMTyields::getallyields,
345 "@DocString(FMTyields::getallyields)")
346 .def("get", &Core::FMTyields::get,
347 "@DocString(FMTyields::get)")
348 .def("push_back", &Core::FMTyields::push_backagehandler,
349 "@DocString(FMTyields::push_backagehandler)")
350 .def("push_back", &Core::FMTyields::push_backtimehandler,
351 "@DocString(FMTyields::push_backtimehandler)")
352 .def("getallyieldnames", &Core::FMTyields::getallyieldnames,
353 "@DocString(FMTyields::getallyieldnames)")
354 .def("getfromfactor",&Core::FMTyields::getfromfactor,
355 "@DocString(FMTyields::getfromfactor)")
356 .def("update", &Core::FMTyields::update,
357 "@DocString(FMTyields::update)");
358
359
360
361 bp::class_<Core::FMTtransition, bp::bases<Core::FMTlist<Core::FMTfork>>>("FMTtransition", "@DocString(FMTtransition)")
362 .def_pickle(FMT_pickle_suite<Core::FMTtransition>())
363 .def(bp::init<Core::FMTtransition>())
364 .def(bp::init<const std::string&>())
365 .def("single",&Core::FMTtransition::single,
366 "@DocString(FMTtransition::single)")
367 .def("main_target", &Core::FMTtransition::main_target,
368 "@DocString(FMTtransition::main_target)")
369 .def("age_after", &Core::FMTtransition::age_after,
370 "@DocString(FMTtransition::age_after)")
371 .def("attribute_targets", &Core::FMTtransition::attribute_targets,
372 "@DocString(FMTtransition::attribute_targets)")
373 .def("__str__", &Core::FMTtransition::operator std::string,
374 "@DocString(FMTtransition::operator std::string)")
375 .def("__eq__",&Core::FMTtransition::operator ==,
376 "@DocString(FMTtransition::operator==)")
377 .def("__ne__",&Core::FMTtransition::operator !=,
378 "@DocString(FMTtransition::operator!=)")
379 .def("__lt__",&Core::FMTtransition::operator <,
380 "@DocString(FMTtransition::operator<)")
381 .def("getname",&Core::FMTtransition::getname,
382 "@DocString(FMTtransition::getname)");
383
384
385 bp::enum_<Core::FMTotar>("FMTotar")
386 .value("inventory", Core::FMTotar::inventory)
387 .value("actual", Core::FMTotar::actual)
388 .value("val", Core::FMTotar::val)
389 .value("timeyld", Core::FMTotar::timeyld)
390 .value("level", Core::FMTotar::level)
391 .export_values();
392
393 bp::class_<Core::FMToutputsource>("FMToutputsource", "@DocString(FMToutputsource)")
394 .def(bp::init<const Core::FMTspec&, const Core::FMTmask&,
395 Core::FMTotar, const std::string&,
396 const std::string&, const int&, const int&>())
397 .def(bp::init<Core::FMToutputsource>());
398
399 bp::class_<Core::FMToperator>("FMToperator", "@DocString(FMToperator)")
400 .def(bp::init<Core::FMToperator>());
401
402
403 bp::class_<Core::FMToutputnode>("FMToutputnode", "@DocString(FMToutputnode)")
404 .def(bp::init<const Core::FMTmask&,const std::string&>())
405 .def("__str__", &Core::FMToutputnode::operator std::string,
406 "@DocString(FMToutputnode::operator std::string)");
407
408 define_FMTlist<Core::FMToutputnode>();
409
410 bp::class_<Core::FMToutput>("FMToutput", "@DocString(FMToutput)")
411 .def(bp::init<Core::FMToutput>())
412 .def(bp::init<const std::string&, const std::string&, const std::string&,
413 const std::vector<Core::FMToutputsource>&,
414 const std::vector<Core::FMToperator>&>())
415 .def_pickle(FMT_pickle_suite<Core::FMTtransition>())
416 .def("getname",&Core::FMToutput::getname,
417 "@DocString(FMToutput::getname)")
418 .def("getdescription",&Core::FMToutput::getdescription,
419 "@DocString(FMToutput::getdescription)")
420 .def("empty", &Core::FMToutput::empty,
421 "@DocString(FMToutput::empty)")
422 .def("containslevel",&Core::FMToutput::containslevel,
423 "@DocString(FMToutput::containslevel)")
424 .def("islevel", &Core::FMToutput::islevel,
425 "@DocString(FMToutput::islevel)")
426 .def("isonlylevel", &Core::FMToutput::isonlylevel,
427 "@DocString(FMToutput::isonlylevel)")
428 .def("getnodes",&Core::FMToutput::getnodes, getnodes_overloads(bp::args("multiplier"), "@DocString(FMToutput::getnodes)"))
429 .def("__str__", &Core::FMToutput::operator std::string,
430 "@DocString(FMToutput::operator std::string)")
431 .def("__eq__",&Core::FMToutput::operator ==,
432 "@DocString(FMToutput::operator==)")
433 .def("__ne__",&Core::FMToutput::operator !=,
434 "@DocString(FMToutput::operator!=)");
435
436 bp::class_<Core::FMTtheme>("FMTtheme", "@DocString(FMTtheme)")
437 .def_pickle(FMT_pickle_suite<Core::FMTtheme>())
438 .def(bp::init<const std::vector<std::string>&,const std::vector<std::string>&,const std::vector<std::string>&,const std::vector<std::vector<std::string>>&,const size_t&,const size_t&, const std::string&>())
439 .def(bp::init<Core::FMTtheme>())
440 .def("__str__", &Core::FMTtheme::operator std::string,
441 "@DocString(FMTtheme::operator std::string)")
442 .def("__eq__", &Core::FMTtheme::operator ==,
443 "@DocString(FMTtheme::operator==)")
444 .def("getattributes", &Core::FMTtheme::getattributes, getattributes_overloads(bp::args("value","aggregate_source"), "@DocString(FMTtheme::getattributes)"))
445 .def("getname", &Core::FMTtheme::getname,
446 "@DocString(FMTtheme::getname)");
447
448 bp::class_<Core::FMTconstants>("FMTconstants","@DocString(FMTconstants)");
449
450 bp::class_<Core::FMTschedule>("FMTschedule", "@DocString(FMTschedule)")
451 .def_pickle(FMT_pickle_suite<Core::FMTschedule>())
452 .def(bp::init<Core::FMTschedule>())
453 .def(bp::init<int, std::map<Core::FMTaction, std::map<Core::FMTdevelopment, std::vector<double>>>>())
454 .def("__str__", &Core::FMTschedule::operator std::string,
455 "@DocString(FMTschedule::operator std::string)")
456 .def("__add__", &Core::FMTschedule::operator +,
457 "@DocString(FMTschedule::operator+)")
458 .def("actionarea", &Core::FMTschedule::actionarea,
459 "@DocString(FMTschedule::actionarea)")
460 .def("getperiod", &Core::FMTschedule::getperiod,
461 "@DocString(FMTschedule::getperiod)")
462 .def("setperiod", &Core::FMTschedule::setperiod,
463 "@DocString(FMTschedule::setperiod)")
464 .def("__eq__", &Core::FMTschedule::operator ==,
465 "@DocString(FMTschedule::operator==)")
466 .def("__ne__", &Core::FMTschedule::operator !=,
467 "@DocString(FMTschedule::operator!=)")
468 .def("__iter__", boost::python::iterator<Core::FMTschedule>())
469 .def("empty",&Core::FMTschedule::empty,
470 "@DocString(FMTschedule::empty)");
471
472 bp::class_<Core::FMTGCBMtransition>("FMTGCBMtransition", "@DocString(FMTGCBMtransition)")
473 .def_readwrite("name", &Core::FMTGCBMtransition::name,
474 "@DocString(FMTGCBMtransition::name)")
475 .def_readwrite("ageafter", &Core::FMTGCBMtransition::ageafter,
476 "@DocString(FMTGCBMtransition::ageafter)")
477 .add_property("themes", bp::make_getter(&Core::FMTGCBMtransition::themes, bp::return_value_policy<bp::return_by_value>()),
478 bp::make_setter(&Core::FMTGCBMtransition::themes, bp::return_value_policy<bp::return_by_value>()));
479
480 bp::class_<Core::FMTconstraint, bp::bases<Core::FMToutput,Core::FMTspec>>("FMTconstraint", "@DocString(FMTconstraint)")
481 .def(bp::init<Core::FMTconstraint>())
482 .def(bp::init<Core::FMTconstrainttype,const Core::FMToutput&>())
483 .def("__str__", &Core::FMTconstraint::operator std::string,
484 "@DocString(FMTconstraint::operator std::string)")
485 .def("__eq__", &Core::FMTconstraint::operator ==,
486 "@DocString(FMTconstraint::operator==)")
487 .def("getiterationchange",&Core::FMTconstraint::getiterationchange,
488 "@DocString(FMTconstraint::getiterationchange,)")
489 .def("isspatial",&Core::FMTconstraint::isspatial,
490 "@DocString(FMTconstraint::isspatial)")
491 .def("setlength", &Core::FMTconstraint::setlength,
492 "@DocString(FMTconstraint::setlength)")
493 .def("issetfrom", &Core::FMTconstraint::issetfrom,
494 "@DocString(FMTconstraint::issetfrom)")
495 .def("setfrom", &Core::FMTconstraint::setfrom,
496 "@DocString(FMTconstraint::setfrom)")
497 .def("sense",&Core::FMTconstraint::sense,
498 "@DocString(FMTconstraint::sense)")
499 .def("getconstrainttype", &Core::FMTconstraint::getconstrainttype,
500 "@DocString(FMTconstraint::getconstrainttype)")
501 .def("getfromreplicate", &Core::FMTconstraint::getfromreplicate,
502 "@DocString(FMTconstraint::getfromreplicate)")
503 .def("getscheduleweight", &Core::FMTconstraint::getscheduleweight,
504 "@DocString(FMTconstraint::getscheduleweight)");
505
506 define_FMTlist<Core::FMTconstraint>();
507 define_FMTlist<Core::FMTGCBMtransition>();
508
509 bp::class_<Core::FMTyieldrequest>("FMTyieldrequest", "@DocString(FMTyieldrequest)");
510
511 define_FMTlist<Core::FMTyieldrequest>();
512
513
514 }
515}
516
517#endif // PYEXPORTCORE_H_INCLUDED
std::map< std::string, std::string > themes
Map where's the key is the theme name and the element is the new attribute set after the transition.
Definition: FMTGCBMtransition.hpp:47
int ageafter
Describe the age set on the strata after the disturbance.
Definition: FMTGCBMtransition.hpp:44
std::string name
The name of the GCBM transition.
Definition: FMTGCBMtransition.hpp:50
Definition: FMTaction.hpp:42
std::vector< std::string > getaggregates() const
bool dorespectlock() const
Definition: FMTaction.hpp:160
bool isresetage() const
Definition: FMTaction.hpp:169
std::string getname() const
Definition: FMTaction.hpp:151
void push_aggregate(const std::string &aggregate)
bool useyield(const std::string &yldname) const
void update() override
double getarea() const override
void setarea(const double &newarea)
Definition: FMTbounds.hpp:272
virtual void setyieldvalues(const std::string &yldname, const std::vector< int > &baseages, const std::vector< double > &values)
void setlength(int firstperiod=1, int lastperiod=std::numeric_limits< int >::max())
bool issetfrom(const std::string &modeltype) const
double sense() const
Core::FMTconstraint getfromreplicate(const size_t &replicate, const int &period) const
double getscheduleweight() const
Core::FMTconstraint setfrom(const std::string &modeltype, const double &value) const
bool isspatial() const
FMTconstrainttype getconstrainttype() const
Core::FMTconstraint getiterationchange(const std::vector< double > &periodchanges, const int &targetperiod) const
Definition: FMTdevelopment.hpp:44
FMTyieldrequest getyieldrequest(const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const
std::vector< FMTdevelopmentpath > operate(const FMTaction &action, const FMTtransition &Transition, const Core::FMTyields &ylds, const std::vector< FMTtheme > &themes) const
void setage(const int &lage)
int getlock() const
Definition: FMTdevelopment.hpp:90
Core::FMTmask getmaskcopy() const
Definition: FMTdevelopment.hpp:114
void setlock(const int &llock)
void setperiod(const int &lperiod)
void setmask(const Core::FMTmask &lmask)
bool operable(const FMTaction &action, const Core::FMTyields &ylds, const Graph::FMTgraphvertextoyield *graphyieldrequest=nullptr) const
int getage() const
Definition: FMTdevelopment.hpp:82
int getperiod() const
Definition: FMTdevelopment.hpp:98
FMTfuturdevelopment grow() const
void add(const FMTtransitionmask &transition)
Definition: FMTbounds.hpp:314
Definition: FMTmask.hpp:96
FMTmask presolve(const FMTmaskfilter &filter, const std::vector< FMTtheme > &presolvedthemes) const
bool issubsetof(const boost::dynamic_bitset<> &rhs) const
Definition: FMTmask.hpp:352
FMTmask postsolve(const FMTmaskfilter &filter, const std::vector< FMTtheme > &basethemes) const
virtual void setquietlogger()
void seterrorstowarnings(const std::vector< Exception::FMTexc > &errors)
void enablenestedexceptions()
void redirectlogtofile(const std::string &location)
void disablenestedexceptions()
void setdebugexceptionhandler()
void setquietexceptionhandler()
virtual void setdefaultlogger()
void setdefaultexceptionhandler()
void setfreeexceptionhandler()
virtual void settasklogger()
virtual void setdebuglogger()
bool empty() const
bool containslevel() const
std::vector< FMToutputnode > getnodes(std::vector< std::string > &equation, double multiplier=1, bool orderbyoutputid=false, int period=1) const
bool islevel() const
std::string getname() const
Definition: FMToutput.hpp:116
bool isonlylevel() const
std::string getdescription() const
Definition: FMToutput.hpp:124
bool empty() const
void setperiod(const int &newperiod)
double actionarea(const FMTaction &action) const
int getperiod() const
Definition: FMTschedule.hpp:134
Definition: FMTbounds.hpp:342
int getperiodlowerbound() const
bool addbounds(const FMTagebounds &bound)
bool setbounds(const FMTperbounds &bound)
int getperiodupperbound() const
std::string getname() const
Definition: FMTtheme.hpp:267
std::vector< std::string > getattributes(const std::string &value, bool aggregate_source=false) const
virtual void setyieldvalues(const std::string &yldname, const int &startingperiod, const std::vector< double > &values)
std::map< std::string, std::vector< FMTdevelopment > > attribute_targets(const std::vector< FMTdevelopment > &devs, const FMTyields &ylds, const std::vector< FMTtheme > &themes) const
std::string getname() const
Definition: FMTtransition.hpp:87
FMTmask main_target(const std::vector< FMTdevelopment > &devs, const FMTyields &ylds) const
FMTtransition single() const
unsigned int age_after(const std::vector< FMTdevelopment > &devs, const FMTaction &action, const FMTyields &ylds, const std::vector< FMTtheme > &themes) const
Definition: FMTyieldhandler.hpp:31
bool push_base(const int &base)
virtual bool push_data(const std::string &yld, const double &value)
Definition: FMTyields.hpp:40
std::map< std::string, std::map< std::string, std::vector< double > > > getallyields(const FMTtheme &target, FMTyldtype type) const
void update() override
std::vector< std::string > getallyieldnames() const
void push_backtimehandler(const FMTmask &mask, const FMTtimeyieldhandler &value)
double get(const FMTyieldrequest &request, const std::string &yld) const
void push_backagehandler(const FMTmask &mask, const FMTageyieldhandler &value)
FMTyields getfromfactor(const double &factor, std::vector< std::string >yieldnames=std::vector< std::string >()) const
Definition: FMTbounds.hpp:249
@ Control
Definition: FMTutility.hpp:24
@ Constants
Definition: FMTutility.hpp:32
@ Area
Definition: FMTutility.hpp:26
@ Outputs
Definition: FMTutility.hpp:30
@ Optimize
Definition: FMTutility.hpp:31
@ Landscape
Definition: FMTutility.hpp:25
@ Schedule
Definition: FMTutility.hpp:33
@ Action
Definition: FMTutility.hpp:27
@ Transition
Definition: FMTutility.hpp:28
@ Empty
Definition: FMTutility.hpp:35
@ Yield
Definition: FMTutility.hpp:29
@ FMTsequence
Definition: FMTconstraint.hpp:39
@ FMTspatialadjacency
Definition: FMTconstraint.hpp:42
@ FMTstandard
Definition: FMTconstraint.hpp:40
@ FMTMINMAXobjective
Definition: FMTconstraint.hpp:36
@ FMTnondeclining
Definition: FMTconstraint.hpp:38
@ FMTMAXMINobjective
Definition: FMTconstraint.hpp:35
@ FMTspatialsize
Regular constraint type like output = 1...
Definition: FMTconstraint.hpp:41
@ FMTMAXobjective
Definition: FMTconstraint.hpp:33
@ FMTMINobjective
Definition: FMTconstraint.hpp:34
@ FMTevenflow
Definition: FMTconstraint.hpp:37
@ FMTspatialgreenup
Definition: FMTconstraint.hpp:43
@ FMTcomplexyld
Definition: FMTutility.hpp:48
@ FMTageyld
Definition: FMTutility.hpp:46
@ FMTtimeyld
Definition: FMTutility.hpp:47
@ developpement
Definition: FMTutility.hpp:20
@ totalonly
Definition: FMTutility.hpp:19
@ standard
Definition: FMTutility.hpp:18
FMTotar
Definition: FMTutility.hpp:74
@ actual
Definition: FMTutility.hpp:76
@ val
Definition: FMTutility.hpp:77
@ level
Definition: FMTutility.hpp:79
@ timeyld
Definition: FMTutility.hpp:78
@ inventory
Definition: FMTutility.hpp:75
Definition: PYdefinitions.hpp:14
void exportCore()
Definition: PYexportCore.hpp:42