21 #include "SolverConfig.h"
32 throw_with_nested(
SolverException(caller(),
"Either incomplete solution or flawed PrecalculatedMapping data-structure!"));
36 vector<Location*> getLocations(
Location* loc) {
41 return act->locations();
44 template <
class X,
class Y>
47 vector<Movement*> foundMvs, leavMvs, entMvs;
49 const vector<Location*> &f = getLocations(from), &t = getLocations(to);
51 const vector<Movement*>& sortedRange1 = leavMvs, &sortedRange2 = loc->leavingMovements();
52 vector<Movement*> sortedRange(sortedRange1.size()+sortedRange2.size());
53 merge(sortedRange1.cbegin(), sortedRange1.cend(), sortedRange2.cbegin(), sortedRange2.cend(), sortedRange.begin());
54 leavMvs = move(sortedRange);
58 const vector<Movement*>& sortedRange1 = entMvs, &sortedRange2 = loc->enteringMovements();
59 vector<Movement*> sortedRange(sortedRange1.size()+sortedRange2.size());
60 merge(sortedRange1.cbegin(), sortedRange1.cend(), sortedRange2.cbegin(), sortedRange2.cend(), sortedRange.begin());
61 entMvs = move(sortedRange);
64 set_intersection(leavMvs.cbegin(), leavMvs.cend(), entMvs.cbegin(), entMvs.cend(), back_inserter(foundMvs));
70 template vector<Movement*> findMovements<Location*, StaticActivity*>(
Location*, StaticActivity*);
71 template vector<Movement*> findMovements<StaticActivity*, StaticActivity*>(StaticActivity*, StaticActivity*);
The instance of the class corresponds to a robot movement between two coordinates.
The structure representing a solution found by an algorithm.
Collection of movements between two static activities.
A general exception of the program.
The structures and methods suitable for fast searching in the data structure of the robotic cell...
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< uint32_t, std::pair< uint32_t, uint32_t > > pointAndPowerMode
It maps the identification of a static activity to its assigned coordinate and used power saving mode...
Collection of locations in which a robot operation (or waiting) can be performed. ...
Movement * getSelectedMovement(const Solution &s, const PrecalculatedMapping &m, DynamicActivity *da)
It extracts the selected movement of the given dynamic activity from the solution.
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.