FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTmodel.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 FMTMODEL_H_INCLUDED
9#define FMTMODEL_H_INCLUDED
10
11#include "FMTtheme.hpp"
12#include "FMTaction.hpp"
13#include "FMTtransition.hpp"
14#include "FMTyields.hpp"
15#include "FMTlifespans.hpp"
17#include "FMToutput.hpp"
18#include "FMTconstraint.hpp"
19#include "FMTlist.hpp"
21#include <boost/serialization/vector.hpp>
22#include <boost/serialization/map.hpp>
23#include <boost/serialization/unordered_map.hpp>
24#include <boost/serialization/export.hpp>
25#include "FMToutputnode.hpp"
26#include "FMTschedule.hpp"
27
28
29namespace Graph
30{
31 template<class T1, class T2>
32 class FMTgraph;
33 class FMTlinegraph;
34 class FMTgraphvertextoyield;
35}
36
37namespace Parser
38{
39 class FMTmodelparser;
40}
41
42namespace Spatial
43{
44 class FMTspatialschedule;
45 class FMTspatialnodescache;
46}
48namespace Models
49{
50 class FMTmodelstats;
51 // DocString: FMTmodel
60 {
61 template<class T1,class T2>
62 friend class Graph::FMTgraph;
63 friend class Graph::FMTlinegraph;
68 public:
69 // DocString: FMTmodel::aggregateAllActions
76 Models::FMTmodel aggregateAllActions(const std::vector<std::string>& p_Aggregates) const;
77 // DocString: FMTmodel::aggregateSchedules
83 std::vector<Core::FMTschedule> aggregateSchedules(const std::vector<Core::FMTschedule>& p_schedules) const;
84 // DocString: FMTmodel::setparallellogger
90 // DocString: FMTmodel::clearcache
94 virtual void clearcache();
95 // DocString: FMTmodel(const std::vector<Core::FMTactualdevelopment>& larea, const std::vector<Core::FMTtheme>, const std::vector<Core::FMTaction>, const std::vector<Core::FMTtransition>, const Core::FMTyields, const Core::FMTlifespans, const std::string, const std::vector<Core::FMToutput>, std::vector<Core::FMTconstraint>,FMTmodelparameters)
100 FMTmodel(const std::vector<Core::FMTactualdevelopment>& larea, const std::vector<Core::FMTtheme>& lthemes,
101 const std::vector<Core::FMTaction>& lactions,
102 const std::vector<Core::FMTtransition>& ltransitions, const Core::FMTyields& lyields, const Core::FMTlifespans& llifespan,
103 const std::string& lname, const std::vector<Core::FMToutput>& loutputs, std::vector<Core::FMTconstraint> lconstraints = std::vector<Core::FMTconstraint>(),
104 FMTmodelparameters lparameters = FMTmodelparameters());
105 // DocString: FMTmodel()
110 // DocString: ~FMTmodel
114 virtual ~FMTmodel() = default;
115 // DocString: FMTmodel(FMTmodel&&)
119 FMTmodel(FMTmodel&& rhs) = default;
120 // DocString: FMTmodel::operator=(FMTmodel&&)
124 FMTmodel& operator =(FMTmodel&& rhs) = default;
125 // DocString: FMTmodel::getarea
129 virtual std::vector<Core::FMTactualdevelopment>getarea(int period = 0, bool beforegrowanddeath = false) const;
130 // DocString: FMTmodel::getcopy
135 virtual std::unique_ptr<FMTmodel> getcopy(int period = 0) const;
136 // DocString: FMTmodel::basepresolve
143 // DocString: FMTmodel::getpresolvefilter
147 Core::FMTmaskfilter getpresolvefilter(const std::vector<Core::FMTtheme>& originalthemes) const;
148 // DocString: FMTmodel::getpostsolvefilter
152 Core::FMTmaskfilter getpostsolvefilter(const std::vector<Core::FMTtheme>& originalthemes, const Core::FMTmask& devmask) const;
153 // DocString: FMTmodel::getselectedmask
158 Core::FMTmask getselectedmask(const std::vector<Core::FMTtheme>& originalthemes) const;
159 // DocString: FMTmodel::presolve
165 virtual std::unique_ptr<FMTmodel>presolve(std::vector<Core::FMTactualdevelopment> optionaldevelopments = std::vector<Core::FMTactualdevelopment>()) const;
166 // DocString: FMTmodel::postsolve
167 /*
168 This function is for postsolving the presolved model into the original model.
169 */
170 virtual void postsolve(const FMTmodel& originalbasemodel);
171 // DocString: FMTmodel::presolveschedule
177 const FMTmodel& originalbasemodel) const;
178 // DocString: FMTmodel::getmodelstats
183 // DocString: FMTmodel::cleanactionsntransitions
189 // DocString: FMTmodel::getname
193 inline std::string getname() const
194 {
195 return name;
196 }
197 // DocString: FMTmodel::getthemes
201 inline std::vector<Core::FMTtheme>getthemes() const
202 {
203 return themes;
204 }
205 // DocString: FMTmodel::getactions
209 inline std::vector<Core::FMTaction>getactions() const
210 {
211 return actions;
212 }
213 // DocString: FMTmodel::gettransitions
217 inline std::vector<Core::FMTtransition>gettransitions() const
218 {
219 return transitions;
220 }
221 // DocString: FMTmodel::getyields
226 {
227 return yields;
228 }
229 // DocString: FMTmodel::getlifespan
234 {
235 return lifespan;
236 }
237 // DocString: FMTmodel::getoutputs
241 inline std::vector<Core::FMToutput> getoutputs() const
242 {
243 return outputs;
244 }
245 // DocString: FMTmodel::getconstraints
249 inline std::vector<Core::FMTconstraint>getconstraints() const
250 {
251 return constraints;
252 }
253 // DocString: FMTmodel::defaultdeathaction
258 const std::vector<Core::FMTtheme>& lthemes);
259 // DocString: FMTmodel::defaultdeathtransition
264 const std::vector<Core::FMTtheme>& lthemes);
265 // DocString: FMTmodel::addoutput
276 void addoutput(const std::string& name, const std::string& maskstring, Core::FMTotar outputtarget,
277 std::string action = std::string(), std::string yield = std::string(), std::string description = std::string(), int targettheme = -1);
278 // DocString: FMTmodel::addyieldhandlers
283 template<typename T>
284 void addyieldhandlers(const std::vector<T>& yieldhandlers)
285 {
286 try {
287 yields.unshrink(themes);
288 for (const auto& yldhandler : yieldhandlers)
289 {
290 std::unique_ptr<Core::FMTyieldhandler> yldhandlerptr = yldhandler.clone();
291 yields.push_back(yldhandlerptr->getmask(), yldhandlerptr);
292 }
293 yields.update();
294 }
295 catch (...) {
296 _exhandler->printexceptions("", "FMTmodel:::addyieldhandlers", __LINE__, __FILE__);
297 }
298 }
299 // DocString: FMTmodel::addyieldhandlersfromptr
303 void addyieldhandlersfromptr(const std::vector<std::unique_ptr<Core::FMTyieldhandler>>& yieldhandlers);
304 // DocString: FMTmodel::operator==
308 bool operator == (const FMTmodel& rhs) const;
309 // DocString: FMTmodel::operator<
313 bool operator < (const FMTmodel& rhs) const;
314 // DocString: FMTmodel::setarea
321 void setarea(const std::vector<Core::FMTactualdevelopment>& ldevs);
322 // DocString: FMTmodel::setthemes
326 void setthemes(const std::vector<Core::FMTtheme>& lthemes);
327 // DocString: FMTmodel::setactions
331 void setactions(const std::vector<Core::FMTaction>& lactions);
332 // DocString: FMTmodel::settransitions
336 void settransitions(const std::vector<Core::FMTtransition>& ltransitions);
337 // DocString: FMTmodel::setconstraints
341 void setconstraints(const std::vector<Core::FMTconstraint>& lconstraint);
342 // DocString: FMTmodel::setyields
346 void setyields(const Core::FMTyields& lylds);
347 // DocString: FMTmodel::setlifespan
351 void setlifespan(const Core::FMTlifespans& llifespan);
352 // DocString: FMTmodel::setname
356 void setname(const std::string& newname);
357 // DocString: FMTmodel::setoutputs
361 void setoutputs(const std::vector<Core::FMToutput>& newoutputs);
362 // DocString: FMTmodel::isvalid
368 bool isvalid();
369 // DocString: FMTmodel::locatestaticthemes(const Core::FMToutput, bool ignoreoutputvariables)
374 std::vector<Core::FMTtheme> locatestaticthemes(const Core::FMToutput& output, bool ignoreoutputvariables = false) const;
375 // DocString: FMTmodel::locatestaticthemes(const Core::FMToutputnode, bool ignoreoutputvariables)
380 std::vector<Core::FMTtheme> locatestaticthemes(const Core::FMToutputnode& output, bool ignoreoutputvariables = false) const;
381 // DocString: FMTmodel::locatedynamicthemes
385 std::vector<Core::FMTtheme> locatedynamicthemes(const Core::FMToutput& outpu, bool ignoreoutputvariables = false) const;
386 // DocString: FMTmodel::getdynamicmask(const Core::FMToutput, bool ignoreoutputvariables)
390 Core::FMTmask getdynamicmask(const Core::FMToutput& output, bool ignoreoutputvariables = false) const;
391 // DocString: FMTmodel::getdynamicmask(const Core::FMToutputnode, bool ignoreoutputvariables)
395 Core::FMTmask getdynamicmask(const Core::FMToutputnode& node, bool ignoreoutputvariables = false) const;
396 // DocString: FMTmodel::getstaticmask
400 Core::FMTmask getstaticmask(const Core::FMToutputnode& node, bool ignoreoutputvariables = false) const;
401 // DocString: FMTmodel::isstaticnode
406 bool isstaticnode(const Core::FMToutputnode& node, double ratioofset = 0.1) const;
407 // DocString: FMTmodel::locatestatictransitionsthemes
411 std::vector<Core::FMTtheme>locatestatictransitionsthemes() const;
412 // DocString: FMTmodel::locatenotestaticthemes
416 std::vector<Core::FMTtheme>locatenodestaticthemes(const Core::FMToutputnode& node,
417 bool ignoreoutputvariables = false,
418 std::vector<Core::FMTtheme> basethemes = std::vector<Core::FMTtheme>()) const;
419 // DocString: FMTmodel(FMTmodel)
423 FMTmodel(const FMTmodel& rhs);
424 // DocString: FMTmodel::operator=
428 FMTmodel& operator = (const FMTmodel& rhs);
429 // DocString: FMTmodel::empty
433 bool empty() const;
434 // DocString: FMTmodel::append
439 void push_back(const FMTmodel& rhs);
440 // DocString: FMTmodel::getinitialarea
444 double getinitialarea() const;
445 // DocString: FMTmodel::setareaperiod
449 void setareaperiod(const int& period);
450 // DocString: FMTmodel::getpotentialschedule
455 Core::FMTschedule getpotentialschedule(std::vector<Core::FMTactualdevelopment> toremove,
456 std::vector<Core::FMTactualdevelopment> selection, bool withlock = true) const;
457 // DocString: FMTmodel::getreplanningconstraints
461 virtual std::vector<Core::FMTconstraint> getreplanningconstraints(const std::string& modeltype, const std::vector<Core::FMTconstraint>& localconstraints, const int& period) const;
462 // DocString: FMTmodel::doplanning
466 virtual bool doplanning(const bool& solve, std::vector<Core::FMTschedule> schedules = std::vector<Core::FMTschedule>());
467 // DocString: FMTmodel::getoutput
474 virtual std::map<std::string, double> getoutput(const Core::FMToutput& output,
475 int period, Core::FMToutputlevel level = Core::FMToutputlevel::standard) const;
476 // DocString: FMTmodel::getsolution
481 virtual Core::FMTschedule getsolution(int period, bool withlock = false) const;
482 // DocString: FMTmodel::getoutputsfromperiods
486 virtual std::map<std::string, std::vector<std::vector<double>>>getoutputsfromperiods(const std::vector<Core::FMToutput>& theoutputs,
487 const int& firstperiod, const int& lastperiod, Core::FMToutputlevel level = Core::FMToutputlevel::standard) const;
488 // DocString: FMTmodel::clone
492 virtual std::unique_ptr<FMTmodel>clone() const;
493 // DocString: FMTmodel::setparameter(const FMTintmodelparameters,const int&)
497 virtual bool setparameter(const FMTintmodelparameters& key, const int& value);
498 // DocString: FMTmodel::setparameter(const FMTdblmodelparameters,const double)
502 virtual bool setparameter(const FMTdblmodelparameters& key, const double& value);
503 // DocString: FMTmodel::setparameter(const FMTboolmodelparameters,const bool)
507 virtual bool setparameter(const FMTboolmodelparameters& key, const bool& value);
508 // DocString: FMTmodel::getparameter(const FMTintmodelparameters)
512 int getparameter(const FMTintmodelparameters& key) const;
513 // DocString: FMTmodel::getparameter(const FMTdblmodelparameters)
517 double getparameter(const FMTdblmodelparameters& key) const;
518 // DocString: FMTmodel::getparameter(const FMTboolmodelparameters)
522 bool getparameter(const FMTboolmodelparameters& key) const;
523 // DocString: FMTmodel::setcompresstime
527 bool setcompresstime(const int& periodstart, const int& periodstop, const int& value);
528 // DocString: FMTmodel::getcompresstime
532 std::vector<int> getcompresstime() const;
533 // DocString: FMTmodel::goalconstraints
537 std::vector<Core::FMTconstraint>goalconstraints(double penalty = 999999) const;
538 // DocString: FMTmodel::gettacticalconstraints
542 std::vector<Core::FMTconstraint>gettacticalconstraints(double penalty = 999999, double scheduleweight = 999999, double objective = 0, double objectivefactor = 1.0) const;
543 // DocString: FMTmodel::showparameters
547 virtual void showparameters(const bool& showhelp = false)const;
548 // DocString: FMTmodel::build
552 virtual bool build(std::vector<Core::FMTschedule> schedules = std::vector<Core::FMTschedule>())
553 {
554 //Mettre message warning
555 return false;
556 }
557 // DocString: FMTmodel::solve
561 virtual bool solve()//Only for optimisation
562 {
563 //Mettre message warning
564 return false;
565 }
566 // DocString: FMTmodel::isoptimal
570 virtual bool isoptimal() const;
571 // DocString: FMTmodel::getobjectivevalue
575 virtual double getobjectivevalue() const;
576 protected:
577 // DocString: FMTmodel::parameters
581 // DocString: FMTmodel::area
583 std::vector<Core::FMTactualdevelopment>area;
584 // DocString: FMTmodel::themes
586 std::vector<Core::FMTtheme>themes;
587 // DocString: FMTmodel::actions
589 std::vector<Core::FMTaction>actions;
590 // DocString: FMTmodel::transitions
592 std::vector<Core::FMTtransition>transitions;
593 // DocString: FMTmodel::yields
596 // DocString: FMTmodel::lifespan
599 // DocString: FMTmodel::outputs
601 std::vector<Core::FMToutput> outputs;
602 // DocString: FMTmodel::constraints
604 std::vector<Core::FMTconstraint>constraints;
605 // DocString: FMTmodel::name
607 std::string name;
608 // DocString: FMTmodel::statictransitionthemes
610 std::vector<size_t>statictransitionthemes;
611 // DocString: FMTmodel::setdefaultobjects
617 // DocString: FMTmodel::getbasemask
621 Core::FMTmask getbasemask(std::vector<Core::FMTactualdevelopment> optionaldevelopments) const;
622 // DocString: FMTmodel::getstatictransitionthemes
626 std::vector<size_t>getstatictransitionthemes() const;
627 // DocString: FMTmodel::getstaticpresolvethemes
632 std::vector<Core::FMTtheme>getstaticpresolvethemes() const;
636 // DocString: FMTmodel::swap_ptr
640 virtual void swap_ptr(const std::unique_ptr<FMTmodel>& rhs);
641 // DocString: FMTmodel::setupschedulesforbuild
647 std::vector<Core::FMTschedule>setupschedulesforbuild(const std::vector<Core::FMTschedule>& schedules) const;
648 // DocString: FMTmodel::useactionserie
652 bool useactionserie() const;
653 // DocString: FMTmodel::getseriesmaxsize
657 size_t getseriesmaxsize() const;
658 private:
659 // DocString: FMTmodel::save
663 friend class boost::serialization::access;
664 template<class Archive>
665 void save(Archive& ar, const unsigned int version) const
666 {
667 ar& boost::serialization::make_nvp("FMTobject", boost::serialization::base_object<FMTobject>(*this));
668 FMTobject::forcesave(ar, version);
669 ar& BOOST_SERIALIZATION_NVP(parameters);
670 ar& BOOST_SERIALIZATION_NVP(area);
671 ar& BOOST_SERIALIZATION_NVP(themes);
672 ar& BOOST_SERIALIZATION_NVP(actions);
673 ar& BOOST_SERIALIZATION_NVP(transitions);
674 ar& BOOST_SERIALIZATION_NVP(yields);
675 ar& BOOST_SERIALIZATION_NVP(lifespan);
676 ar& BOOST_SERIALIZATION_NVP(outputs);
677 ar& BOOST_SERIALIZATION_NVP(constraints);
678 ar& BOOST_SERIALIZATION_NVP(name);
679 }
680 // DocString: FMTmodel::load
684 template<class Archive>
685 void load(Archive& ar, const unsigned int version)
686 {
687 ar& boost::serialization::make_nvp("FMTobject", boost::serialization::base_object<FMTobject>(*this));
688 FMTobject::forceload(ar, version);//get the object information for the global object
689 ar& BOOST_SERIALIZATION_NVP(parameters);
690 ar& BOOST_SERIALIZATION_NVP(area);
691 ar& BOOST_SERIALIZATION_NVP(themes);
692 ar& BOOST_SERIALIZATION_NVP(actions);
693 ar& BOOST_SERIALIZATION_NVP(transitions);
694 ar& BOOST_SERIALIZATION_NVP(yields);
695 ar& BOOST_SERIALIZATION_NVP(lifespan);
696 ar& BOOST_SERIALIZATION_NVP(outputs);
697 ar& BOOST_SERIALIZATION_NVP(constraints);
698 ar& BOOST_SERIALIZATION_NVP(name);
699 //this->passinobject(*this);//Distribute global object to local object
700 }
701 BOOST_SERIALIZATION_SPLIT_MEMBER()
702 // DocString: FMTmodel::validatelistmasks
707 template<class T>
708 void validatelistmasks(const Core::FMTlist<T>& container) const
709 {
710 try {
711 for (const auto& listobject : container)
712 {
713 std::string name = std::string(listobject.first);
714 Core::FMTtheme::validate(themes, name);
715 }
716 }
717 catch (...)
718 {
719 _exhandler->raisefromcatch("", "FMTmodel::validatelistmasks", __LINE__, __FILE__);
720 }
721 }
722 // DocString: FMTmodel::validatelistspec
727 void validatelistspec(const Core::FMTspec& specifier) const;
728 // DocString: FMTmodel::aggregateActions
735 std::map<std::string, std::pair<std::string,Core::FMTmask>> aggregateActions(const std::vector<std::string>& p_ActionsMapping);
736 // DocString: FMTmodel::aggregateTransitions
741 void aggregateTransitions(const std::map<std::string, std::pair<std::string, Core::FMTmask>>& p_Filters);
742 // DocString: FMTmodel::aggregateOutputs
749 void aggregateOutputs(const std::map<std::string, std::pair<std::string, Core::FMTmask>>& p_Filters,
750 std::vector<Core::FMToutput*>& p_Outputs);
751 // DocString: FMTmodel::addNewMask
758 Core::FMTmask addNewMask(const Core::FMTmask& p_incompleteMask);
759
760
761
762 };
763// DocString: FMTmodelcomparator
768{
769 // DocString: FMTmodelcomparator::model_name
771 std::string model_name;
772public:
773 // DocString: FMTmodelcomparator(std::string)
777 FMTmodelcomparator(std::string name);
778 // DocString: FMTmodelcomparator::operator()
779 bool operator()(const FMTmodel& model) const;
780
781};
782
783}
784
785BOOST_CLASS_EXPORT_KEY(Models::FMTmodel)
786
787#endif // FMTMODEL_H_INCLUDED
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTaction.hpp:42
Definition: FMTlifespans.hpp:24
Definition: FMTmask.hpp:96
Definition: FMTmaskfilter.hpp:27
Definition: FMTobject.hpp:50
Definition: FMToutput.hpp:39
Definition: FMToutputnode.hpp:20
Definition: FMTschedule.hpp:31
Definition: FMTbounds.hpp:342
static bool validate(const std::vector< Core::FMTtheme > &themes, std::string &mask, std::string otherinformation=std::string())
Definition: FMTtransition.hpp:37
Definition: FMTyields.hpp:40
Definition: FMTgraph.hpp:78
Definition: FMTgraphvertextoyield.hpp:27
Definition: FMTlinegraph.hpp:30
Definition: FMTlogger.hpp:37
Definition: FMTmodel.hpp:60
Core::FMTmask getdynamicmask(const Core::FMToutput &output, bool ignoreoutputvariables=false) const
void setname(const std::string &newname)
virtual void clearcache()
std::vector< int > getcompresstime() const
Core::FMTyields yields
Yields data comming from the yield file.
Definition: FMTmodel.hpp:595
void setyields(const Core::FMTyields &lylds)
virtual Core::FMTschedule getsolution(int period, bool withlock=false) const
void addyieldhandlersfromptr(const std::vector< std::unique_ptr< Core::FMTyieldhandler > > &yieldhandlers)
void addyieldhandlers(const std::vector< T > &yieldhandlers)
Definition: FMTmodel.hpp:284
Core::FMTlifespans getlifespan() const
Definition: FMTmodel.hpp:233
static Core::FMTtransition defaultdeathtransition(const Core::FMTlifespans &llifespan, const std::vector< Core::FMTtheme > &lthemes)
std::vector< Core::FMTconstraint > constraints
Outputs comming from the optimization file.
Definition: FMTmodel.hpp:604
virtual bool setparameter(const FMTintmodelparameters &key, const int &value)
virtual void swap_ptr(const std::unique_ptr< FMTmodel > &rhs)
bool isstaticnode(const Core::FMToutputnode &node, double ratioofset=0.1) const
void push_back(const FMTmodel &rhs)
std::vector< size_t > statictransitionthemes
The location of the themes static from transitions.
Definition: FMTmodel.hpp:610
FMTmodel(const std::vector< Core::FMTactualdevelopment > &larea, const std::vector< Core::FMTtheme > &lthemes, const std::vector< Core::FMTaction > &lactions, const std::vector< Core::FMTtransition > &ltransitions, const Core::FMTyields &lyields, const Core::FMTlifespans &llifespan, const std::string &lname, const std::vector< Core::FMToutput > &loutputs, std::vector< Core::FMTconstraint > lconstraints=std::vector< Core::FMTconstraint >(), FMTmodelparameters lparameters=FMTmodelparameters())
FMTmodelstats getmodelstats() const
virtual void postsolve(const FMTmodel &originalbasemodel)
std::vector< Core::FMTconstraint > goalconstraints(double penalty=999999) const
bool empty() const
void setconstraints(const std::vector< Core::FMTconstraint > &lconstraint)
std::string getname() const
Definition: FMTmodel.hpp:193
FMTmodel(FMTmodel &&rhs)=default
Core::FMTmask getstaticmask(const Core::FMToutputnode &node, bool ignoreoutputvariables=false) const
void setarea(const std::vector< Core::FMTactualdevelopment > &ldevs)
std::vector< Core::FMTtheme > themes
Model themes of the landscape section file.
Definition: FMTmodel.hpp:586
std::vector< Core::FMToutput > getoutputs() const
Definition: FMTmodel.hpp:241
Core::FMTyields getyields() const
Definition: FMTmodel.hpp:225
virtual std::map< std::string, std::vector< std::vector< double > > > getoutputsfromperiods(const std::vector< Core::FMToutput > &theoutputs, const int &firstperiod, const int &lastperiod, Core::FMToutputlevel level=Core::FMToutputlevel::standard) const
virtual bool isoptimal() const
std::vector< Core::FMTschedule > setupschedulesforbuild(const std::vector< Core::FMTschedule > &schedules) const
Models::FMTmodel aggregateAllActions(const std::vector< std::string > &p_Aggregates) const
Aggregate actions together and create en enterly new model with new -actions,transitions,...
std::vector< Core::FMTtransition > gettransitions() const
Definition: FMTmodel.hpp:217
std::vector< Core::FMTtheme > locatestaticthemes(const Core::FMToutputnode &output, bool ignoreoutputvariables=false) const
virtual void showparameters(const bool &showhelp=false) const
std::vector< Core::FMTtransition > transitions
Model transitions from the transition file and also the _death transition.
Definition: FMTmodel.hpp:592
size_t getseriesmaxsize() const
std::vector< Core::FMTtheme > locatedynamicthemes(const Core::FMToutput &outpu, bool ignoreoutputvariables=false) const
std::vector< Core::FMToutput > outputs
Outputs comming from the ouput file.
Definition: FMTmodel.hpp:601
Core::FMTmaskfilter getpostsolvefilter(const std::vector< Core::FMTtheme > &originalthemes, const Core::FMTmask &devmask) const
virtual std::vector< Core::FMTconstraint > getreplanningconstraints(const std::string &modeltype, const std::vector< Core::FMTconstraint > &localconstraints, const int &period) const
virtual bool setparameter(const FMTboolmodelparameters &key, const bool &value)
void clearyieldcache()
std::vector< Core::FMTaction > getactions() const
Definition: FMTmodel.hpp:209
std::vector< Core::FMTtheme > getthemes() const
Definition: FMTmodel.hpp:201
void cleanactionsntransitions()
virtual std::vector< Core::FMTactualdevelopment > getarea(int period=0, bool beforegrowanddeath=false) const
virtual std::unique_ptr< FMTmodel > getcopy(int period=0) const
std::vector< Core::FMTactualdevelopment > area
Actualdevelopments for period 0, seen in the area section or the shapefile/raster.
Definition: FMTmodel.hpp:583
void setdefaultobjects()
bool setcompresstime(const int &periodstart, const int &periodstop, const int &value)
virtual std::unique_ptr< FMTmodel > clone() const
void setareaperiod(const int &period)
std::vector< Core::FMTtheme > getstaticpresolvethemes() const
virtual void setparallellogger(Logging::FMTlogger &logger)
void setlifespan(const Core::FMTlifespans &llifespan)
Core::FMTmask getdynamicmask(const Core::FMToutputnode &node, bool ignoreoutputvariables=false) const
void settransitions(const std::vector< Core::FMTtransition > &ltransitions)
void setoutputs(const std::vector< Core::FMToutput > &newoutputs)
std::vector< Core::FMTtheme > locatenodestaticthemes(const Core::FMToutputnode &node, bool ignoreoutputvariables=false, std::vector< Core::FMTtheme > basethemes=std::vector< Core::FMTtheme >()) const
std::vector< Core::FMTtheme > locatestaticthemes(const Core::FMToutput &output, bool ignoreoutputvariables=false) const
Core::FMTschedule presolveschedule(const Core::FMTschedule &originalbaseschedule, const FMTmodel &originalbasemodel) const
std::vector< size_t > getstatictransitionthemes() const
int getparameter(const FMTintmodelparameters &key) const
void clearactionscache()
std::vector< Core::FMTschedule > aggregateSchedules(const std::vector< Core::FMTschedule > &p_schedules) const
Build new schedule based on p_schedules with the corresponding aggregated actions.
void setactions(const std::vector< Core::FMTaction > &lactions)
virtual bool doplanning(const bool &solve, std::vector< Core::FMTschedule > schedules=std::vector< Core::FMTschedule >())
FMTmodel(const FMTmodel &rhs)
void addoutput(const std::string &name, const std::string &maskstring, Core::FMTotar outputtarget, std::string action=std::string(), std::string yield=std::string(), std::string description=std::string(), int targettheme=-1)
std::string name
The name of the Model (name of the .pri file without extension)
Definition: FMTmodel.hpp:607
Core::FMTlifespans lifespan
lifespan data comming from the lifespan file
Definition: FMTmodel.hpp:598
virtual bool solve()
Definition: FMTmodel.hpp:561
void cleartransitioncache()
virtual double getobjectivevalue() const
FMTmodel basepresolve() const
bool getparameter(const FMTboolmodelparameters &key) const
virtual std::unique_ptr< FMTmodel > presolve(std::vector< Core::FMTactualdevelopment > optionaldevelopments=std::vector< Core::FMTactualdevelopment >()) const
virtual ~FMTmodel()=default
static Core::FMTaction defaultdeathaction(const Core::FMTlifespans &llifespan, const std::vector< Core::FMTtheme > &lthemes)
double getinitialarea() const
Core::FMTschedule getpotentialschedule(std::vector< Core::FMTactualdevelopment > toremove, std::vector< Core::FMTactualdevelopment > selection, bool withlock=true) const
virtual bool setparameter(const FMTdblmodelparameters &key, const double &value)
FMTmodelparameters parameters
Definition: FMTmodel.hpp:580
std::vector< Core::FMTtheme > locatestatictransitionsthemes() const
void setthemes(const std::vector< Core::FMTtheme > &lthemes)
std::vector< Core::FMTconstraint > gettacticalconstraints(double penalty=999999, double scheduleweight=999999, double objective=0, double objectivefactor=1.0) const
Core::FMTmask getbasemask(std::vector< Core::FMTactualdevelopment > optionaldevelopments) const
Core::FMTmask getselectedmask(const std::vector< Core::FMTtheme > &originalthemes) const
Core::FMTmaskfilter getpresolvefilter(const std::vector< Core::FMTtheme > &originalthemes) const
bool useactionserie() const
std::vector< Core::FMTconstraint > getconstraints() const
Definition: FMTmodel.hpp:249
std::vector< Core::FMTaction > actions
Model actions from the action file and also the _death action.
Definition: FMTmodel.hpp:589
virtual std::map< std::string, double > getoutput(const Core::FMToutput &output, int period, Core::FMToutputlevel level=Core::FMToutputlevel::standard) const
virtual bool build(std::vector< Core::FMTschedule > schedules=std::vector< Core::FMTschedule >())
Definition: FMTmodel.hpp:552
double getparameter(const FMTdblmodelparameters &key) const
Definition: FMTmodel.hpp:768
FMTmodelcomparator(std::string name)
bool operator()(const FMTmodel &model) const
Definition: FMTmodelparameters.hpp:76
Definition: FMTmodelstats.hpp:24
Definition: FMTmodelparser.hpp:51
Definition: FMTspatialnodescache.hpp:33
Definition: FMTspatialschedule.hpp:44
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
FMToutputlevel
Definition: FMTutility.hpp:17
@ standard
Definition: FMTutility.hpp:18
FMTotar
Definition: FMTutility.hpp:74
Namespace for using/building unidirectional graphs in FMT.
Definition: FMTareaparser.hpp:31
Namespace containing all enumerator and classes used to construct or manipulate the different type of...
Definition: FMTareaparser.hpp:50
FMTdblmodelparameters
Definition: FMTmodelparameters.hpp:37
FMTintmodelparameters
Definition: FMTmodelparameters.hpp:24
FMTboolmodelparameters
Definition: FMTmodelparameters.hpp:45
Namespace handling all FMT's parsers. Everything related to I/O should be located in this namespace.
Definition: FMTactionparser.hpp:26
The spatial namespace provides classes for spatialy explicit simulation/optimization based on raster ...
Definition: FMTareaparser.hpp:36