8#ifndef FMTconstraint_H_INCLUDED
9#define FMTconstraint_H_INCLUDED
16#include <boost/serialization/serialization.hpp>
17#include <boost/serialization/nvp.hpp>
18#include <boost/serialization/export.hpp>
59 friend class boost::serialization::access;
60 template<
class Archive>
61 void serialize(Archive& ar,
const unsigned int version)
63 ar & boost::serialization::make_nvp(
"output", boost::serialization::base_object<FMToutput>(*
this));
64 ar & boost::serialization::make_nvp(
"specification", boost::serialization::base_object<FMTspec>(*
this));
65 ar & BOOST_SERIALIZATION_NVP(type);
74 void standardstring(std::string& line, std::string& period_bounds, std::string& goal, std::string& global)
const;
79 void getmaxandmin(
const std::vector<double>& values,
double& min,
double& max)
const;
84 double getsum(
const std::vector<double>& values)
const;
89 double getperiodicvariationcost(
const std::vector<double>& values,
bool evaluateupper=
false)
const;
94 double getvariability(
const std::vector<double>& values,
const double& var,
const double& lowarvar)
const;
190 void getgoal(std::string& name,
double& value)
const;
195 void setgoal(
const std::string& goalname,
const double& value);
200 void setpenalties(
const std::string& penaltyoperator,
const std::vector<std::string>& variables);
217 void getbounds(
double& lower,
double& upper,
int period = 0)
const;
227 void setlength(
int firstperiod = 1,
int lastperiod = std::numeric_limits<int>::max());
247 size_t hash(
bool hashrhs =
true,
bool hashoutputonly =
false)
const;
272 operator std::string()
const;
300 const std::vector<FMTtheme>& originalthemes,
301 const std::vector<FMTtheme>& selectedthemes,
302 const std::vector<FMTtheme>& newthemes,
303 const std::vector<FMTaction>& actions,
const FMTyields& yields)
const;
314 double evaluate(
const std::vector<double>& temporalvalues)
const;
319 std::vector<int>
getactionids(
const std::vector<Core::FMTaction>& actions)
const;
324 std::vector<bool>
isactionsused(
const std::vector<Core::FMTaction>& actions)
const;
335 const std::vector<Core::FMTtransition>& trans,
336 std::vector<Core::FMTaction>&actions,
338 const int& constraintid)
const;
352 std::vector<Core::FMTaction>&actions,
354 const int& constraintid)
const;
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTconstraint.hpp:54
void setgoal(const std::string &goalname, const double &value)
std::vector< int > getactionids(const std::vector< Core::FMTaction > &actions) const
bool dosupportrandom() const
void setlength(int firstperiod=1, int lastperiod=std::numeric_limits< int >::max())
bool isreignore(const int &replanningperiod) const
void setpenalties(const std::string &penaltyoperator, const std::vector< std::string > &variables)
size_t hash(bool hashrhs=true, bool hashoutputonly=false) const
void getgoal(std::string &name, double &value) const
void turntoyieldsbasedontransition(const std::vector< Core::FMTtheme > &themes, const std::vector< Core::FMTtransition > &trans, std::vector< Core::FMTaction > &actions, Core::FMTyields &yields, const int &constraintid) const
bool issetfrom(const std::string &modeltype) const
FMTconstraint(FMTconstrainttype ltype, const FMToutput &loutput)
void setoutput(const FMToutput &out)
bool canbeturnedtoyields() const
std::vector< std::string > getpenalties(double &sense) const
size_t outputempty() const
void turntoyieldsandactions(const std::vector< Core::FMTtheme > &themes, std::vector< Core::FMTaction > &actions, Core::FMTyields &yields, const int &constraintid) const
double evaluate(const std::vector< double > &temporalvalues) const
void setrhs(double lower, double upper)
bool extravariables() const
bool canbeturnedtoyieldsbasedontransitions() const
Core::FMTconstraint getfromreplicate(const size_t &replicate, const int &period) const
void getvariations(double &lower, double &upper) const
bool acrossperiod() const
double getscheduleweight() const
FMTconstraint(const FMTconstraint &rhs)
Core::FMTconstraint setfrom(const std::string &modeltype, const double &value) const
bool israndomaction() const
size_t hashasoutput() const
void setconstrainttype(FMTconstrainttype ltype)
void getbounds(double &lower, double &upper, int period=0) const
FMTconstrainttype getconstrainttype() const
std::vector< std::string > getvariablelevels() const
std::vector< bool > isactionsused(const std::vector< Core::FMTaction > &actions) const
FMTconstraint presolve(const FMTmaskfilter &filter, const std::vector< FMTtheme > &originalthemes, const std::vector< FMTtheme > &selectedthemes, const std::vector< FMTtheme > &newthemes, const std::vector< FMTaction > &actions, const FMTyields &yields) const
Core::FMTconstraint getiterationchange(const std::vector< double > &periodchanges, const int &targetperiod) const
Definition: FMTmaskfilter.hpp:27
Definition: FMToutput.hpp:39
Definition: FMTbounds.hpp:342
Definition: FMTyields.hpp:40
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
FMTconstrainttype
Definition: FMTconstraint.hpp:32
@ FMTsequence
Definition: FMTconstraint.hpp:39
@ FMTspatialadjacency
Definition: FMTconstraint.hpp:42
@ FMTrandomaction
Definition: FMTconstraint.hpp:44
@ FMTstandard
Definition: FMTconstraint.hpp:40
@ FMTMINMAXobjective
Definition: FMTconstraint.hpp:36
@ FMTnondeclining
Definition: FMTconstraint.hpp:38
@ FMTMAXMINobjective
Definition: FMTconstraint.hpp:35
@ FMTspatialsize
Regular constraint type like output = 1...
Definition: FMTconstraint.hpp:41
@ FMTMAXobjective
Definition: FMTconstraint.hpp:33
@ FMTMINobjective
Definition: FMTconstraint.hpp:34
@ FMTevenflow
Definition: FMTconstraint.hpp:37
@ FMTspatialgreenup
Definition: FMTconstraint.hpp:43