solver  1.0
SolutionChecker.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_SOLUTION_CHECKER_H
19 #define HLIDAC_PES_SOLUTION_CHECKER_H
20 
27 #include <array>
28 #include <map>
29 #include <set>
30 #include <vector>
31 #include "RoboticLine.h"
32 #include "Shared/Utils.h"
33 #include "Solution/Solution.h"
35 
44  public:
46  SolutionChecker(const RoboticLine& l, const PrecalculatedMapping& m, const Solution& sol)
47  : mLine(l), mSolution(sol), mMapping(m) { };
48 
54  bool checkAll();
56  std::vector<std::string> errorMessages() const { return mErrorMsg; }
57  private:
59  void checkCriterion();
63  void checkStaticActivities();
68 
72  void checkCollisionZones();
73 
75  std::array<uint32_t, 2> extractModes(Activity* a1, Activity* a2) const;
76 
84  std::vector<std::string> mErrorMsg;
85 };
86 
87 #endif
88 
The base class incorporating common properties of robot operations and movements. ...
Definition: RoboticLine.h:68
The structure representing a solution found by an algorithm.
Definition: Solution.h:50
void checkDynamicActivities()
Checks durations of dynamic activities.
void checkCriterion()
Checks the calculation of the criterion.
std::vector< std::string > mErrorMsg
Error messages describing the reasons why the solution is invalid.
SolutionChecker(const RoboticLine &l, const PrecalculatedMapping &m, const Solution &sol)
Initialization of the solution checker.
void checkStaticActivities()
Checks durations of static activities.
An instance of this class is devoted to the solution checking.
The structures and methods suitable for fast searching in the data structure of the robotic cell...
std::vector< std::string > errorMessages() const
It returns error message(s) describing why the solution is invalid.
Various auxiliary functions used across the program.
bool checkAll()
It calls the private member methods to verify the solution.
void checkGlobalConstraints()
Verifies that time lags and spatial compatibility are not violated.
PrecalculatedMapping mMapping
Precalculated mapping constructed for the robotic cell.
std::array< uint32_t, 2 > extractModes(Activity *a1, Activity *a2) const
Auxiliary method that extracts selected modes (location/movement identifications) for activities a1 a...
void checkCollisionZones()
Verifies that a collision does not occur in the solution.
void checkScheduleContinuity()
Checks whether each robot path is closed and hamiltonian (each static activity is visited just once)...
Solution mSolution
The solution to be checked.
void checkProductionCycleTime()
Checks whether the robot, i.e. production, cycle time is met.
A representation of the solution that is algorithm independent.
The robotic cell corresponds to an instance of this class.
Definition: RoboticLine.h:563
The structure contains the maps for fast searching in the robotic cell.
RoboticLine mLine
The data structure of the robotic cell for which the solution is verified.
The file contains various classes devoted to abstract representation of the robotic cell...