solver  1.0
SolverInterface.h
Go to the documentation of this file.
1 /*
2  This file is part of the EnergyOptimizatorOfRoboticCells program.
3 
4  EnergyOptimizatorOfRoboticCells is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  EnergyOptimizatorOfRoboticCells is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with EnergyOptimizatorOfRoboticCells. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef HLIDAC_PES_SOLVER_INTERFACE_H
19 #define HLIDAC_PES_SOLVER_INTERFACE_H
20 
29 #include <iostream>
30 #include <string>
31 #include <vector>
32 #include "SolverConfig.h"
33 #include "ILPModel/ILPModel.h"
34 #include "Shared/Exceptions.h"
36 
38 std::string solverIdentification();
39 
41 enum Status {
42  ILP_OPTIMAL, ILP_FEASIBLE, ILP_INFEASIBLE, ILP_UNBOUNDED, ILP_UNKNOWN
43 };
44 
46 struct SolutionILP {
48  double criterion;
50  double bound;
52  std::vector<double> solution;
55 };
56 
62 void initializeLocalEnvironments(int numberOfThreads);
63 
74 SolutionILP solveILP(const ILPModel& m, bool verbose, double gap = 0.0, double timeLimit = 0.0, int numberOfThreads = 1, int threadId = 0);
75 
76 #endif
77 
void initializeLocalEnvironments(int numberOfThreads)
It enables the solver to initialize all the data structures (e.g. expensive to construct) required fo...
Integer Linear Programming problem is stored in this data structure.
Definition: ILPModel.h:69
std::vector< double > solution
The best found solution.
Structure storing a solution of an Integer Linear Programming problem.
The file defines extended exceptions for the better error handling in the program.
double criterion
The criterion value of the solution.
std::string solverIdentification()
Returns an identification of the used solver, e.g. 'Gurobi 6.0.4'.
Definition: CplexSolver.cpp:30
Status
Constants specifying whether a solution is optimal, feasible, infeasible, unbounded, or undefined, respectively.
General model for Integer Linear Programming problem.
double bound
The best known lower or upper bound.
Status status
Solution status, see Status enum.
The file defines allowed inaccuracies in a solution and constants for floats.
SolutionILP solveILP(const ILPModel &m, bool verbose, double gap=0.0, double timeLimit=0.0, int numberOfThreads=1, int threadId=0)
Integer Linear Programming solver is called to solve the problem and the solution is returned...
Definition: CplexSolver.cpp:39