FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTageyieldhandler.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 FMTAGEYIELDHANDLER_H_INCLUDED
9#define FMTAGEYIELDHANDLER_H_INCLUDED
10
11#include "FMTyieldhandler.hpp"
12#include <string>
13#include <boost/serialization/serialization.hpp>
14#include <boost/serialization/nvp.hpp>
15#include "FMTdata.hpp"
16
17namespace Core
18{
20 {
21 friend class boost::serialization::access;
22 template<class Archive>
23 void serialize(Archive& ar, const unsigned int version)
24 {
25 ar& boost::serialization::make_nvp("FMTyieldhandler", boost::serialization::base_object<FMTyieldhandler>(*this));
26 ar& BOOST_SERIALIZATION_NVP(elements);
27 }
28 std::map<std::string, FMTdata>elements;
29 int getage(const std::string yld, const double& value, const int& starting_age) const;
30 public:
31 virtual double get(const std::string& yld, const FMTyieldrequest& request) const;
32 virtual operator std::string() const;
34 FMTageyieldhandler() = default;
36 FMTageyieldhandler& operator = (const FMTageyieldhandler& rhs) = default;
38 // DocString: FMTageyieldhandler(const FMTmask&)
43 // DocString: FMTageyieldhandler::setyieldvalues
48 virtual void setyieldvalues(const std::string& yldname,const std::vector<int>& baseages,const std::vector<double>& values);
49 virtual double getlastvalue(const std::string yld) const;
50 virtual bool push_data(const std::string& yld, const double& value);
51 virtual bool push_data(const std::string& yld, const FMTdata& data);
52 virtual std::unique_ptr<FMTyieldhandler>clone() const;
53 virtual bool operator == (const FMTageyieldhandler& rhs) const;
54 virtual bool empty() const;
55 virtual size_t size() const;
56 virtual FMTyldtype gettype() const;
57 virtual FMTdata& operator[](const std::string& yldname);
58 virtual const FMTdata& at(const std::string& yldname) const;
59 virtual bool containsyield(const std::string& yldname) const;
60 virtual std::vector<std::string>getyieldnames() const;
61 virtual void clearcache();
62 virtual std::map<std::string, std::vector<double>>getallyieldsdata(const int& maxbase)const;
63 virtual std::unique_ptr<FMTyieldhandler> getfromfactor(const double& factor,
64 std::vector<std::string>yieldnames = std::vector<std::string>()) const;
65 virtual int getendpoint(const std::string& yld, const int& lowerstep, const double& bound, const double& value) const;
66 virtual double getpeak(const FMTyieldrequest& request,const std::string& yld, const int& targetage) const;
67 virtual double getpeakfrom(const std::string& yld, double maxvalue = std::numeric_limits<double>::lowest()) const;
68 virtual int getage(const FMTyieldrequest& request, const FMTspec& spec) const;
69 virtual double getyieldlinearvalue(const std::string&yldname, const FMTyieldrequest& request, bool allowoutofrange=true) const;
70 };
71
72}
73
74#endif
75
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTageyieldhandler.hpp:20
virtual FMTdata & operator[](const std::string &yldname)
virtual std::map< std::string, std::vector< double > > getallyieldsdata(const int &maxbase) const
virtual std::unique_ptr< FMTyieldhandler > getfromfactor(const double &factor, std::vector< std::string >yieldnames=std::vector< std::string >()) const
FMTageyieldhandler(const FMTmask &mask)
virtual double getpeakfrom(const std::string &yld, double maxvalue=std::numeric_limits< double >::lowest()) const
virtual bool containsyield(const std::string &yldname) const
virtual bool push_data(const std::string &yld, const double &value)
virtual double getpeak(const FMTyieldrequest &request, const std::string &yld, const int &targetage) const
virtual bool push_data(const std::string &yld, const FMTdata &data)
virtual int getendpoint(const std::string &yld, const int &lowerstep, const double &bound, const double &value) const
virtual int getage(const FMTyieldrequest &request, const FMTspec &spec) const
virtual const FMTdata & at(const std::string &yldname) const
virtual void setyieldvalues(const std::string &yldname, const std::vector< int > &baseages, const std::vector< double > &values)
virtual double getlastvalue(const std::string yld) const
virtual size_t size() const
virtual void clearcache()
virtual FMTyldtype gettype() const
virtual double get(const std::string &yld, const FMTyieldrequest &request) const
virtual std::vector< std::string > getyieldnames() const
virtual std::unique_ptr< FMTyieldhandler > clone() const
virtual bool empty() const
virtual double getyieldlinearvalue(const std::string &yldname, const FMTyieldrequest &request, bool allowoutofrange=true) const
FMTageyieldhandler(const FMTyieldhandler &rhs)
FMTageyieldhandler(const FMTageyieldhandler &rhs)=default
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