FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTcomplexyieldhandler.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 FMTCOMPLEXYIELDHANDLER_H_INCLUDED
9#define FMTCOMPLEXYIELDHANDLER_H_INCLUDED
10
11#include "FMTyieldhandler.hpp"
12#include "FMTdata.hpp"
13#include <string>
14#include <boost/serialization/serialization.hpp>
15#include <boost/serialization/nvp.hpp>
16#include <memory>
17
18namespace Core
19{
21 {
22 friend class boost::serialization::access;
23 template<class Archive>
24 void serialize(Archive& ar, const unsigned int version)
25 {
26 ar & boost::serialization::make_nvp("FMTyieldhandler", boost::serialization::base_object<FMTyieldhandler>(*this));
27 ar & BOOST_SERIALIZATION_NVP(elements);
28 }
29 std::map<std::string, FMTdata>elements;
30 std::map<std::string, double> getsources(const std::map<std::string, const std::unique_ptr<FMTyieldhandler>*>& srcdata,
31 const FMTyieldrequest& request, bool& age_only) const;
32 std::map<std::string, const std::unique_ptr<FMTyieldhandler>*> getdata(const FMTyieldrequest& request,
33 const std::vector<std::string>& names, const std::string& original) const;
34 std::vector<double>getsourcesarray(const std::map<std::string, const std::unique_ptr<FMTyieldhandler>*>& srcdata,
35 const FMTyieldrequest& request, bool& age_only) const;
36 std::unique_ptr<FMTyieldhandler>toageyld(const FMTyieldrequest& request,
37 const std::vector<std::string>& yieldnames, const int& minage, const int& maxage) const;
38 std::unordered_set<size_t>overridetabou;
39 size_t overrideindex;
40 public:
41 void settabou(const size_t& index);
43 std::vector<size_t>gettabous() const override;
44 virtual void setoverrideindex(const size_t& newindex);
45 virtual size_t getoverrideindex() const;
46 virtual int getlastbase() const;
47 virtual double get(const std::string& yld, const FMTyieldrequest& request) const;
48 bool comparesources(const std::string& yield,const FMTcomplexyieldhandler& overridedyield) const;
49 virtual operator std::string() const;
53 FMTcomplexyieldhandler& operator = (const FMTcomplexyieldhandler& rhs) = default;
55 const std::map<std::string, FMTdata>& getdataelements() const;
56 virtual std::vector<std::string> indexes(const std::vector<std::string>& names) const;
57 virtual double getpeak(const FMTyieldrequest& request, const std::string& yld, const int& targetage) const;
58 std::unique_ptr<FMTyieldhandler>complexyldtoageyld(const FMTyieldrequest& request, const FMTspec& lspec) const;
59 virtual bool push_data(const std::string& yld, const double& value);
60 virtual bool push_data(const std::string& yld, const FMTdata& data);
61 virtual std::unique_ptr<FMTyieldhandler>clone() const;
62 virtual bool operator == (const FMTcomplexyieldhandler& rhs) const;
63 virtual bool empty() const;
64 virtual size_t size() const;
65 virtual FMTyldtype gettype() const;
66 virtual FMTdata& operator[](const std::string& yldname);
67 virtual const FMTdata& at(const std::string& yldname) const;
68 virtual bool containsyield(const std::string& yldname) const;
69 virtual std::vector<std::string>getyieldnames() const;
70 virtual void clearcache();
71 virtual int getage(const FMTyieldrequest& request, const FMTspec& spec) const;
72 virtual double getyieldlinearvalue(const std::string& yldname, const FMTyieldrequest& request, bool allowoutofrange=true) const;
73 };
74
75}
76
77#endif
78
79
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTcomplexyieldhandler.hpp:21
virtual double getyieldlinearvalue(const std::string &yldname, const FMTyieldrequest &request, bool allowoutofrange=true) const
virtual void setoverrideindex(const size_t &newindex)
void settabou(const FMTcomplexyieldhandler &rhs)
virtual double get(const std::string &yld, const FMTyieldrequest &request) const
std::unique_ptr< FMTyieldhandler > complexyldtoageyld(const FMTyieldrequest &request, const FMTspec &lspec) const
FMTcomplexyieldhandler(const FMTcomplexyieldhandler &rhs)=default
virtual const FMTdata & at(const std::string &yldname) const
virtual bool empty() const
FMTcomplexyieldhandler(const FMTmask &mask)
virtual double getpeak(const FMTyieldrequest &request, const std::string &yld, const int &targetage) const
virtual int getage(const FMTyieldrequest &request, const FMTspec &spec) const
const std::map< std::string, FMTdata > & getdataelements() const
virtual std::unique_ptr< FMTyieldhandler > clone() const
virtual FMTdata & operator[](const std::string &yldname)
virtual FMTyldtype gettype() const
virtual int getlastbase() const
virtual bool push_data(const std::string &yld, const FMTdata &data)
virtual size_t getoverrideindex() const
std::vector< size_t > gettabous() const override
virtual std::vector< std::string > indexes(const std::vector< std::string > &names) const
virtual size_t size() const
virtual bool containsyield(const std::string &yldname) const
bool comparesources(const std::string &yield, const FMTcomplexyieldhandler &overridedyield) const
virtual std::vector< std::string > getyieldnames() const
virtual bool push_data(const std::string &yld, const double &value)
void settabou(const size_t &index)
Definition: FMTdata.hpp:32
Definition: FMTmask.hpp:96
Definition: FMTbounds.hpp:342
Definition: FMTyieldhandler.hpp:31
Definition: FMTyieldrequest.hpp:36
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
FMTyldtype
Definition: FMTutility.hpp:45