8#ifndef PYEXPORTCORE_H_INCLUDED
9#define PYEXPORTCORE_H_INCLUDED
15#include "FMTBounds.hpp"
26#include "boost/python.hpp"
38BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getattributes_overloads, getAttributes, 1, 2)
40BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getnodes_overloads, getNodes, 1, 4)
41BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getyieldrequest_overloads, getYieldRequest, 0, 0)
42BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(operable_overloads, operable, 2, 3)
46 namespace bp = boost::python;
47 bp::object CoreModule(bp::handle<>(bp::borrowed(PyImport_AddModule(
"FMT.Core"))));
48 bp::scope().attr(
"Core") = CoreModule;
49 bp::scope Core_scope = CoreModule;
50 bp::scope().attr(
"__doc__") =
".. module:: Core\n"
52 " :platform: Unix, Windows\n"
53 " :synopsis: Core class for generating Forest Models.\n"
56 bp::enum_<Core::FMTsection>(
"FMTsection")
70 bp::enum_<Core::FMToutputlevel>(
"FMToutputlevel")
76 bp::enum_<Core::FMTconstrainttype>(
"FMTconstrainttype")
90 bp::class_<Core::FMTObject>(
"FMTobject",
"@DocString(FMTObject)")
92 "@DocString(FMTObject::setdefaultexceptionhandler)")
94 "@DocString(FMTObject::setquietexceptionhandler)")
96 "@DocString(FMTObject::setdebugexceptionhandler)")
98 "@DocString(FMTObject::setfreeexceptionhandler)")
100 "@DocString(FMTObject::enablenestedexceptions)")
102 "@DocString(FMTObject::disablenestedexceptions)")
104 "@DocString(FMTObject::setdefaultlogger)")
106 "@DocString(FMTObject::setdebuglogger)")
108 "@DocString(FMTObject::setquietlogger)")
110 "@DocString(FMTObject::settasklogger")
112 "@DocString(FMTObject::redirectlogtofile)")
114 "@DocString(FMTObject::seterrorstowarnings)");
116 bp::class_<Core::FMTMaskFilter>(
"FMTmaskfilter",
"@DocString(FMTMaskFilter)");
118 definePyList<Core::FMTDevelopmentPath>();
119 definePySet<Core::FMTSerie>();
120 definePyList<Core::FMTSerie>();
121 definePyList<Core::FMTMaskFilter>();
122 definePyList<Core::FMTMask>();
123 definePyList<Core::FMTDevelopment>();
124 definePyList<Core::FMTFuturDevelopment>();
125 definePyList<Core::FMTActualDevelopment>();
126 definePyDict<std::string, std::vector<Core::FMTDevelopment>>();
128 definePyList<Core::FMTTheme>();
129 definePyList<Core::FMTAction>();
130 definePyList<Core::FMTTransition>();
131 definePyList<Core::FMTOutput>();
132 definePyList<Core::FMTSchedule>();
133 definePyList<std::vector<Core::FMTSchedule>>();
134 definePyList<Core::FMTYieldHandler>();
135 definePyList<Core::FMTOutputSource>();
136 definePyList<Core::FMTOperator>();
138 definePyDict<Core::FMTDevelopment, std::vector<double>>();
139 definePyDict<Core::FMTAction,std::map<Core::FMTDevelopment, std::vector<double>>>();
140 py_pair<Core::FMTAction, std::map<Core::FMTDevelopment, std::vector<double>>>();
141 py_pair<Core::FMTAction const, std::map<Core::FMTDevelopment, std::vector<double>>>();
143 define_FMTlist<Core::FMTSpec>();
144 definePyList<std::vector<std::string>>();
148 bp::class_<Core::FMTMask>(
"FMTmask",
"@DocString(FMTMask)")
149 .def(bp::init<Core::FMTMask>())
150 .def_pickle(FMT_pickle_suite<Core::FMTMask>())
151 .def(bp::init<
const std::vector<std::string>&,
const std::vector<Core::FMTTheme>&>())
152 .def(bp::init<
const std::string&,
const std::vector<Core::FMTTheme>&>())
153 .def(
"__len__", &Core::FMTMask::operator
bool,
154 "@DocString(FMTMask::operator bool)")
155 .def(
"__str__",&Core::FMTMask::operator std::string,
156 "@DocString(FMTMask::operator std::string)")
157 .def(
"__eq__", &Core::FMTMask::operator ==,
158 "@DocString(FMTMask::operator==)")
159 .def(
"__ne__", &Core::FMTMask::operator !=,
160 "@DocString(FMTMask::operator!=)")
161 .def(
"__lt__", &Core::FMTMask::operator <,
162 "@DocString(FMTMask::operator<)")
163 .def(
"__hash__",&boost::pyHash<Core::FMTMask>)
165 "@DocString(FMTMask::decompose)")
166 .def(
"issubsetof",issubsetof,
167 "@DocString(FMTMask::issubsetof)")
169 "@DocString(FMTMask::preSolve)")
171 "@DocString(FMTMask::postsolve)");
173 bp::class_<Core::FMTDevelopmentPath>(
"FMTdevelopmentpath",
"@DocString(FMTDevelopmentPath)")
174 .def(bp::init<Core::FMTDevelopmentPath>())
176 bp::return_value_policy<bp::return_by_value>(),
177 "@DocString(FMTDevelopmentPath::getDevelopment)")
179 bp::return_value_policy<bp::return_by_value>(),
180 "@DocString(FMTDevelopmentPath::getProportion)");
182 bp::class_<Core::FMTSerie>(
"FMTSerie",
"@DocString(FMTSerie)")
183 .def(bp::init<Core::FMTSerie>())
185 bp::return_value_policy<bp::return_by_value>(),
186 "@DocString(FMTSerie::getLength)")
188 bp::return_value_policy<bp::return_by_value>(),
189 "@DocString(FMTSerie::getSerie)");
193 bp::class_<Core::FMTDevelopment>(
"FMTdevelopment",
"@DocString(FMTDevelopment)")
194 .def_pickle(FMT_pickle_suite<Core::FMTDevelopment>())
195 .def(bp::init<Core::FMTDevelopment>())
197 "@DocString(FMTDevelopment::getage)")
199 "@DocString(FMTDevelopment::getlock)")
201 "@DocString(FMTDevelopment::getperiod)")
203 "@DocString(FMTDevelopment::getmask)")
205 "@DocString(FMTDevelopment::setage)")
207 "@DocString(FMTDevelopment::setlock)")
209 "@DocString(FMTDevelopment::setperiod)")
211 "@DocString(FMTDevelopment::setmask)")
212 .def(
"__eq__", &Core::FMTDevelopment::operator ==,
213 "@DocString(FMTDevelopment::operator==)")
214 .def(
"__ne__", &Core::FMTDevelopment::operator !=,
215 "@DocString(FMTDevelopment::operator!=)")
216 .def(
"__lt__",&Core::FMTDevelopment::operator <,
217 "@DocString(FMTDevelopment::operator<")
219 "@DocString(FMTDevelopment::grow)")
220 .def(
"operable",&
Core::FMTDevelopment::operable,operable_overloads(bp::args(
"action,yields,yieldrequest"),
"@DocString(FMTDevelopment::operable)"))
222 "@DocString(FMTDevelopment::operate)")
224 .def(
"__str__", &Core::FMTDevelopment::operator std::string,
225 "@DocString(FMTDevelopment::operator std::string)")
226 .setattr(
"__hash__",&boost::pyHash<Core::FMTDevelopment>);
230 bp::class_<Core::FMTAgeBounds>(
"FMTagebounds",
"@DocString(FMTAgeBounds)")
231 .def(bp::init<Core::FMTAgeBounds>())
232 .def(bp::init<Core::FMTsection, int, int>());
234 bp::class_<Core::FMTPerBounds>(
"FMTperbounds",
"@DocString(FMTPerBounds)")
235 .def(bp::init<Core::FMTPerBounds>())
236 .def(bp::init<Core::FMTsection, int, int>());
238 bp::class_<Core::FMTYldBounds>(
"FMTyldbounds",
"@DocString(FMTYldBounds)")
239 .def(bp::init<Core::FMTYldBounds>())
240 .def(bp::init<Core::FMTsection, std::string, double, double>());
242 bp::class_<Core::FMTLockBounds>(
"FMTlockbounds",
"@DocString(FMTLockBounds)")
243 .def(bp::init<Core::FMTLockBounds>())
244 .def(bp::init<Core::FMTsection, int, int>());
246 bp::class_<Core::FMTSpec>(
"FMTspec",
"@DocString(FMTSpec)")
247 .def(bp::init<Core::FMTSpec>())
248 .def(
"getperiodlowerbound", &Core::FMTSpec::getPeriodLowerBound,
249 "@DocString(FMTSpec::getperiodlowerbound)")
250 .def(
"getperiodupperbound", &Core::FMTSpec::getPeriodUpperBound,
251 "@DocString(FMTSpec::getperiodupperbound)")
252 .def(
"setbounds", &Core::FMTSpec::setBounds,
"@DocString(Core::FMTSpec::setbounds())")
253 .def<bool(Core::FMTSpec::*)(
const Core::FMTAgeBounds&)>(
"addbounds", &Core::FMTSpec::addBounds,
254 "@DocString(Core::FMTSpec::addbounds(const FMTAgeBounds&))")
255 .def<bool(Core::FMTSpec::*)(
const Core::FMTYldBounds&)>(
"addbounds",&Core::FMTSpec::addBounds,
256 "@DocString(Core::FMTSpec::addbounds(const FMTYldBounds&))")
257 .def<bool(Core::FMTSpec::*)(
const Core::FMTLockBounds&)>(
"addbounds",&Core::FMTSpec::addBounds,
258 "@DocString(Core::FMTSpec::addbounds(const FMTLockBounds&))");
260 bp::class_<Core::FMTTransitionMask>(
"FMTtransitionmask",
"@DocString(FMTTransitionMask)")
261 .def(bp::init<
const std::string&,
const std::vector<Core::FMTTheme>&,
const double&>())
262 .def(bp::init<Core::FMTTransitionMask>());
264 bp::class_<Core::FMTFork, bp::bases<Core::FMTList<Core::FMTSpec>>>(
"FMTfork",
"@DocString(FMTFork)")
265 .def(bp::init<Core::FMTFork>())
267 "@DocString(FMTFork::add)");
272 bp::class_<Core::FMTActualDevelopment, bp::bases<Core::FMTDevelopment>>(
"FMTactualdevelopment",
"@DocString(FMTActualDevelopment)")
273 .def(bp::init<const Core::FMTMask&, const int&, const int&, const double&>())
274 .def(bp::init<Core::FMTActualDevelopment>())
276 "@DocString(FMTActualDevelopment::getarea)")
278 "@DocString(FMTActualDevelopment::setarea)")
279 .def(
"__eq__", &Core::FMTActualDevelopment::operator ==,
280 "@DocString(FMTActualDevelopment::operator==)")
281 .def(
"__ne__", &Core::FMTActualDevelopment::operator !=,
282 "@DocString(FMTActualDevelopment::operator!=)")
283 .def(
"__lt__", &Core::FMTActualDevelopment::operator <,
284 "@DocString(FMTActualDevelopment::operator<)");
286 bp::class_<Core::FMTFuturDevelopment, bp::bases<Core::FMTDevelopment>>(
"FMTfuturdevelopment",
"@DocString(FMTFuturDevelopment)");
291 define_FMTlist<int>();
294 define_FMTlist<Core::FMTFork>();
298 bp::class_<Core::FMTAction, bp::bases<Core::FMTList<Core::FMTSpec>>>(
"FMTaction",
"@DocString(FMTAction)")
299 .def_pickle(FMT_pickle_suite<Core::FMTAction>())
300 .def(bp::init<Core::FMTAction>())
301 .def(bp::init<const std::string&,const bool&,const bool&>())
302 .def(
"__eq__",&Core::FMTAction::operator ==,
303 "@DocString(FMTAction::operator==)")
304 .def(
"__ne__",&Core::FMTAction::operator !=,
305 "@DocString(FMTAction::operator!=)")
306 .def(
"__lt__",&Core::FMTAction::operator <,
307 "@DocString(FMTAction::operator<)")
308 .def(
"__str__", &Core::FMTAction::operator std::string,
309 "@DocString(FMTAction::operator std::string)")
311 "@DocString(FMTAction::getname)")
313 "@DocString(FMTAction::dorespectlock)")
315 "@DocString(FMTAction::useyield)")
317 "@DocString(FMTAction::push_aggregate)")
319 "@DocString(FMTAction::getaggregates)")
321 "@DocString(FMTAction::update)")
323 "@DocString(FMTAction::isresetage)")
324 .setattr(
"__hash__",&boost::pyHash<Core::FMTAction>);
326 bp::class_<Core::FMTLifespans, bp::bases<Core::FMTList<int>>>(
"FMTlifespans",
"@DocString(FMTLifespans)")
327 .def(bp::init<Core::FMTLifespans>());
330 bp::enum_<Core::FMTyldtype>(
"FMTyldtype")
336 definePyDict<std::string, std::map<std::string,std::vector<double>>>();
338 definePyDict<std::string, std::vector<double>>();
340 bp::class_<Core::FMTYieldHandler>(
"FMTyieldhandler",
"@DocString(FMTYieldHandler)")
341 .def(bp::init<Core::FMTYieldHandler>())
343 "@DocString(FMTYieldHandler::push_data(const std::string&,const double&))")
345 "@DocString(FMTYieldHandler::push_base)");
348 bp::class_<Core::FMTAgeYieldHandler,bp::bases<Core::FMTYieldHandler>>(
"FMTageyieldhandler",
"@DocString(FMTAgeYieldHandler)")
349 .def(bp::init<const Core::FMTMask&>())
350 .def_pickle(FMT_pickle_suite<Core::FMTAgeYieldHandler>())
351 .def(
"__str__", &Core::FMTAgeYieldHandler::operator std::string,
352 "@DocString(FMTAgeYieldHandler::operator std::string)")
354 "@DocString(FMTAgeYieldHandler::setyieldvalues)");
356 definePyList<Core::FMTAgeYieldHandler>();
358 bp::class_<Core::FMTTimeYieldHandler,bp::bases<Core::FMTYieldHandler>>(
"FMTtimeyieldhandler",
"@DocString(FMTTimeYieldHandler)")
359 .def(bp::init<const Core::FMTMask&>())
360 .def_pickle(FMT_pickle_suite<Core::FMTTimeYieldHandler>())
361 .def(
"__str__", &Core::FMTTimeYieldHandler::operator std::string,
362 "@DocString(FMTTimeYieldHandler::operator std::string)")
364 "@DocString(FMTTimeYieldHandler::setyieldvalues)");
366 definePyList<Core::FMTTimeYieldHandler>();
369 .def(bp::init<Core::FMTYields>())
370 .def_pickle(FMT_pickle_suite<Core::FMTYields>())
372 "@DocString(FMTYields::getallyields)")
374 "@DocString(FMTYields::get)")
376 "@DocString(FMTYields::push_backagehandler)")
378 "@DocString(FMTYields::push_backtimehandler)")
380 "@DocString(FMTYields::getallyieldnames)")
382 "@DocString(FMTYields::getfromfactor)")
384 "@DocString(FMTYields::update)");
388 bp::class_<Core::FMTTransition, bp::bases<Core::FMTList<Core::FMTFork>>>(
"FMTtransition",
"@DocString(FMTTransition)")
389 .def_pickle(FMT_pickle_suite<Core::FMTTransition>())
390 .def(bp::init<Core::FMTTransition>())
391 .def(bp::init<const std::string&>())
393 "@DocString(FMTTransition::single)")
395 "@DocString(FMTTransition::main_target)")
397 "@DocString(FMTTransition::age_after)")
399 "@DocString(FMTTransition::attribute_targets)")
400 .def(
"__str__", &Core::FMTTransition::operator std::string,
401 "@DocString(FMTTransition::operator std::string)")
402 .def(
"__eq__",&Core::FMTTransition::operator ==,
403 "@DocString(FMTTransition::operator==)")
404 .def(
"__ne__",&Core::FMTTransition::operator !=,
405 "@DocString(FMTTransition::operator!=)")
406 .def(
"__lt__",&Core::FMTTransition::operator <,
407 "@DocString(FMTTransition::operator<)")
409 "@DocString(FMTTransition::getname)");
412 bp::enum_<Core::FMTotar>(
"FMTotar")
420 bp::class_<Core::FMTOutputSource>(
"FMToutputsource",
"@DocString(FMTOutputSource)")
423 const std::string&,
const int&,
const int&>())
424 .def(bp::init<Core::FMTOutputSource>());
426 bp::class_<Core::FMTOperator>(
"FMToperator",
"@DocString(FMTOperator)")
427 .def(bp::init<Core::FMTOperator>());
430 bp::class_<Core::FMTOutputNode>(
"FMToutputnode",
"@DocString(FMTOutputNode)")
431 .def(bp::init<const Core::FMTMask&,const std::string&>())
432 .def(
"__str__", &Core::FMTOutputNode::operator std::string,
433 "@DocString(FMTOutputNode::operator std::string)");
435 define_FMTlist<Core::FMTOutputNode>();
437 bp::class_<Core::FMTOutput>(
"FMToutput",
"@DocString(FMTOutput)")
438 .def(bp::init<Core::FMTOutput>())
439 .def(bp::init<
const std::string&,
const std::string&,
const std::string&,
440 const std::vector<Core::FMTOutputSource>&,
441 const std::vector<Core::FMTOperator>&>())
442 .def_pickle(FMT_pickle_suite<Core::FMTTransition>())
444 "@DocString(FMTOutput::getname)")
446 "@DocString(FMTOutput::getdescription)")
448 "@DocString(FMTOutput::empty)")
450 "@DocString(FMTOutput::containslevel)")
452 "@DocString(FMTOutput::islevel)")
454 "@DocString(FMTOutput::isonlylevel)")
455 .def(
"getnodes",&
Core::FMTOutput::getNodes, getnodes_overloads(bp::args(
"multiplier"),
"@DocString(FMTOutput::getnodes)"))
456 .def(
"__str__", &Core::FMTOutput::operator std::string,
457 "@DocString(FMTOutput::operator std::string)")
458 .def(
"__eq__",&Core::FMTOutput::operator ==,
459 "@DocString(FMTOutput::operator==)")
460 .def(
"__ne__",&Core::FMTOutput::operator !=,
461 "@DocString(FMTOutput::operator!=)");
463 bp::class_<Core::FMTTheme>(
"FMTtheme",
"@DocString(FMTTheme)")
464 .def_pickle(FMT_pickle_suite<Core::FMTTheme>())
465 .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&>())
466 .def(bp::init<Core::FMTTheme>())
467 .def(
"__str__", &Core::FMTTheme::operator std::string,
468 "@DocString(FMTTheme::operator std::string)")
469 .def(
"__eq__", &Core::FMTTheme::operator ==,
470 "@DocString(FMTTheme::operator==)")
472 "@DocString(Core::FMTTheme::getaggregates)")
474 bp::return_value_policy<bp::return_by_value>(),
475 "@DocString(Core::FMTTheme::getaggregates)")
477 bp::return_value_policy<bp::return_by_value>(),
478 "@DocString(Core::FMTTheme::getid)")
480 bp::return_value_policy<bp::return_by_value>(),
481 "@DocString(Core::FMTTheme::getattributenames)")
482 .def(
"getattributes", &
Core::FMTTheme::getAttributes, getattributes_overloads(bp::args(
"value",
"aggregate_source"),
"@DocString(FMTTheme::getattributes)"))
484 "@DocString(FMTTheme::getname)");
486 bp::class_<Core::FMTConstants>(
"FMTconstants",
"@DocString(FMTConstants)");
488 bp::class_<Core::FMTSchedule>(
"FMTschedule",
"@DocString(FMTSchedule)")
489 .def_pickle(FMT_pickle_suite<Core::FMTSchedule>())
490 .def(bp::init<Core::FMTSchedule>())
492 .def(
"__str__", &Core::FMTSchedule::operator std::string,
493 "@DocString(FMTSchedule::operator std::string)")
494 .def(
"__add__", &Core::FMTSchedule::operator +,
495 "@DocString(FMTSchedule::operator+)")
497 "@DocString(FMTSchedule::actionarea)")
499 "@DocString(FMTSchedule::getperiod)")
501 "@DocString(FMTSchedule::setperiod)")
502 .def(
"__eq__", &Core::FMTSchedule::operator ==,
503 "@DocString(FMTSchedule::operator==)")
504 .def(
"__ne__", &Core::FMTSchedule::operator !=,
505 "@DocString(FMTSchedule::operator!=)")
506 .def(
"__iter__", boost::python::iterator<Core::FMTSchedule>())
508 "@DocString(FMTSchedule::empty)");
510 bp::class_<Core::FMTGCBMTransition>(
"FMTGCBMtransition",
"@DocString(FMTGCBMTransition)")
512 "@DocString(FMTGCBMTransition::name)")
514 "@DocString(FMTGCBMTransition::ageafter)")
518 bp::class_<Core::FMTConstraint, bp::bases<Core::FMTOutput,Core::FMTSpec>>(
"FMTconstraint",
"@DocString(FMTConstraint)")
519 .def(bp::init<Core::FMTConstraint>())
520 .def(bp::init<Core::FMTconstrainttype,const Core::FMTOutput&>())
521 .def(
"__str__", &Core::FMTConstraint::operator std::string,
522 "@DocString(FMTConstraint::operator std::string)")
523 .def(
"__eq__", &Core::FMTConstraint::operator ==,
524 "@DocString(FMTConstraint::operator==)")
526 "@DocString(FMTConstraint::isspatial)")
528 "@DocString(FMTConstraint::setlength)")
530 "@DocString(FMTConstraint::issetfrom)")
532 "@DocString(FMTConstraint::setfrom)")
534 "@DocString(FMTConstraint::sense)")
536 "@DocString(FMTConstraint::setrhs)")
538 "@DocString(FMTConstraint::getconstrainttype)")
540 "@DocString(FMTConstraint::getfromreplicate)")
542 "@DocString(FMTConstraint::getscheduleweight)")
544 "@DocString(FMTConstraint::setpenalties)");
546 define_FMTlist<Core::FMTConstraint>();
547 define_FMTlist<Core::FMTGCBMTransition>();
549 bp::class_<Core::FMTYieldRequest>(
"FMTyieldrequest",
"@DocString(FMTYieldRequest)");
551 define_FMTlist<Core::FMTYieldRequest>();
List of specifications dictating the operability of a subset of developments to this action.
Definition: FMTAction.h:43
bool isResetAge() const
Return true if the development age is reset to 0 when operated by this action.
Definition: FMTAction.h:198
bool useYield(const std::string &yldname) const
Return true if the yield is used by the action to set operability.
void pushAggregate(const std::string &aggregate)
Push an aggregate to the aggregates of the action.
std::vector< std::string > getAggregates() const
Return the names of the aggregates the action is part of.
bool doRespectLock() const
Return true if the action needs to respect the lock state of the development.
Definition: FMTAction.h:189
void update() override
Update the action by setting the bounds and shrinking the list, for optimization.
std::string getName() const
Get the name of the action.
Definition: FMTAction.h:180
void setArea(const double &newarea)
Set the area of the actual development.
double getArea() const override
Return the area of the actual development.
virtual void setYieldValues(const std::string &yldname, const std::vector< int > &baseages, const std::vector< double > &values)
Set the values for a given yield name.
FMTconstrainttype getConstraintType() const
Return the type of the constraint.
double sense() const
Return the sense of the objective, 1 for minimisation and -1 for maximisation.
double getScheduleWeight() const
Return the global schedule weight of the objective for a local model.
Core::FMTConstraint getFromReplicate(const size_t &replicate, const int &period) const
Return a new constraint with the replicate value, if the constraint is built with a replicate table....
void setPenalties(const std::string &penaltyoperator, const std::vector< std::string > &variables)
Set the penalties if the constraint is an objective.
bool isSpatial() const
Return true if the constraint is a spatial constraint.
bool isSetFrom(const std::string &modeltype) const
Return true if the constraint needs to be set from a specific model.
void setRhs(double lower, double upper)
Set the RHS of the constraint with a lower and upper bound.
Core::FMTConstraint setFrom(const std::string &modeltype, const double &value) const
Return a new constraint set with the value of the given model type.
void setLength(int firstPeriod=1, int lastPeriod=std::numeric_limits< int >::max())
Set the length of the constraint.
const FMTDevelopment & getDevelopment() const
Get the new development.
double getProportion() const
Get the proportion of area going to this dev.
Base class of FMTActualDevelopment and FMTFuturDevelopment representing a forest stand.
Definition: FMTDevelopment.h:44
void setMask(const Core::FMTMask &p_mask)
Set the mask of the development.
void setLock(const int &llock)
Set the lock of the development.
FMTFuturDevelopment grow() const
Return a grown copy of this development, increasing the age and period and decreasing the lock level ...
int getLock() const
Get the lock of the development.
Definition: FMTDevelopment.h:82
void setPeriod(const int &lperiod)
Set the period of the development.
void setAge(const int &lage)
Set the age of the development.
int getPeriod() const
Get the period of the development.
Definition: FMTDevelopment.h:91
bool operable(const FMTAction &action, const Core::FMTYields &ylds, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
Check if this development is operable to an action based on multiple yields.
Core::FMTMask getMaskCopy() const
Get a copy of the mask of the development.
Definition: FMTDevelopment.h:109
std::vector< FMTDevelopmentPath > operate(const FMTAction &action, const FMTTransition &Transition, const Core::FMTYields &ylds, const std::vector< FMTTheme > &themes) const
Return the development paths resulting from operating this development with an action and a transitio...
int getAge() const
Get the age of the development.
Definition: FMTDevelopment.h:64
FMTYieldRequest getYieldRequest(const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
Get a yield request for this development, without reference to a graph unless one is provided.
void add(const FMTTransitionMask &transition)
Add a transition mask to the fork.
std::string name
The name of the GCBM transition.
Definition: FMTGCBMTransition.h:52
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.h:49
int ageafter
Describe the age set on the strata after the disturbance.
Definition: FMTGCBMTransition.h:46
Core class holding, as a boost dynamic bitset, which theme attributes are part of a mask.
Definition: FMTMask.h:96
FMTMask preSolve(const FMTMaskFilter &filter, const std::vector< FMTTheme > &presolvedthemes) const
Return a presolved mask with potentially less data using a filter and a subset of the original themes...
FMTMask postSolve(const FMTMaskFilter &filter, const std::vector< FMTTheme > &basethemes) const
Return a postsolved mask using a filter and the original themes.
bool isSubsetOf(const FMTMask &p_mask, const std::vector< size_t > &p_subset) const
Check if this mask is a subset of another mask by looking at a block subset.
std::vector< FMTMask > decompose(const FMTTheme &theme) const
Disaggregate the attribute of a theme from the mask into a vector of masks, one per possible attribut...
void setQuietExceptionHandler()
Create and set a quiet exception handler to the FMTObject.
virtual void setDebugLogger()
Create and set a debug logger to the FMTObject.
void setFreeExceptionHandler()
Create and set a free exception handler to the FMTObject.
void enableNestedExceptions()
Enable the nested exception throw of the exception handler.
virtual void setDefaultLogger()
Create and set a default logger to the FMTObject.
void redirectLogToFile(const std::string &location)
Redirect the log to a specific file, appending to it.
virtual void setTaskLogger()
Create and set a task logger to the FMTObject.
void setDefaultExceptionHandler()
Create and set a default exception handler to the FMTObject.
void setErrorsToWarnings(const std::vector< Exception::FMTexc > &errors)
Set a list of errors to be cast to warnings on the exception handler.
virtual void setQuietLogger()
Create and set a quiet logger to the FMTObject.
void disableNestedExceptions()
Disable the nested exception throw of the exception handler.
void setDebugExceptionHandler()
Create and set a debug exception handler to the FMTObject.
bool containsLevel() const
Return true if the output contains any level.
std::string getDescription() const
Return the description of the output.
Definition: FMTOutput.h:143
std::string getName() const
Return the name of the output.
Definition: FMTOutput.h:134
std::vector< FMTOutputNode > getNodes(std::vector< std::string > &equation, double multiplier=1, bool orderbyoutputid=false, int period=1) const
Return the output nodes generated from the output sources and operators, optionally multiplied by a f...
bool isLevel() const
Return true if one output source of the output is a level.
bool isOnlyLevel() const
Return true if all output sources of the output are levels.
bool empty() const
Return true if the output has no output source.
double actionArea(const FMTAction &action) const
Return the total harvested area of an action in the schedule.
void setPeriod(const int &newPeriod)
Set the period of the schedule and of its developments.
bool empty() const
Return true if the schedule is empty.
int getPeriod() const
Return the period of the schedule.
Definition: FMTSchedule.h:122
const std::string getSerie() const
Return the string of the serie.
int getLength() const
Return the length of the serie.
const std::vector< std::string > & getAttributeNames() const
Return the names of the attributes.
Definition: FMTTheme.h:269
const size_t & getStart() const
Return the bit location of the mask at which the theme starts.
Definition: FMTTheme.h:216
std::vector< std::string > getAttributes(const std::string &p_value, bool p_aggregate_source=false) const
Get the attributes of an aggregate for the theme.
std::vector< std::string > getAggregates() const
Return the aggregates of the theme.
std::string getName() const
Return the name of the theme.
Definition: FMTTheme.h:234
const size_t & getId() const
Return the id of the theme.
Definition: FMTTheme.h:225
virtual void setYieldValues(const std::string &yldname, const int &startingperiod, const std::vector< double > &values)
Set the values for a given yield name.
unsigned int ageAfter(const std::vector< FMTDevelopment > &devs, const FMTAction &action, const FMTYields &ylds, const std::vector< FMTTheme > &themes) const
Return the average age after disturbance across the developments, for GCBM.
std::string getName() const
Get the name of the transition.
Definition: FMTTransition.h:90
FMTTransition single() const
Return a transition that leads to a single development path, selecting the one with the highest area ...
FMTMask mainTarget(const std::vector< FMTDevelopment > &devs, const FMTYields &ylds) const
Return the most targeted mask across the developments based on the yields, for GCBM.
std::map< std::string, std::vector< FMTDevelopment > > attributeTargets(const std::vector< FMTDevelopment > &devs, const FMTYields &ylds, const std::vector< FMTTheme > &themes) const
Classify the developments by mask key based on the yields.
Base class for yield handlers, holding a mask and the base ages of the yields.
Definition: FMTYieldHandler.h:80
bool pushBase(const int &base)
Push a base age to the handler.
virtual bool pushData(const std::string &yld, const double &value)
Push a value for a yield.
FMTList containing multiple yield handlers as seen in the yield section, holding the information rela...
Definition: FMTYields.h:44
void update() override
Update the yield names and null yield names caching, as required by FMTList.
void pushBackTimeHandler(const FMTMask &mask, const FMTTimeYieldHandler &value)
Push back a time yield handler, for R.
void pushBackAgeHandler(const FMTMask &mask, const FMTAgeYieldHandler &value)
Push back an age yield handler, for R.
FMTYields getFromFactor(const double &factor, std::vector< std::string >yieldnames=std::vector< std::string >()) const
Multiply the yields section by a factor and return a new yields section.
double get(const FMTYieldRequest &request, const std::string &yld) const
Get the yield value for a development from a yield request.
std::map< std::string, std::map< std::string, std::vector< double > > > getAllYields(const FMTTheme &target, FMTyldtype type) const
Return a map of all the yield values for a given yield handler type, used for generating a text file ...
std::vector< std::string > getAllYieldNames() const
Return all the yield names from the list.
@ Control
Definition: FMTutility.h:33
@ Constants
Definition: FMTutility.h:41
@ Area
Definition: FMTutility.h:35
@ Outputs
Definition: FMTutility.h:39
@ Optimize
Definition: FMTutility.h:40
@ Landscape
Definition: FMTutility.h:34
@ Schedule
Definition: FMTutility.h:42
@ Action
Definition: FMTutility.h:36
@ Transition
Definition: FMTutility.h:37
@ Empty
Definition: FMTutility.h:44
@ Yield
Definition: FMTutility.h:38
@ FMTsequence
Definition: FMTConstraint.h:38
@ FMTspatialadjacency
Definition: FMTConstraint.h:41
@ FMTstandard
Definition: FMTConstraint.h:39
@ FMTMINMAXobjective
Definition: FMTConstraint.h:35
@ FMTnondeclining
Definition: FMTConstraint.h:37
@ FMTMAXMINobjective
Definition: FMTConstraint.h:34
@ FMTspatialsize
Regular constraint m_type like output = 1...
Definition: FMTConstraint.h:40
@ FMTMAXobjective
Definition: FMTConstraint.h:32
@ FMTMINobjective
Definition: FMTConstraint.h:33
@ FMTevenflow
Definition: FMTConstraint.h:36
@ FMTspatialgreenup
Definition: FMTConstraint.h:42
@ FMTcomplexyld
Definition: FMTutility.h:65
@ FMTageyld
Definition: FMTutility.h:63
@ FMTtimeyld
Definition: FMTutility.h:64
@ developpement
Definition: FMTutility.h:25
@ totalonly
Definition: FMTutility.h:24
@ standard
Definition: FMTutility.h:23
FMTotar
Enumerator describing the target of an output (inventory, actual, value, time yield,...
Definition: FMTutility.h:101
@ actual
Definition: FMTutility.h:103
@ val
Definition: FMTutility.h:104
@ level
Definition: FMTutility.h:106
@ timeyld
Definition: FMTutility.h:105
@ inventory
Definition: FMTutility.h:102
Definition: PYdefinitions.h:14
void exportCore()
Definition: PYexportCore.h:44