10#ifndef FMTlpheuristic_Hm_included
11#define FMTlpheuristic_Hm_included
20#include <boost/serialization/serialization.hpp>
21#include <boost/serialization/nvp.hpp>
22#include <boost/serialization/export.hpp>
23#include "FMTSolverInterface.h"
95 virtual bool greedyPass(
const double& initsol,
const unsigned int& iteration);
104 virtual void parallelOptimize(
const double& initbestsolution,
const unsigned int& iterations,
const double& maxtime,
const std::chrono::steady_clock::time_point& Starttime);
129 friend class boost::serialization::access;
130 template<
class Archive>
131 void save(Archive& ar,
const unsigned int version)
const
133 ar & boost::serialization::make_nvp(
"lpsolve", boost::serialization::base_object<FMTLpSolver>(*
this));
134 ar & boost::serialization::make_nvp(
"seed", m_seed);
135 ar & boost::serialization::make_nvp(
"usingsolvercopy", m_usingsolvercopy);
144 template<
class Archive>
145 void load(Archive& ar,
const unsigned int version)
147 ar & boost::serialization::make_nvp(
"lpsolve", boost::serialization::base_object<FMTLpSolver>(*
this));
148 this->passInMessageHandler(*this->_logger);
149 ar & boost::serialization::make_nvp(
"seed", m_seed);
150 this->setGeneratorSeed(m_seed);
151 ar & boost::serialization::make_nvp(
"usingsolvercopy", m_usingsolvercopy);
153 BOOST_SERIALIZATION_SPLIT_MEMBER()
#define FMTEXPORT
Definition: FMTutility.h:125
Base class for solving LP and MIP problems using a heuristic, holding a random generator and its own ...
Definition: FMTLpHeuristic.h:34
virtual bool greedyPass(const double &initsol, const unsigned int &iteration)
Do a greedy pass to try to improve the solution.
FMTLpHeuristic(const Models::FMTSolverInterface &interfacetype, const size_t &lseed)
Construct a FMTLpHeuristic from a solver type and a seed.
bool m_usingsolvercopy
If true the heuristic will work from it's own copy of solverinterface, else it's going to work on the...
Definition: FMTLpHeuristic.h:120
virtual void parallelOptimize(const double &initbestsolution, const unsigned int &iterations, const double &maxtime, const std::chrono::steady_clock::time_point &Starttime)
Optimize the heuristic in parallel until the maximum number of iterations or the maximum time is reac...
std::default_random_engine m_generator
std random number generator of the heuristic each heuristic has it's own generator to generate differ...
Definition: FMTLpHeuristic.h:114
size_t m_seed
The random engine seed need to be a data member when serializing the class.
Definition: FMTLpHeuristic.h:117
FMTLpHeuristic(const FMTLpHeuristic &rhs)
Copy constructor for FMTLpHeuristic.
virtual bool branchNBoundSolve()
Solve the problem using branch and bound on the primal formulation, using the heuristic solution as a...
FMTLpHeuristic(FMTLpHeuristic &&rhs)=default
Move constructor for FMTLpHeuristic.
void setGeneratorSeed(const size_t &lseed)
Set the seed of the random generator.
FMTLpHeuristic(Models::FMTLpSolver &basesolve, size_t lseed=0, bool copysolver=true)
Main constructor for FMTLpHeuristic from a base solver, taking the information coming from a FMTLpMod...
virtual ~FMTLpHeuristic()=default
Default virtual destructor for FMTLpHeuristic.
FMTLpHeuristic()=default
Default constructor for FMTLpHeuristic.
Abstract class to ease the usage of the OsiSolverInterface in FMT for linear programming models.
Definition: FMTLpSolver.h:49
Namespace regrouping all tools for solving LP/MIP problems using an heuristic.
Definition: FMTAreaParser.h:47
FMTSolverInterface
Enumerator used to specify the solver to use when solving the FMTLpModel.
Definition: FMTsolverinterface.h:21