10#ifndef FMToperatingareascheme_H_INCLUDED
11#define FMToperatingareascheme_H_INCLUDED
17#include <boost/serialization/serialization.hpp>
18#include <boost/serialization/nvp.hpp>
19#include <boost/serialization/export.hpp>
49 friend class boost::serialization::access;
50 template<
class Archive>
51 void serialize(Archive& ar,
const unsigned int version)
53 ar & boost::serialization::make_nvp(
"operatingarea", boost::serialization::base_object<FMToperatingarea>(*
this));
54 ar & BOOST_SERIALIZATION_NVP(openingconstraints);
55 ar & BOOST_SERIALIZATION_NVP(openingbinaries);
56 ar & BOOST_SERIALIZATION_NVP(maximalschemesconstraint);
57 ar & BOOST_SERIALIZATION_NVP(schemesperiods);
58 ar & BOOST_SERIALIZATION_NVP(openingtime);
59 ar & BOOST_SERIALIZATION_NVP(returntime);
60 ar & BOOST_SERIALIZATION_NVP(repetition);
61 ar & BOOST_SERIALIZATION_NVP(greenup);
65 std::vector<std::vector<int>>openingconstraints;
68 std::vector<int>openingbinaries;
71 int maximalschemesconstraint;
74 std::vector<std::vector<int>>schemesperiods;
89 size_t startingperiod;
111 size_t getbestschemeid(
const double* primalsolution)
const;
133 const double* primalsolution,
154 double getrowsactivitysum(
const std::vector<int>& rows,
const double* dualsolution)
const;
159 bool isthresholdactivityrows(
const std::vector<int>& rows,
const double* dualsolution)
const;
166 std::vector<double>fillpattern(
const std::vector<double>& pattern,
const int& startat)
const;
171 void closenoactivity(std::vector<double>& filleduppattern,
const size_t& selected,
const double* dualsolution)
const;
176 int getmaxperiod()
const;
182 void setreturntime(
const size_t& minimalreturntime,
const size_t& maximalreturntime);
296 std::vector<size_t>
getpotentialprimalschemes(
const double* primalsolution,
const double* lowerbounds,
const double* upperbounds,
const std::vector<FMToperatingareascheme>& neighbors)
const;
303 std::vector<size_t>
getpotentialdualschemes(
const double* dualsolution,
const double* upperbound,
const std::vector<FMToperatingareascheme>& neighbors)
const;
339 bool boundprimalscheme(std::vector<int>& targets, std::vector<double>& bounds,
const size_t& schemeid)
const;
345 bool unbounddualscheme(
const double* rowactivities, std::vector<int>& targets, std::vector<double>& bounds,
const size_t& schemeid,
bool looseset=
true)
const;
357 std::vector<double>
getdualsolution(
const double* upperbounds,
const double* dualsolution,
bool& canbreakneighboring)
const;
372 const double* primalsolution,
373 const std::vector<int>& actionIDS);
382 const size_t& lrepetition,
const size_t& lgreenup,
const size_t& lstartingperiod,
double minimalarearatio=0.0);
402 void fillboundsnvariables(
const double* lowerb,
const double* upperb, std::vector<int>& constraintstargets,std::vector<double>&bounds)
const;
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTmask.hpp:96
Definition: FMTgraph.hpp:78
boost::graph_traits< FMTadjacency_list >::vertex_descriptor FMTvertex_descriptor
Definition: FMTgraph.hpp:110
Definition: FMToperatingarea.hpp:29
Definition: FMToperatingareascheme.hpp:44
std::vector< size_t > getpotentialprimalschemes(const double *primalsolution, const double *lowerbounds, const double *upperbounds, const std::vector< FMToperatingareascheme > &neighbors) const
~FMToperatingareascheme()=default
size_t unboundalldualschemes(std::vector< int > &targets, std::vector< double > &bounds) const
const std::vector< std::vector< int > > & getopeningconstraints() const
const std::vector< int > & getopeningbinaries() const
FMToperatingareascheme(const FMToperatingarea &oparea, const size_t &lopeningtime, const size_t &lreturntime, const size_t &lmaxreturntime, const size_t &lrepetition, const size_t &lgreenup, const size_t &lstartingperiod, double minimalarearatio=0.0)
const size_t & getgreenup() const
Definition: FMToperatingareascheme.hpp:450
bool isallprimalbounded(const double *lowerbounds, const double *upperbounds) const
void setreturntime(const size_t &minimalreturntime, const size_t &maximalreturntime)
size_t getrepetition() const
FMToperatingareascheme()=default
std::vector< double > getprimalsolution(const double *primalsolution) const
void getressourcestodelete(std::vector< int > &colstodelete, std::vector< int > &rowstodelete) const
bool haveactivitysolution(const double *dualsolution) const
size_t getstartingperiod() const
void setconstraints(const std::vector< std::vector< Graph::FMTgraph< Graph::FMTvertexproperties, Graph::FMTedgeproperties >::FMTvertex_descriptor > > &verticies, const std::vector< Graph::FMTgraph< Graph::FMTvertexproperties, Graph::FMTedgeproperties >::FMTvertex_descriptor > &totalareaverticies, const Graph::FMTgraph< Graph::FMTvertexproperties, Graph::FMTedgeproperties > &graph, Models::FMTlpsolver &solver, const double *primalsolution, const std::vector< int > &actionIDS)
std::vector< double > getdualsolution(const double *upperbounds, const double *dualsolution, bool &canbreakneighboring) const
std::vector< size_t > getpotentialdualschemes(const double *dualsolution, const double *upperbound, const std::vector< FMToperatingareascheme > &neighbors) const
size_t getopeningtime() const
size_t boundallprimalschemes(std::vector< int > &targets, std::vector< double > &bounds, double boundvalue=1.0) const
bool getdualsolutionindex(const double *upperbound, size_t &locid) const
bool isalldualbounded(const double *upperbounds) const
void fillboundsnvariables(const double *lowerb, const double *upperb, std::vector< int > &constraintstargets, std::vector< double > &bounds) const
const int & getrejectednodescid() const
bool isprimalbounded(const double *lowerbounds, const double *upperbounds) const
FMToperatingareascheme presolve(const Core::FMTmask &selectedmask, const std::vector< Core::FMTtheme > &presolvedthemes) const
size_t getmaximalreturntime() const
bool isdualbounded(const double *upperbounds) const
size_t unboundallprimalschemes(std::vector< int > &targets, std::vector< double > &bounds) const
void pushbinaries(std::vector< int > &targets) const
size_t getnumberofsimplescheme() const
bool havepotentialsolution(const double *primalsolution) const
size_t getminimalreturntime() const
size_t boundalldualschemes(std::vector< int > &targets, std::vector< double > &bounds) const
double getbinariessum(const double *primalsolution) const
std::map< int, std::vector< int > > getcommonbinairies(const FMToperatingareascheme &neighbor) const
bool isthresholdactivity(const double *dualsolution) const
const int & getmaximalschemesconstraint() const
size_t getnumberofscheme() const
size_t getprimalsolutionindex(const double *primalsolution) const
std::vector< double > getduallowerbounds(const double *lowerbounds, const double *upperbounds) const
FMToperatingareascheme(const FMToperatingareascheme &rhs)=default
double getthreshold() const
double getactivitysum(const double *dualsolution) const
bool boundprimalscheme(std::vector< int > &targets, std::vector< double > &bounds, const size_t &schemeid) const
bool unbounddualscheme(const double *rowactivities, std::vector< int > &targets, std::vector< double > &bounds, const size_t &schemeid, bool looseset=true) const
Definition: FMToperatingareascheme.hpp:459
bool operator()(const FMToperatingareascheme &oparea) const
FMToperatingareaschemecomparator(const Core::FMTmask &lmask)
Definition: FMTlpsolver.hpp:39
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
Namespace regrouping all tools for solving LP/MIP problems using an heuristic.
Definition: FMTareaparser.hpp:43
Namespace containing all enumerator and classes used to construct or manipulate the different type of...
Definition: FMTareaparser.hpp:50