18 #ifndef HLIDAC_PES_PRECALCULATED_MAPPING_H
19 #define HLIDAC_PES_PRECALCULATED_MAPPING_H
31 #include <unordered_map>
47 struct hash<pair<uint32_t, uint32_t>> {
48 size_t operator() (
const pair<uint32_t, uint32_t>& p)
const {
50 uint64_t v64 =
pack(p.first, p.second);
58 size_t operator() (
const pair<Location*, Location*>& p)
const {
60 uint64_t v64 =
pack(p.first->point(), p.second->point());
68 using SpatialCmpTuple = std::tuple<uint32_t, uint32_t, StaticActivity*, StaticActivity*, std::vector<std::pair<Location*, Location*>>>;
90 std::map<StaticActivity*, std::map<StaticActivity*, std::vector<std::pair<Location*, Location*>>>>
sptComp;
94 std::map<Movement*, std::tuple<std::vector<double>, std::vector<double>>>
mvToEnergyFunc;
96 std::map<std::pair<Location*, RobotPowerMode*>, std::tuple<std::vector<double>, std::vector<double>>>
locToEnergyFunc;
121 template <
class X,
class Y>
The instance of the class corresponds to a robot movement between two coordinates.
The structure representing a solution found by an algorithm.
std::map< std::pair< Location *, RobotPowerMode * >, std::tuple< std::vector< double >, std::vector< double > > > locToEnergyFunc
Location and the selected power saving mode are mapped to the linear energy function, i.e. the size of each vector in the tuple is 2.
Collection of movements between two static activities.
std::map< Activity *, std::vector< TimeLag > > timeLagsFromAct
It searches for all the time lags starting from the given activity.
std::map< uint32_t, Location * > pointToLocation
Unique coordinate, i.e. a point, to the related location.
std::vector< SpatialCmpTuple > sptCompVec
Enables to fast iterate through spatial compatibility elements.
std::vector< Movement * > findMovements(X from, Y to)
It finds all the movements located between from and to and returns them in the vector.
std::map< StaticActivity *, std::map< StaticActivity *, std::vector< std::pair< Location *, Location * > > > > sptComp
Two-step mapping taking two static activities and returning a list of compatible pairs of locations...
Various auxiliary functions used across the program.
uint64_t pack(const uint32_t &v1, const uint32_t &v2)
It packs two uint32_t numbers to uint64_t data type.
std::map< ActivityMode *, std::set< ActivityMode * > > collisionSearch
It finds colliding movements and locations for a given location or movement.
Movement * getSelectedMovement(const Solution &s, const PrecalculatedMapping &m, DynamicActivity *da)
It extracts the selected movement of the given dynamic activity from the solution.
std::map< Movement *, std::tuple< std::vector< double >, std::vector< double > > > mvToEnergyFunc
It takes a pointer to a movement and returns the vector of precalculated coordinates corresponding to...
std::map< uint32_t, std::vector< uint32_t > > pointToPredecessorPoints
It finds all the starting coordinates of the movements entering the given coordinate, i.e. the point.
std::map< uint32_t, std::vector< uint32_t > > pointToSuccessorPoints
It finds all the ending coordinates of the movements leaving the given coordinate, i.e. the point.
std::map< Activity *, std::vector< TimeLag > > timeLagsToAct
It searches for all the time lags ending in the given activity.
A representation of the solution that is algorithm independent.
Location of the robot used either during work (welding) or waiting.
The structure contains the maps for fast searching in the robotic cell.
std::unordered_map< std::pair< uint32_t, uint32_t >, Movement * > pointsToMovement
Two coordinates are mapped to the movement starting/ending at the first/second coordinate, respectively.
The file contains various classes devoted to abstract representation of the robotic cell...
std::unordered_map< std::pair< Location *, Location * >, Movement * > locationsToMovement
It finds the movement between two locations if exists.
std::map< uint32_t, Activity * > aidToActivity
Activity identification to its pointer.
std::tuple< uint32_t, uint32_t, StaticActivity *, StaticActivity *, std::vector< std::pair< Location *, Location * >>> SpatialCmpTuple
Defines the data type for an element of the spatial compatibility, i.e. (rob1 idx, rob2 idx, act1, act2, {{loc1, loc2}*}).