solver  1.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HeuristicAlgorithms Class Reference

Defines the optimization part of the parallel heuristic, i.e. sub-heuristics and the evaluation of tuples. More...

#include <HeuristicAlgorithms.h>

+ Collaboration diagram for HeuristicAlgorithms:

Public Member Functions

 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.
 
std::vector< std::vector< Location * > > initializePartialSolution (PartialSolution &ps) const
 It appends the fixed movements (implied from fixed locations), and optionally fastest power saving modes to ps data structure. More...
 
OptimalTiming solvePartialProblem (const PartialSolution &ps, const CircuitTuple &t, Algo algo)
 Employs Linear Programming to obtain energy-efficient timing for a given tuple. More...
 
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. More...
 
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 to resolve this collision. More...
 
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 resolve it. More...
 
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. More...
 
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 to reduce energy consumption. More...
 

Private Member Functions

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 and durations are reflected in the robotGantt variable. More...
 
double calculateBreakagePenalty (const std::vector< ActivityModeInfo > &robotGantt, const OptimalTiming &ot) const
 It calculates the penalty for the violation of time lags and collisions. More...
 

Private Attributes

KnowledgeBasemKB
 Access to the shared data of the heuristic.
 
const RoboticLinemLine
 Access to the robotic cell to be optimized.
 
const double mPenaltyMultiplier
 Aggregated breakage time (see calculateBreakagePenalty) is multiplied by this constant to get the penalty.
 
const PrecalculatedMappingmMapping
 Fast searching in the data structure of the robotic cell.
 

Detailed Description

Defines the optimization part of the parallel heuristic, i.e. sub-heuristics and the evaluation of tuples.

An instance of this class provides an access to the sub-heuristics and solver for partially fixed problems (called tuples). The solver determines an energy-efficient timing for fixed locations, movements, and power saving modes. The aim of the sub-heuristics is to modify tuples in such a way that would be resulting in an energy reduction.

Definition at line 38 of file HeuristicAlgorithms.h.

Member Function Documentation

double HeuristicAlgorithms::calculateBreakagePenalty ( const std::vector< ActivityModeInfo > &  robotGantt,
const OptimalTiming ot 
) const
private

It calculates the penalty for the violation of time lags and collisions.

Parameters
robotGanttTiming of the robot activities where the robot cycle time is met.
otTiming of the whole robotic cell.
Returns
Penalty for violating time lags and collisions.
See also
heuristicLocationChanges, heuristicPowerModeSelection, mPenaltyMultiplier

Definition at line 599 of file HeuristicAlgorithms.cpp.

OptimalTiming HeuristicAlgorithms::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.

Parameters
psA partial problem with fixed locations, movements, and power saving modes.
sSolution of the partially fixed problem.
Returns
Extracted timing of a robotic cell.

Definition at line 199 of file HeuristicAlgorithms.cpp.

double HeuristicAlgorithms::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.

Parameters
[in,out]otTiming of the robotic cell.
[in,out]psA partial problem with fixed locations, movements, and power saving modes.
fixedLocations that cannot be changed because the spatial compatibility has to be preserved.
[out]solutionChangedIt indicates whether the partially fixed problem was modified.
Returns
An estimation of energy saving after performing all the changes.

Definition at line 305 of file HeuristicAlgorithms.cpp.

double HeuristicAlgorithms::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 to reduce energy consumption.

Parameters
otTiming of the robotic cell.
[in,out]psA partial problem with fixed locations, movements, and power saving modes.
tabuListA list with the forbidden modifications.
[out]solutionChangedIt indicates whether the partially fixed problem was modified.
Returns
An estimation of energy saving after performing all the changes.

Definition at line 410 of file HeuristicAlgorithms.cpp.

vector< vector< Location * > > HeuristicAlgorithms::initializePartialSolution ( PartialSolution ps) const

It appends the fixed movements (implied from fixed locations), and optionally fastest power saving modes to ps data structure.

Parameters
[in,out]psA partial problem with given fixed locations (+their order).
Returns
Fixed locations for each robot, indexed by robot.

Definition at line 107 of file HeuristicAlgorithms.cpp.

CollisionResolution HeuristicAlgorithms::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 to resolve this collision.

Parameters
m1A movement or location of the first considered activity.
s1,d1Start time and duration of the first activity, respectively.
m2A movement or location of the second considered activity.
s2,d2Start time and duration of the second activity, respectively.
Returns
How to resolve this collision. If the collision does not occur, then the pointers to activities are set to null.

Definition at line 251 of file HeuristicAlgorithms.cpp.

CollisionResolution HeuristicAlgorithms::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 resolve it.

Parameters
psA partial problem with fixed locations, movements, and power saving modes.
otTiming of the robotic cell.
sSolution of the Linear Programming problem.
Returns
How to resolve the worst collision that occurred in the given timing.

Definition at line 282 of file HeuristicAlgorithms.cpp.

double HeuristicAlgorithms::scaleGanttToCycleTime ( std::vector< ActivityModeInfo > &  robotGantt) const
private

It scales durations of activities in such a way that the robot cycle time is met. Updated start times and durations are reflected in the robotGantt variable.

Parameters
[in,out]robotGanttTiming of the robot activities where some activities have modified durations.
Returns
Estimated energy consumption of the related robot after the timing is changed.
See also
heuristicPowerModeSelection

Definition at line 505 of file HeuristicAlgorithms.cpp.

OptimalTiming HeuristicAlgorithms::solvePartialProblem ( const PartialSolution ps,
const CircuitTuple t,
Algo  algo 
)

Employs Linear Programming to obtain energy-efficient timing for a given tuple.

Parameters
psA partial problem with fixed locations, movements, and power saving modes.
tA tuple corresponding to the partial problem.
algoSpecifies what was called before solving this partial problem, i.e. either a sub-heuristic or initialization phase.
Returns
Energy-efficient timing of the robotic cell for a given tuple.

Definition at line 138 of file HeuristicAlgorithms.cpp.


The documentation for this class was generated from the following files: