FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTLpHeuristicMtHandler.h
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#ifdef FMTWITHOSI
8
9#ifndef FMTlpheuristicmthandler_Hm_included
10#define FMTlpheuristicmthandler_Hm_included
11
12
13#if defined FMTWITHPYTHON
14 #include "boost/python.h"
15#endif
16
17#include "FMTObject.h"
18#include <vector>
19
20
21
22
23namespace Heuristics
24{
25 class FMTOperatingAreaScheduler;
26 class FMTOperatingAreaClusterer;
27 class FMTLpHeuristic;
28
29 // DocString: FMTLpHeuristicMtHandler
34 {
35 public:
36 // DocString: FMTLpHeuristicMtHandler()
41 // DocString: FMTLpHeuristicMtHandler(std::vector<FMTOperatingAreaScheduler>&,const double&)
47 FMTLpHeuristicMtHandler(std::vector<FMTOperatingAreaScheduler>& lheuristics, const double& linitialsolution);
48 // DocString: FMTLpHeuristicMtHandler(std::vector<FMTOperatingAreaClusterer>&,const double&)
54 FMTLpHeuristicMtHandler(std::vector<FMTOperatingAreaClusterer>& lheuristics, const double& linitialsolution);
55 #if defined FMTWITHPYTHON
56 // DocString: FMTLpHeuristicMtHandler(boost::python::list&,const double&)
62 FMTLpHeuristicMtHandler(boost::python::list& lheuristics, const double& linitialsolution);
63 #endif
64 // DocString: FMTLpHeuristicMtHandler::initialSolve
69 size_t initialSolve() const;
70 // DocString: FMTLpHeuristicMtHandler::greedySolve
77 size_t greedySolve(const unsigned int& iterations, const double& maxtime) const;
78 private:
79 double m_initialsolution;
80 std::vector<FMTLpHeuristic*> m_heuristics;
81 // DocString: FMTLpHeuristicMtHandler::_bestHeuristic
86 size_t _bestHeuristic() const;
87 // DocString: FMTLpHeuristicMtHandler::_resetNumberOfThreads
92 void _resetNumberOfThreads(const unsigned int& ncpu) const;
93 };
94}
95//BOOST_CLASS_EXPORT_KEY(Heuristics::FMTLpHeuristicMtHandler)
96#endif
97#endif
#define FMTEXPORT
Definition: FMTutility.h:125
Multithreading handler running several LP heuristics in parallel and keeping the best solution.
Definition: FMTLpHeuristicMtHandler.h:34
FMTLpHeuristicMtHandler()
Default constructor for FMTLpHeuristicMtHandler.
size_t initialSolve() const
Solve each heuristic in parallel to find an initial solution and return the index of the best one.
size_t greedySolve(const unsigned int &iterations, const double &maxtime) const
Improve the solution of each heuristic in parallel with greedy passes and return the index of the bes...
FMTLpHeuristicMtHandler(std::vector< FMTOperatingAreaClusterer > &lheuristics, const double &linitialsolution)
Construct a FMTLpHeuristicMtHandler from operating area clusterers and an initial solution.
FMTLpHeuristicMtHandler(std::vector< FMTOperatingAreaScheduler > &lheuristics, const double &linitialsolution)
Construct a FMTLpHeuristicMtHandler from operating area schedulers and an initial solution.
Namespace regrouping all tools for solving LP/MIP problems using an heuristic.
Definition: FMTAreaParser.h:47