FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTyieldmodeldecisiontree.hpp
Go to the documentation of this file.
1
2#include "FMTyieldmodel.hpp"
3#include <vector>
4#include <string>
5#include <memory>
6#include <boost/thread/recursive_mutex.hpp>
7
8#ifndef FMTYIELDMODELDECISIONTREE_H_INCLUDED
9#define FMTYIELDMODELDECISIONTREE_H_INCLUDED
10
11namespace Models
12{
13 class FMTmodel;
14}
15
16namespace Core
17{
18 class FMTmask;
19 class FMTconstraint;
20 class FMToutput;
21 // DocString: FMTyieldmodeldecisiontree
26 {
27 // DocString: FMTyieldmodeldecisiontree::mtx
29 //mutable std::recursive_mutex mtx;
30 mutable boost::recursive_mutex mtx;
31 // DocString: FMTyieldmodeldecisiontree::values
33 mutable std::map<size_t,std::vector<double>>values;
34 // DocString: FMTyieldmodeldecisiontree::reference
36 std::unique_ptr<FMToutput> reference;
37 // DocString: FMTyieldmodeldecisiontree::nodes
39 std::vector<FMTconstraint>nodes;
40 // DocString: FMTyieldmodeldecisiontree::default_values
42 std::vector<double>default_values;
43 // DocString: FMTyieldmodeldecisiontree::JSON_PROP_TREE
45 const std::string JSON_PROP_TREE = "Tree";
46 // DocString: FMTyieldmodeldecisiontree::JSON_PROP_DECISIONS
48 const std::string JSON_PROP_DECISIONS = "Decisions";
49 // DocString: FMTyieldmodeldecisiontree::JSON_PROP_REFERENCE
51 const std::string JSON_PROP_REFERENCE = "Reference";
52 // DocString: FMTyieldmodeldecisiontree::JSON_PROP_DEFAULT
54 const std::string JSON_PROP_DEFAULT = "Default";
55 // DocString: FMTyieldmodeldecisiontree::GetMask
59 Core::FMTmask GetMask() const;
60 // DocString: FMTyieldmodeldecisiontree::buildconstraint
69 Core::FMTconstraint BuildConstraint(const std::string& name, const std::string& yld, const Core::FMTmask& mask, const double& lowerbound, const double& upperbound,const int& lag) const;
70 // DocString: FMTyieldmodeldecisiontree::getadecision
74 size_t GetADecision(const std::unique_ptr<Models::FMTmodel>& naturalgrowth,const size_t& constraint_id, const int& period/*, std::string& decision_stack*/) const;
75 // DocString: FMTyieldmodeldecisiontree::getnaturalgrowth
80 std::unique_ptr<Models::FMTmodel> GetNaturalGrowth(const Core::FMTyieldrequest& request) const;
81 // DocString: FMTyieldmodeldecisiontree::modify
85 std::unique_ptr<FMTyieldmodel> Modify(const FMTmaskfilter& filter,
86 const std::vector<FMTtheme>& newthemes,bool presolve = true) const;
87 public:
88 // DocString: FMTyieldmodeldecisiontree::FMTyieldmodeldecisiontree()
93 // DocString: FMTyieldmodeldecisiontree::FMTyieldmodeldecisiontree(const FMTyieldmodeldecisiontree& rhs)
98 // DocString: FMTyieldmodeldecisiontree::operator = (const FMTyieldmodeldecisiontree& rhs)
103 // DocString: FMTyieldmodeldecisiontree::~FMTyieldmodeldecisiontree()
108 // DocString: FMTyieldmodeldecisiontree::FMTyieldmodeldecisiontree(const boost::property_tree::ptree& jsonProps, std::vector<std::string>& inputYields)
112 FMTyieldmodeldecisiontree(const boost::property_tree::ptree& jsonProps,const std::vector<std::string>& inputYields,const Core::FMTmask& mainmask);
113 // DocString: FMTyieldmodeldecisiontree::Clone()
117 std::unique_ptr<FMTyieldmodel>Clone() const;
118 // DocString: FMTyieldmodeldecisiontree::Predict
123 const std::vector<double>Predict(const Core::FMTyieldrequest& request) const;
124 // DocString: FMTyieldmodeldecisiontree::GetModelType()
128 static std::string GetModelType();
129 // DocString: FMTyieldmodeldecisiontree::presolve
133 virtual std::unique_ptr<FMTyieldmodel> presolve(const FMTmaskfilter& filter,
134 const std::vector<FMTtheme>& newthemes) const;
135 // DocString: FMTyieldmodeldecisiontree::postsolve
139 virtual std::unique_ptr<FMTyieldmodel> postsolve(const FMTmaskfilter& filter,
140 const std::vector<FMTtheme>& basethemes) const;
141 // DocString: FMTyieldmodeldecisiontreel::std::string()
145 virtual operator std::string() const;
146 // DocString: FMTyieldmodeldecisiontreel::getperiodicvalues
151 virtual std::vector<std::vector<double>>getperiodicvalues() const;
152 };
153}
154
155#endif
Definition: FMTconstraint.hpp:54
Definition: FMTmask.hpp:96
Definition: FMTmaskfilter.hpp:27
Definition: FMTyieldmodel.hpp:41
Definition: FMTyieldmodeldecisiontree.hpp:26
virtual std::unique_ptr< FMTyieldmodel > presolve(const FMTmaskfilter &filter, const std::vector< FMTtheme > &newthemes) const
const std::vector< double > Predict(const Core::FMTyieldrequest &request) const
virtual std::unique_ptr< FMTyieldmodel > postsolve(const FMTmaskfilter &filter, const std::vector< FMTtheme > &basethemes) const
FMTyieldmodeldecisiontree(const FMTyieldmodeldecisiontree &rhs)
FMTyieldmodeldecisiontree & operator=(const FMTyieldmodeldecisiontree &rhs)=default
virtual std::vector< std::vector< double > > getperiodicvalues() const
static std::string GetModelType()
std::unique_ptr< FMTyieldmodel > Clone() const
FMTyieldmodeldecisiontree(const boost::property_tree::ptree &jsonProps, const std::vector< std::string > &inputYields, const Core::FMTmask &mainmask)
Definition: FMTyieldrequest.hpp:36
Definition: FMTyieldmodel.hpp:26
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
Namespace containing all enumerator and classes used to construct or manipulate the different type of...
Definition: FMTareaparser.hpp:50