solver  1.0
HeuristicAlgorithms.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_HEURISTIC_ALGORITHMS_H
19 #define HLIDAC_PES_HEURISTIC_ALGORITHMS_H
20 
31 
39  public:
42  : mKB(kb), mLine(line), mPenaltyMultiplier(4.0), mMapping(mapping) { }
43 
50  std::vector<std::vector<Location*>> initializePartialSolution(PartialSolution& ps) const;
65  OptimalTiming convert(const PartialSolution& ps, const Solution& s) const;
74  CollisionResolution resolveCollision(ActivityMode* m1, double s1, double d1, ActivityMode* m2, double s2, double d2) const;
83 
92  double heuristicLocationChanges(OptimalTiming& ot, PartialSolution& ps, const std::vector<std::vector<Location*>>& fixed, bool& solutionChanged) const;
101  double heuristicPowerModeSelection(const OptimalTiming& ot, PartialSolution& ps, TabuList& tabuList, bool& solutionChanged) const;
102  private:
110  double scaleGanttToCycleTime(std::vector<ActivityModeInfo>& robotGantt) const;
118  double calculateBreakagePenalty(const std::vector<ActivityModeInfo>& robotGantt, const OptimalTiming& ot) const;
119 
125  const double mPenaltyMultiplier;
128 };
129 
130 #endif
KnowledgeBase & mKB
Access to the shared data of the heuristic.
HeuristicAlgorithms(KnowledgeBase &kb, const RoboticLine &line, const PrecalculatedMapping &mapping)
Constructor makes references to the required data, i.e. the robotic cell, its mapping, and shared data of the heuristic.
The structure representing a solution found by an algorithm.
Definition: Solution.h:50
double scaleGanttToCycleTime(std::vector< ActivityModeInfo > &robotGantt) const
It scales durations of activities in such a way that the robot cycle time is met. Updated start times...
CollisionResolution resolveTheWorstCollision(const PartialSolution &ps, const OptimalTiming &ot, const Solution &s) const
It finds the worst collision, i.e. with the longest time of active collision, and returns how to reso...
std::vector< std::vector< Location * > > initializePartialSolution(PartialSolution &ps) const
It appends the fixed movements (implied from fixed locations), and optionally fastest power saving mo...
Declares LP solver which deals with partially fixed energy optimization problems created by the paral...
The structure stores how to resolve one collision between robots.
The structures and methods suitable for fast searching in the data structure of the robotic cell...
double heuristicPowerModeSelection(const OptimalTiming &ot, PartialSolution &ps, TabuList &tabuList, bool &solutionChanged) const
The sub-heuristic tries to switch from one power saving mode to another one for a location in order t...
Protected access to the shared data of the threads of the parallel heuristic.
Definition: KnowledgeBase.h:46
Various data structures used by the heuristic.
A short-term memory, containing a list of forbidden moves, that mitigates the risk of cycling...
CollisionResolution resolveCollision(ActivityMode *m1, double s1, double d1, ActivityMode *m2, double s2, double d2) const
It checks whether there is a collision between two specified activities, and eventually returns how t...
const PrecalculatedMapping & mMapping
Fast searching in the data structure of the robotic cell.
Defines the optimization part of the parallel heuristic, i.e. sub-heuristics and the evaluation of tu...
A partially fixed problem, i.e. tuple.
Fixed locations, power saving modes, and movements.
const RoboticLine & mLine
Access to the robotic cell to be optimized.
const double mPenaltyMultiplier
Aggregated breakage time (see calculateBreakagePenalty) is multiplied by this constant to get the pen...
double heuristicLocationChanges(OptimalTiming &ot, PartialSolution &ps, const std::vector< std::vector< Location * >> &fixed, bool &solutionChanged) const
The sub-heuristic locally optimizes the robot paths (change locations) to reduce energy consumption...
Algo
Defining constants for different states of the heuristic.
Declares the class storing the best found solutions, tuples, and information about the heuristic perf...
OptimalTiming convert(const PartialSolution &ps, const Solution &s) const
Auxiliary method that converts a general form of the solution to the timing of the robotic cell...
Either a movement or location.
Definition: RoboticLine.h:54
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.
OptimalTiming solvePartialProblem(const PartialSolution &ps, const CircuitTuple &t, Algo algo)
Employs Linear Programming to obtain energy-efficient timing for a given tuple.
Obtained timing for a partial problem.
double calculateBreakagePenalty(const std::vector< ActivityModeInfo > &robotGantt, const OptimalTiming &ot) const
It calculates the penalty for the violation of time lags and collisions.