FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
RexportCore.h
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 REXPORTCORE_H_INCLUDED
9#define REXPORTCORE_H_INCLUDED
10
11#include "FMTGCBMTransition.h"
12#include "FMTObject.h"
13#include "FMTMask.h"
14#include "FMTTheme.h"
15#include "FMTBounds.hpp"
16#include "FMTDevelopment.h"
18#include "FMTFuturDevelopment.h"
19#include "FMTAction.h"
20#include "FMTTransition.h"
21#include "FMTOutput.h"
22#include "FMTConstraint.h"
23#include "FMTSchedule.h"
24#include "FMTYields.h"
25#include "FMTConstants.h"
26#include "Rdefinitions.h"
27#include "FMTYieldHandler.h"
28#include "FMTTimeYieldHandler.h"
29#include "FMTAgeYieldHandler.h"
30#include "FMTDevelopmentPath.h"
31#include "FMTData.h"
32#include "FMTMaskFilter.h"
33#include "FMTTransitionMask.h"
34
35#include <vector>
36#include <Rcpp.h>
37
49RCPP_EXPOSED_WRAP(Core::FMTSpec);
50RCPP_EXPOSED_AS(Core::FMTSpec);
51RCPP_DEFINEPAIR(Core::FMTMask, Core::FMTSpec);//pair for FMTList
52RCPP_DEFINEVECTOR(Core::FMTSpec);//For vector
53RCPP_EXPOSED_WRAP(Core::FMTPerBounds);
54RCPP_EXPOSED_AS(Core::FMTPerBounds);
55RCPP_DEFINEPAIR(Core::FMTMask, Core::FMTPerBounds);//pair for FMTList
56RCPP_DEFINEVECTOR(Core::FMTPerBounds);//For vector
57RCPP_EXPOSED_WRAP(Core::FMTAgeBounds);
58RCPP_EXPOSED_AS(Core::FMTAgeBounds);
59RCPP_DEFINEPAIR(Core::FMTMask, Core::FMTAgeBounds);//pair for FMTList
60RCPP_DEFINEVECTOR(Core::FMTAgeBounds);//For vector
61RCPP_EXPOSED_WRAP(Core::FMTYldBounds);
62RCPP_EXPOSED_AS(Core::FMTYldBounds);
63RCPP_DEFINEPAIR(Core::FMTMask, Core::FMTYldBounds);//pair for FMTList
64RCPP_DEFINEVECTOR(Core::FMTYldBounds);//For vector
65RCPP_EXPOSED_WRAP(Core::FMTLockBounds);
66RCPP_EXPOSED_AS(Core::FMTLockBounds);
67RCPP_DEFINEPAIR(Core::FMTMask, Core::FMTLockBounds);//pair for FMTList
68RCPP_DEFINEVECTOR(Core::FMTLockBounds);//For vector
81
82
83
98RCPP_DEFINEPAIR(Core::FMTMask, int);//pair for FMTList
135RCPP_DEFINELIST(std::vector<Core::FMTSchedule>)//For vector of vector
136RCPP_EXPOSED_WRAP(Core::FMTGCBMTransition);
137RCPP_EXPOSED_AS(Core::FMTGCBMTransition);
138RCPP_DEFINEVECTOR(Core::FMTGCBMTransition);//For vector
139RCPP_EXPOSED_WRAP(Core::FMTConstraint);
140RCPP_EXPOSED_AS(Core::FMTConstraint);
141RCPP_DEFINEVECTOR(Core::FMTConstraint);//For vector
142RCPP_DEFINEMAP(Core::FMTDevelopment, std::vector<double>);//For dev of doubles
143RCPP_DEFINEMAP(std::string, std::vector<double>);//For string of double map
144RCPP_DEFINEMAP(std::string, std::vector<Core::FMTDevelopment>);//For string of vector of developments
145RCPP_DEFINEMAP(Core::FMTAction , std::map<Core::FMTDevelopment RCPP_COMMA std::vector<double>>);//For action of ...
146RCPP_DEFINEMAP(std::string , std::map<std::string RCPP_COMMA std::vector<double>>);//For string of ...
147RCPP_DEFINEMAP(std::string, std::string);//map of string definition
148RCPP_EXPOSED_ENUM_NODECL(Core::FMTconstrainttype);
150//RCPP_EXPOSED_ENUM_NODECL(Core::FMTsection);
151
152namespace R
153{
154
155void exportCore()
156 {
157 define_FMTlist<Core::FMTSpec>("FMTspeclist");
158 define_FMTlist<int>("FMTintlist");
159 //define_FMTlist<Core::FMTYieldHandler>("FMTyieldhandlerlist");
160 define_FMTlist<Core::FMTFork>("FMTforklist");
161
162 Rcpp::class_<Core::FMTObject>("FMTobject", "@DocString(FMTObject)")
163 .constructor("@DocString(FMTObject())")
164 .method("setdefaultexceptionhandler", &Core::FMTObject::setDefaultExceptionHandler,
165 "@DocString(FMTObject::setdefaultexceptionhandler)")
166 .method("setquietexceptionhandler", &Core::FMTObject::setQuietExceptionHandler,
167 "@DocString(FMTObject::setquietexceptionhandler)")
168 .method("setdebugexceptionhandler", &Core::FMTObject::setDebugExceptionHandler,
169 "@DocString(FMTObject::setdebugexceptionhandler)")
170 .method("setfreeexceptionhandler", &Core::FMTObject::setFreeExceptionHandler,
171 "@DocString(FMTObject::setfreeexceptionhandler)")
172 .method("disablenestedexceptions", &Core::FMTObject::disableNestedExceptions,
173 "@DocString(FMTObject::disablenestedexceptions)")
174 .method("enablenestedexceptions", &Core::FMTObject::enableNestedExceptions,
175 "@DocString(FMTObject::enablenestedexceptions)")
176 .method("setquietlogger", &Core::FMTObject::setQuietLogger,
177 "@DocString(FMTObject::setquietlogger)")
178 .method("settasklogger", &Core::FMTObject::setTaskLogger,
179 "@DocString(FMTObject::settasklogger)")
180 .method("setdefaultlogger", &Core::FMTObject::setDefaultLogger,
181 "@DocString(FMTObject::setdefaultlogger)")
182 .method("setdebuglogger", &Core::FMTObject::setDebugLogger,
183 "@DocString(FMTObject::setdebuglogger)")
184 .method("redirectlogtofile", &Core::FMTObject::redirectLogToFile,
185 "@DocString(FMTObject::redirectlogtofile)")
186 .method("seterrorstowarnings", &Core::FMTObject::setErrorsToWarnings,
187 "@DocString(FMTObject::seterrorstowarnings)")
188 .method("setmaxwarningsbeforesilenced", &Core::FMTObject::setMaxWarningsBeforeSilenced,
189 "@DocString(FMTObject::setmaxwarningsbeforesilenced)");
190
191 Rcpp::class_<Core::FMTMask>("FMTmask", "@DocString(FMTMask)")
192 .constructor("@DocString(FMTMask())")
193 .constructor<std::vector<std::string>,std::vector<Core::FMTTheme>>(
194 "@DocString(FMTMask(const std::vector<std::string>&,const std::vector<Core::FMTTheme>&))")
195 .constructor<std::string, std::vector<Core::FMTTheme>>(
196 "@DocString(FMTMask(const std::string&,const std::vector<Core::FMTTheme>&))")
197 .method("len", &Core::FMTMask::operator bool,
198 "@DocString(FMTMask::operator bool)")
199 .method("str",&Core::FMTMask::operator std::string,
200 "@DocString(FMTMask::operator std::string)")
201 .method("eq", &Core::FMTMask::operator ==,
202 "@DocString(FMTMask::operator==)")
203 .method("ne", &Core::FMTMask::operator !=,
204 "@DocString(FMTMask::operator!=)")
205 .method("lt", &Core::FMTMask::operator <,
206 "@DocString(FMTMask::operator<)");
207
208 Rcpp::class_<Core::FMTMaskFilter>("FMTmaskfilter", "@DocString(FMTMaskFilter)")
209 .constructor("@DocString(FMTMaskFilter())");
210
211
212
213 Rcpp::class_<Core::FMTMaskFilter>("FMTmaskfilter", "@DocString(FMTMaskFilter)")
214 .constructor("@DocString(FMTMaskFilter())");
215
216
217 Rcpp::class_<Core::FMTDevelopment>("FMTdevelopment", "@DocString(FMTDevelopment)")
218 .constructor("@DocString(FMTDevelopment())")
219 .method("getage", &Core::FMTDevelopment::getAge,
220 "@DocString(FMTDevelopment::getage)")
221 .method("getlock", &Core::FMTDevelopment::getLock,
222 "@DocString(FMTDevelopment::getlock)")
223 .method("getperiod", &Core::FMTDevelopment::getPeriod,
224 "@DocString(FMTDevelopment::getperiod)")
225 .method("getmask", &Core::FMTDevelopment::getMaskCopy,
226 "@DocString(FMTDevelopment::getmask)")
227 .method("setage", &Core::FMTDevelopment::setAge,
228 "@DocString(FMTDevelopment::setage)")
229 .method("setlock", &Core::FMTDevelopment::setLock,
230 "@DocString(FMTDevelopment::setlock)")
231 .method("setperiod", &Core::FMTDevelopment::setPeriod,
232 "@DocString(FMTDevelopment::setperiod)")
233 .method("setmask", &Core::FMTDevelopment::setMask,
234 "@DocString(FMTDevelopment::setmask)")
235 .method("eq", &Core::FMTDevelopment::operator ==,
236 "@DocString(FMTDevelopment::operator==)")
237 .method("ne", &Core::FMTDevelopment::operator !=,
238 "@DocString(FMTDevelopment::operator!=)")
239 .method("lt",&Core::FMTDevelopment::operator <,
240 "@DocString(FMTDevelopment::operator<)")
241 .method("grow",&Core::FMTDevelopment::grow,
242 "@DocString(FMTDevelopment::grow)")
243 //.method("operable",&Core::FMTDevelopment::operable,
244 // "@DocString(FMTDevelopment::operable)")
245 //.method("operate",&Core::FMTDevelopment::operate,
246 // "@DocString(FMTDevelopment::operate)")
247 .method("str", &Core::FMTDevelopment::operator std::string,
248 "@DocString(FMTDevelopment::operate std::string)");
249
250
251 Rcpp::class_<Core::FMTAgeBounds>("FMTagebounds", "@DocString(FMTAgeBounds)")
252 .constructor("@DocString(FMTAgeBounds())")
253 .constructor<Core::FMTsection,int,int>("@DocString(FMTAgeBounds(FMTsection,const int&,const int&))");
254
255 Rcpp::class_<Core::FMTPerBounds>("FMTperbounds", "@DocString(FMTPerBounds)")
256 .constructor("@DocString(FMTPerBounds())")
257 .constructor<Core::FMTsection, int, int>("@DocString(FMTPerBounds(FMTsection,const int&,const int&))");
258
259 Rcpp::class_<Core::FMTYldBounds>("FMTyldbounds", "@DocString(FMTYldBounds)")
260 .constructor("@DocString(FMTYldBounds())")
261 .constructor<Core::FMTsection,std::string,double,double>("@DocString(FMTperiodbounds(FMTsection,const std::string&,const double&,const double&))");
262
263 Rcpp::class_<Core::FMTLockBounds>("FMTlockbounds", "@DocString(FMTLockBounds)")
264 .constructor("@DocString(FMTLockBounds())")
265 .constructor<Core::FMTsection, int, int>("@DocString(FMTLockBounds(FMTsection,const int&,const int&))");
266
267
268
269
270 Rcpp::class_<Core::FMTSpec>("FMTspec", "@DocString(FMTSpec)")
271 .constructor("@DocString(FMTSpec())")
272 .method("setbounds",&Core::FMTSpec::setBounds,"@DocString(Core::FMTSpec::setbounds())")
273 .method("addbounds",
274 static_cast<bool(Core::FMTSpec::*)(const Core::FMTAgeBounds&)>(&Core::FMTSpec::addBounds),
275 "@DocString(Core::FMTSpec::addbounds(const FMTAgeBounds&))")
276 .method("addbounds",
277 static_cast<bool(Core::FMTSpec::*)(const Core::FMTYldBounds&)>(&Core::FMTSpec::addBounds),
278 "@DocString(Core::FMTSpec::addbounds(const FMTYldBounds&))")
279 .method("addbounds",
280 static_cast<bool(Core::FMTSpec::*)(const Core::FMTLockBounds&)>(&Core::FMTSpec::addBounds),
281 "@DocString(Core::FMTSpec::addbounds(const FMTLockBounds&))");
282
283
284 Rcpp::class_<Core::FMTActualDevelopment>("FMTactualdevelopment", "@DocString(FMTActualDevelopment)")
285 .derives<Core::FMTDevelopment>("FMTdevelopment")
286 .constructor("@DocString(FMTActualDevelopment())")
287 .constructor<Core::FMTMask,int,int,double>("@DocString(FMTActualDevelopment(const FMTMask&,const int&,const int&,const int&,const double&))")
288 .method("getarea", &Core::FMTActualDevelopment::getArea,
289 "@DocString(FMTActualDevelopment::getarea)")
290 .method("setarea", &Core::FMTActualDevelopment::setArea,
291 "@DocString(FMTActualDevelopment::setarea)")
292 .method("eq", &Core::FMTActualDevelopment::operator ==,
293 "@DocString(FMTActualDevelopment::operator==)")
294 .method("ne", &Core::FMTActualDevelopment::operator !=,
295 "@DocString(FMTActualDevelopment::operator!=)")
296 .method("lt", &Core::FMTActualDevelopment::operator <,
297 "@DocString(FMTActualDevelopment::operator<)");
298
299 Rcpp::class_<Core::FMTFuturDevelopment>("FMTfuturdevelopment", "@DocString(FMTFuturDevelopment)")
300 .derives<Core::FMTDevelopment>("FMTdevelopment")
301 .constructor("@DocString(FMTFuturDevelopment())");
302
303
304 Rcpp::class_<Core::FMTAction>("FMTaction","@DocString(FMTAction)")
305 .constructor("@DocString(FMTAction())")
306 .constructor<std::string,bool,bool>("@DocString(FMTAction(const std::string&,const bool&,const bool&))")
307 .derives<Core::FMTList<Core::FMTSpec>>("FMTspeclist")
308 .method("__eq__",&Core::FMTAction::operator ==,
309 "@DocString(FMTAction::operator==)")
310 .method("__ne__",&Core::FMTAction::operator !=,
311 "@DocString(FMTAction::operator!=)")
312 .method("__lt__",&Core::FMTAction::operator <,
313 "@DocString(FMTAction::operator<)")
314 .method("__str__", &Core::FMTAction::operator std::string,
315 "@DocString(FMTAction::operator std::string)")
316 .method("getname",&Core::FMTAction::getName,
317 "@DocString(FMTAction::getname)")
318 .method("dorespectlock",&Core::FMTAction::doRespectLock,
319 "@DocString(FMTAction::dorespectlock)")
320 .method("isresetage",&Core::FMTAction::isResetAge,
321 "@DocString(FMTAction::isresetage)");
322
323
324
325 Rcpp::class_<Core::FMTLifespans>("FMTlifespans", "@DocString(FMTLifespans)")
326 .derives<Core::FMTList<int>>("FMTintlist")
327 .constructor("@DocString(FMTLifespans())");
328
329
330
331 Rcpp::class_<Core::FMTTransitionMask>("FMTtransitionmask", "@DocString(FMTTransitionMask)")
332 .constructor<std::string,std::vector<Core::FMTTheme>,double>("@DocString(FMTTransitionMask(const std::string&,const std::vector<FMTTheme>&,const double&))")
333 .constructor("@DocString(FMTTransitionMask())");
334
335 Rcpp::class_<Core::FMTFork>("FMTfork", "@DocString(FMTFork)")
336 .derives<Core::FMTList<Core::FMTSpec>>("FMTspeclist")
337 .method("add", &Core::FMTFork::add,
338 "@DocString(FMTFork::add)")
339 .constructor("@DocString(FMTFork())");
340
341 Rcpp::class_<Core::FMTYieldHandler>("FMTyieldhandler", "@DocString(FMTYieldHandler)")
342 .constructor("@DocString(FMTYieldHandler())")
343 .method("push_data",
344 static_cast<bool (Core::FMTYieldHandler::*)(const std::string&,const double&)>(&Core::FMTYieldHandler::pushData),
345 "@DocString(FMTYieldHandler::push_data(const std::string&,const double&))")
346 .method("push_base", &Core::FMTYieldHandler::pushBase,
347 "@DocString(FMTYieldHandler::push_base)");
348
349 Rcpp::class_<Core::FMTAgeYieldHandler>("FMTageyieldhandler", "@DocString(FMTAgeYieldHandler)")
350 .derives<Core::FMTYieldHandler>("FMTyieldhandler")
351 .constructor("@DocString(FMTAgeYieldHandler())")
352 .constructor<Core::FMTMask>("@DocString(FMTAgeYieldHandler(const FMTMask&))")
353 .method("str", &Core::FMTAgeYieldHandler::operator std::string,
354 "@DocString(FMTAgeYieldHandler::operator std::string)");
355
356 Rcpp::class_<Core::FMTTimeYieldHandler>("FMTtimeyieldhandler", "@DocString(FMTTimeYieldHandler)")
357 .derives<Core::FMTYieldHandler>("FMTyieldhandler")
358 .constructor("@DocString(FMTTimeYieldHandler())")
359 .constructor<Core::FMTMask>("@DocString(FMTTimeYieldHandler(const FMTMask&))")
360 .method("str", &Core::FMTTimeYieldHandler::operator std::string,
361 "@DocString(FMTTimeYieldHandler::operator std::string)");
362
363
364
365
366 Rcpp::class_<Core::FMTYields>("FMTyields", "@DocString(FMTYields)")
367 //.derives<Core::FMTList<Core::FMTYieldHandler>>("FMTyieldhandlerlist")
368 .constructor("@DocString(FMTYields())")
369 .method("getallyields", &Core::FMTYields::getAllYields,
370 "@DocString(FMTYields::getallyields)")
371 .method("getfromfactor", &Core::FMTYields::getFromFactor,
372 "@DocString(FMTYields::getfromfactor)")
373 .method("update", &Core::FMTYields::update,
374 "@DocString(FMTYields::update)")
375 .method("push_back",Core::FMTYields::pushBackAgeHandler,
376 "@DocString(Core::FMTYields::push_backagehandler")
377 .method("push_back", Core::FMTYields::pushBackTimeHandler,
378 "@DocString(Core::FMTYields::push_backtimehandler");
379
380
381
382
383 Rcpp::class_<Core::FMTTransition>("FMTtransition", "@DocString(FMTTransition)")
384 .derives<Core::FMTList<Core::FMTFork>>("FMTforklist")
385 .constructor("@DocString(FMTTransition())")
386 .constructor<std::string>("@DocString(FMTTransition(const std::string&))")
387 .method("single",&Core::FMTTransition::single,
388 "@DocString(FMTTransition::single)")
389 .method("main_target", &Core::FMTTransition::mainTarget,
390 "@DocString(FMTTransition::main_target)")
391 .method("age_after", &Core::FMTTransition::ageAfter,
392 "@DocString(FMTTransition::age_after)")
393 .method("attribute_targets", &Core::FMTTransition::attributeTargets,
394 "@DocString(FMTTransition::attribute_targets)")
395 .method("str", &Core::FMTTransition::operator std::string,
396 "@DocString(FMTTransition::operator std::string)")
397 .method("eq",&Core::FMTTransition::operator ==,
398 "@DocString(FMTTransition::operator==)")
399 .method("ne",&Core::FMTTransition::operator !=,
400 "@DocString(FMTTransition::operator!=)")
401 .method("lt",&Core::FMTTransition::operator <,
402 "@DocString(FMTTransition::operator<)")
403 .method("getname",&Core::FMTTransition::getName,
404 "@DocString(FMTTransition::getname)");
405
406 Rcpp::class_<Core::FMTOutputSource>("FMToutputsource", "@DocString(FMTOutputSource)")
407 .constructor<Core::FMTSpec, Core::FMTMask,
408 Core::FMTotar, std::string,
409 std::string, int, int>("@DocString(FMTOutputSource())")
410 .constructor("@DocString(FMTOutputSource())");
411
412 Rcpp::class_<Core::FMTOperator>("FMToperator", "@DocString(FMTOperator)")
413 .constructor("@DocString(FMTOperator())");
414
415 Rcpp::class_<Core::FMTOutputNode>("FMToutputnode", "@DocString(FMTOutputNode)")
416 .constructor("@DocString(FMTOutputNode())")
417 .method("str", &Core::FMTOutputNode::operator std::string,
418 "@DocString(FMTOutputNode::operator std::string)");
419
420
421 Rcpp::class_<Core::FMTOutput>("FMToutput", "@DocString(FMTOutput)")
422 .constructor("@DocString(FMTOutput())")
423 .constructor<std::string,std::string,std::string,
424 std::vector<Core::FMTOutputSource>,
425 std::vector<Core::FMTOperator>>("@DocString(FMTOutput(const std::string&,const std::string&,const int&,std::vector<FMTOutputSource>&,std::vector<FMTOperator>&))")
426 .method("getname",&Core::FMTOutput::getName,
427 "@DocString(FMTOutput::getname)")
428 .method("getdescription",&Core::FMTOutput::getDescription,
429 "@DocString(FMTOutput::getdescription)")
430 .method("empty", &Core::FMTOutput::empty,
431 "@DocString(FMTOutput::empty)")
432 .method("containslevel",&Core::FMTOutput::containsLevel,
433 "@DocString(FMTOutput::containslevel)")
434 .method("islevel", &Core::FMTOutput::isLevel,
435 "@DocString(FMTOutput::islevel)")
436 .method("isonlylevel", &Core::FMTOutput::isOnlyLevel,
437 "@DocString(FMTOutput::isonlylevel)")
438 //.method("getNodes",&Core::FMTOutput::getNodes,
439 // "@DocString(FMTOutput::getNodes)")
440 .method("str", &Core::FMTOutput::operator std::string,
441 "@DocString(FMTOutput::operator std::string)")
442 .method("eq",&Core::FMTOutput::operator ==,
443 "@DocString(FMTOutput::operator==)")
444 .method("ne",&Core::FMTOutput::operator !=,
445 "@DocString(FMTOutput::operator!=)");
446
447
448 Rcpp::class_<Core::FMTTheme>("FMTtheme", "@DocString(FMTTheme)")
449 .constructor("@DocString(FMTTheme())")
450 .constructor<std::vector<std::string>,
451 std::vector<std::string>,
452 std::vector<std::string>,
453 std::vector<std::vector<std::string>>,
454 size_t,size_t,std::string>(
455 "@DocString(const std::vector<std::string>&,const std::vector<std::string>&,const std::vector<std::vector<std::string>>,const std::vector<std::map<std::string, double>>&,const size_t&, const size_t&, const std::string&)")
456 .method("str", &Core::FMTTheme::operator std::string,
457 "@DocString(FMTTheme::operator std::string)")
458 .method("eq", &Core::FMTTheme::operator ==,
459 "@DocString(FMTTheme::operator==)")
460 .method("getattributes", &Core::FMTTheme::getAttributes,
461 "@DocString(FMTTheme::getattributes)")
462 .method("getname", &Core::FMTTheme::getName,
463 "@DocString(FMTTheme::getname)")
464 .method("getaggregatesasdataframe", &Core::FMTTheme::getAggregatesAsDataFrame,
465 "@DocString(FMTTheme::getaggregatesasdataframee)")
466 .method("getattributesasdataframe", &Core::FMTTheme::getAttributesAsDataFrame,
467 "@DocString(FMTTheme::getattributesasdataframe)");
468
469
470 Rcpp::class_<Core::FMTConstants>("FMTconstants", "@DocString(FMTConstants)")
471 .constructor("@DocString(FMTConstants())");
472
473 Rcpp::class_<Core::FMTSchedule>("FMTschedule", "@DocString(FMTSchedule)")
474 .constructor("@DocString(FMTSchedule())")
475 .constructor<int, std::map<Core::FMTAction, std::map<Core::FMTDevelopment, std::vector<double>>>>(
476 "@DocString(FMTSchedule(int,std::map<Core::FMTAction,std::map<Core::FMTDevelopment,std::vector<double>>>))")
477 .method("str", &Core::FMTSchedule::operator std::string,
478 "@DocString(FMTSchedule::operator std::string)")
479 .method("add", &Core::FMTSchedule::operator +,
480 "@DocString(FMTSchedule::operator+)")
481 .method("actionarea", &Core::FMTSchedule::actionArea,
482 "@DocString(FMTSchedule::actionarea)")
483 .method("getperiod", &Core::FMTSchedule::getPeriod,
484 "@DocString(FMTSchedule::getperiod)")
485 .method("setperiod", &Core::FMTSchedule::setPeriod,
486 "@DocString(FMTSchedule::setperiod)")
487 .method("eq", &Core::FMTSchedule::operator ==,
488 "@DocString(FMTSchedule::operator==)")
489 .method("ne", &Core::FMTSchedule::operator !=,
490 "@DocString(FMTSchedule::operator!=)")
491 .method("empty",&Core::FMTSchedule::empty,
492 "@DocString(FMTSchedule::empty)");
493
494 Rcpp::class_<Core::FMTGCBMTransition>("FMTGCBMtransition", "@DocString(FMTGCBMTransition)")
495 .constructor("@DocString(FMTGCBMTransition())")
496 .field("name", &Core::FMTGCBMTransition::name,
497 "@DocString(FMTGCBMTransition::name)")
498 .field("ageafter", &Core::FMTGCBMTransition::ageafter,
499 "@DocString(FMTGCBMTransition::ageafter)")
500 .field("themes",&Core::FMTGCBMTransition::themes,
501 "@DocString(FMTGCBMTransition::themes)");
502
503 Rcpp::class_<Core::FMTConstraint>("FMTconstraint", "@DocString(FMTConstraint)")
504 .derives<Core::FMTOutput>("FMToutput")
505 .constructor("@DocString(FMTConstraint())")
506 .constructor<Core::FMTconstrainttype,Core::FMTOutput>("@DocString(FMTConstraint(FMTconstrainttype,const FMTOutput&))")
507 .method("setlength", &Core::FMTConstraint::setLength,
508 "@DocString(FMTConstraint::setlength)")
509 .method("realconstraintstring", &Core::FMTConstraint::operator std::string,
510 "@DocString(FMTConstraint::operator std::string)")
511 .method("eq", &Core::FMTConstraint::operator ==,
512 "@DocString(FMTConstraint::operator==)");
513
514 }
515}
516
517#endif // PYEXPORTCORE_H_INCLUDED
#define RCPP_COMMA
Definition: Rdeclarations.h:91
RCPP_EXPOSED_ENUM_NODECL(Core::FMTyldtype)
RCPP_DEFINEVECTOR(Core::FMTMask)
RCPP_DEFINEPAIR(Core::FMTMask, Core::FMTSpec)
RCPP_EXPOSED_WRAP(Core::FMTObject)
RCPP_DEFINEMAP(Core::FMTDevelopment, std::vector< double >)
RCPP_EXPOSED_AS(Core::FMTObject)
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 doRespectLock() const
Return true if the action needs to respect the lock state of the development.
Definition: FMTAction.h:189
std::string getName() const
Get the name of the action.
Definition: FMTAction.h:180
Child class of FMTDevelopment representing an actual forest stand, holding the area of the stand.
Definition: FMTActualDevelopment.h:24
void setArea(const double &newarea)
Set the area of the actual development.
double getArea() const override
Return the area of the actual development.
Yield handler for age based yields, as seen in the yield section with _AGE.
Definition: FMTAgeYieldHandler.h:24
Class holding the constants defined in the constants section of a model, used by the parsers.
Definition: FMTConstants.h:28
void setLength(int firstPeriod=1, int lastPeriod=std::numeric_limits< int >::max())
Set the length of the constraint.
Development path holding a generated development and the proportion of area going to it.
Definition: FMTDevelopmentPath.h:26
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
Core::FMTMask getMaskCopy() const
Get a copy of the mask of the development.
Definition: FMTDevelopment.h:109
int getAge() const
Get the age of the development.
Definition: FMTDevelopment.h:64
Fork of a transition, holding the transition masks (targets and proportions) applied to a development...
Definition: FMTFork.h:38
void add(const FMTTransitionMask &transition)
Add a transition mask to the fork.
Child class of FMTDevelopment representing a future stand generated by growth or transition,...
Definition: FMTFuturDevelopment.h:23
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
List holding the maximum age of aggregates of developments.
Definition: FMTLifespans.h:23
Definition: FMTAreaParser.h:32
Filter built from masks used to preSolve and postsolve FMTMask objects.
Definition: FMTMaskFilter.h:31
Core class holding, as a boost dynamic bitset, which theme attributes are part of a mask.
Definition: FMTMask.h:96
Base class of multiple FMT classes holding a shared exception handler pointer and logger.
Definition: FMTObject.h:49
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 setMaxWarningsBeforeSilenced(const size_t &maxwarningcount)
Set the number of warnings raised before being silenced.
void setDebugExceptionHandler()
Create and set a debug exception handler to the FMTObject.
Mathematical operator usable in yield and output expressions.
Definition: FMTOperator.h:44
Node of an output representing a set of developments in the graph, holding a source,...
Definition: FMTOutputNode.h:25
Source of an output holding a mask, a target and values, used to compute an output.
Definition: FMTOutputSource.h:44
Class letting the user formulate a constraint in the optimize section or collect data across the grap...
Definition: FMTOutput.h:37
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
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.
Spatially referenced schedule describing the area of developments for which an action can be operated...
Definition: FMTSchedule.h:29
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
Class holding the attributes and aggregates of a single theme, describing a part of a FMTMask.
Definition: FMTTheme.h:47
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::string getName() const
Return the name of the theme.
Definition: FMTTheme.h:234
Yield handler for time based yields, indexed by period.
Definition: FMTTimeYieldHandler.h:25
Transition mask holding a target mask and a proportion, used to disturb a development in a transition...
Definition: FMTTransitionMask.h:35
List of FMTFork describing the transition of an action, disturbing a development to generate new deve...
Definition: FMTTransition.h:35
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.
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 ...
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34
FMTsection
Enumerator describing the sections of a Woodstock model.
Definition: FMTutility.h:32
FMTconstrainttype
Enumerator of the constraint and objective types found in an optimization section,...
Definition: FMTConstraint.h:31
FMTyldtype
Enumerator describing the type of a yield (age, time, complex, model).
Definition: FMTutility.h:62
FMTotar
Enumerator describing the target of an output (inventory, actual, value, time yield,...
Definition: FMTutility.h:101
Definition: RexportCore.h:153
STL namespace.