FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTlpheuristic.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#ifdef FMTWITHOSI
9
10#ifndef FMTlpheuristic_H_INCLUDED
11#define FMTlpheuristic_H_INCLUDED
12
13
14#include "FMTlpsolver.hpp"
15#include <random>
16#include <memory>
17#include <map>
18#include <vector>
19#include <chrono>
20#include <boost/serialization/serialization.hpp>
21#include <boost/serialization/nvp.hpp>
22#include <boost/serialization/export.hpp>
24
26namespace Heuristics
27{
28 // DocString: FMTlpheuristic
40 {
41 // DocString: FMTlpheuristic::save
45 friend class boost::serialization::access;
46 template<class Archive>
47 void save(Archive& ar, const unsigned int version) const
48 {
49 ar & boost::serialization::make_nvp("lpsolve", boost::serialization::base_object<FMTlpsolver>(*this));
50 ar & BOOST_SERIALIZATION_NVP(seed);
51 ar & BOOST_SERIALIZATION_NVP(usingsolvercopy);
52 }
53 // DocString: FMTlpheuristic::load
57 template<class Archive>
58 void load(Archive& ar, const unsigned int version)
59 {
60 ar & boost::serialization::make_nvp("lpsolve", boost::serialization::base_object<FMTlpsolver>(*this));
61 this->passinmessagehandler(*this->_logger);
62 ar & BOOST_SERIALIZATION_NVP(seed);
63 this->setgeneratorseed(seed);
64 ar & BOOST_SERIALIZATION_NVP(usingsolvercopy);
65 }
66 BOOST_SERIALIZATION_SPLIT_MEMBER()
67 protected:
68 // DocString: FMTlpheuristic::generator
70 std::default_random_engine generator;
71 // DocString: FMTlpheuristic::seed
73 size_t seed;
74 // DocString: FMTlpheuristic::usingsolvercopy
76 bool usingsolvercopy;
77 public:
78 // DocString: FMTlpheuristic::setgeneratorseed
82 void setgeneratorseed(const size_t& lseed);
83 // DocString: FMTlpheuristic(Models::FMTlpsolver&,size_t lseed,bool copysolver)
91 FMTlpheuristic(Models::FMTlpsolver& basesolve, size_t lseed = 0,bool copysolver = true);
92 // DocString: FMTlpheuristic()
96 FMTlpheuristic(const Models::FMTsolverinterface& interfacetype,const size_t& lseed);
97 // DocString: FMTlpheuristic()
101 FMTlpheuristic()=default;
102 // DocString: FMTlpheuristic(const FMTlpheuristic&)
107 // DocString: FMTlpheuristic(const FMTlpheuristic&&)
112 // DocString: FMTlpheuristic::operator=
116 FMTlpheuristic& operator = (const FMTlpheuristic& rhs);
117 // DocString: FMTlpheuristic::branchnboundsolve
122 virtual bool branchnboundsolve();
123 // DocString: FMTlpheuristic::greedypass
127 virtual bool greedypass(const double& initsol,const unsigned int& iteration);
128 virtual void paralleloptimize(const double& initbestsolution, const unsigned int& iterations,const double& maxtime, const std::chrono::steady_clock::time_point& Starttime);
129 // DocString: FMTlpheuristic::isfeasible
133 virtual ~FMTlpheuristic() = default;
134
135 };
136
137}
138BOOST_CLASS_EXPORT_KEY(Heuristics::FMTlpheuristic)
139#endif
140#endif
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTlpheuristic.hpp:40
Definition: FMTlpsolver.hpp:39
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