10#ifndef FMToperatingareascheduler_H_INCLUDED
11#define FMToperatingareascheduler_H_INCLUDED
25#include <boost/serialization/serialization.hpp>
26#include <boost/serialization/nvp.hpp>
27#include <boost/serialization/export.hpp>
32 template<
class T1,
class T2>
44 class FMTtimeyieldhandler;
68 friend class boost::serialization::access;
69 template<
class Archive>
70 void serialize(Archive& ar,
const unsigned int version)
72 ar & boost::serialization::make_nvp(
"lpsolve", boost::serialization::base_object<FMTlpheuristic>(*
this));
73 ar & BOOST_SERIALIZATION_NVP(operatingareas);
74 ar & BOOST_SERIALIZATION_NVP(adjacencyconstraints);
75 ar & BOOST_SERIALIZATION_NVP(proportionofset);
76 ar & BOOST_SERIALIZATION_NVP(userandomness);
77 ar & BOOST_SERIALIZATION_NVP(useprimal);
81 std::vector<FMToperatingareascheme>operatingareas;
84 std::map<std::pair<Core::FMTmask, Core::FMTmask>, std::vector<int>>adjacencyconstraints;
87 double proportionofset;
109 bool setadjacencyconstraints();
116 std::vector<std::vector<FMToperatingareascheme>::const_iterator> setdraw();
123 std::vector<std::vector<FMToperatingareascheme>::const_iterator> draw(std::vector<std::vector<FMToperatingareascheme>::const_iterator>& oparea);
130 size_t setbounds(
const std::vector<std::vector<FMToperatingareascheme>::const_iterator>& tobound,
const std::vector<int>& schemestoskip=std::vector<int>(),
bool keeploose=
true);
135 size_t selectscheme(std::vector<size_t>& potentialschemes,
const int& schemetoskip)
const;
141 bool getbounds(
const std::vector<FMToperatingareascheme>::const_iterator& operatingareaiterator,
142 std::vector<int>& targeteditems,std::vector<double>& bounds,
const bool& boundall,
const size_t& schemeid=0,
bool keeploose=
true)
const;
148 void unboundall(
bool atprimal =
false);
154 void unbound(
const std::vector<std::vector<FMToperatingareascheme>::const_iterator>& tounbound,
bool atprimal =
false);
159 void closeprimalbounds();
166 void setallinteger();
178 void clearrowcache();
183 std::vector<int> getsolutionindexes(
const std::vector<std::vector<FMToperatingareascheme>::const_iterator>& opareaits)
const;
188 std::string getthreadid()
const;
196 bool completeinitialsolution();
201 bool gotrejectednodes()
const;
207 void resetbasegreedysolution(
const std::vector<std::vector<FMToperatingareascheme>::const_iterator>& selected,
208 const std::vector<int>& oldschemeid,
209 const std::vector<int>& oldconstraints,
210 const std::vector<double>& oldbounds);
217 bool releasegreedysolution(
const std::vector<std::vector<FMToperatingareascheme>::const_iterator>& selected,
218 std::vector<int>& oldconstraints,
219 std::vector<double>& oldbounds);
225 bool greedymovesolution(
const std::vector<std::vector<FMToperatingareascheme>::const_iterator>& selected,
226 const std::vector<int>& oldschemeid);
232 void setfordualinitialsolve();
237 int initialmovesolution(
const std::vector<std::vector<FMToperatingareascheme>::const_iterator>& selected);
243 void resetbaseinitialsolution();
268 bool branchnboundsolve() final;
273 bool greedypass(const
double& initsol, const
unsigned int& iteration) final;
288 void setproportionofset(const
double& proportion);
297 std::vector<
Core::FMTtimeyieldhandler> getsolution( const std::
string& yldname) const;
303 std::vector<
Core::FMToutput>getlevelsolution(const std::
string& outputname,const std::
string& aggregate,
int outputid) const;
313 const
Graph::FMTgraph<
Graph::FMTvertexproperties,
Graph::FMTedgeproperties>& maingraph,
314 const
Models::FMTmodel& model,
315 const
Core::FMToutputnode& target,
316 Models::FMTlpsolver& basesolve,
size_t lseed = 0,
317 double proportionofset = 0.25,
bool userandomness = false,
bool copysolver = true);
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMToutputnode.hpp:20
Definition: FMTgraph.hpp:78
Definition: FMTlpheuristic.hpp:40
Definition: FMToperatingareascheduler.hpp:63
bool initialsolve() final
double generateinitialproportionofset() const
Definition: FMToperatingareascheme.hpp:44
Definition: FMTmodel.hpp:60
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
Namespace for using/building unidirectional graphs in FMT.
Definition: FMTareaparser.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