18 #ifndef HLIDAC_PES_CONSTRAINTS_GENERATOR_H
19 #define HLIDAC_PES_CONSTRAINTS_GENERATOR_H
229 std::vector<Operator>
mOp;
231 std::vector<double>
mB;
void addEnergyFunctions1(const map1to1 &d, const map1to1 &W, const map2to1 &x, const map2to1 &z)
Add the constraints propagating the consumption of static activities to the criterion.
The instance of the class corresponds to a robot movement between two coordinates.
void addPrecedenceSelectionConstraints(const map2to1 &y, const map2to1 &w)
According to the selected movements it decides which optional dynamic activities are performed...
void addEnergyFunction(const map1to1 &d, const map1to1 &W, Location *loc, RobotPowerMode *pwrm)
Adds energy function for a static activity, its location, and its applied power saving mode...
Generation of the (I)LP constraints.
Instance of this class includes all the data structures and methods related to a robot.
const PrecalculatedMapping * mMapping
Mapping calculated for the robotic cell.
void addCollisionResolution(const map1to1 &s, const map1to1 &d, uint32_t i, uint32_t j, int32_t multipleOfCycleTime)
It adds a constraint to resolve a collision, i.e. it adds a precedence for a given multiple of the r...
std::vector< Operator > mOp
Operators of constraints.
void addMinimalDurationConstraints1(const map1to1 &d, const map2to1 &z)
Constraints restricting the minimal duration of static activities with respect to their assigned powe...
void addUniqueModeSelection(const map2to1 &x, map2to1 &z)
It calls addUniquePointSelection and addUniquePowerModeSelection methods.
void addEnergyFunctions2(const map1to1 &d, const map1to1 &W, const map2to1 &y)
Add the constraints propagating the consumption of dynamic activities to the criterion.
std::vector< StaticActivity * > mStaticActivities
Static activities filtered from the robotic cell.
Integer Linear Programming problem is stored in this data structure.
std::vector< Robot * > mRobots
Robots located in the robotic cell.
The structures and methods suitable for fast searching in the data structure of the robotic cell...
void addSpatialCompatibilityConstraints(const map2to1 &x)
It defines the spatial compatibility between robots, in other words a workpice is taken from the same...
void addTimeLags(const map1to1 &s, bool allRequired=true)
Time lags enforcing correct time synchronizations between robots are added.
std::map< std::pair< uint64_t, uint64_t >, std::vector< uint32_t > > map4toN
Mapping of variables indexed by four numbers.
void addUniquePowerModeSelection(const map2to1 &z)
Just one power saving mode (including the dummy one - motors) is applied for each static activity...
void addEnergyFunctions(const map1to1 &d, const map1to1 &W, const map2to1 &x, const map2to1 &z, const map2to1 &y)
It adds the energy functions of both the static and dynamic activities.
void reset()
All the generated constraints are removed.
void addSelectedPrecedences(const map1to1 &s, const map1to1 &d, const std::vector< Movement * > &mvs)
Each has-to-be movement imposes a fixed precedence that is added to the formulation in the form of a ...
std::vector< double > mB
Right-hand side constants.
void addFlowConstraints(const map2to1 &x, const map2to1 &y)
Add flow preservation constraints ensuring that robot leaves the same location as it enters...
std::vector< std::string > mConDesc
Description of the constraints.
Memory efficient storage of the constraint matrix.
uint64_t mConstraintsCounter
The number of constraints generated by an instance of this class.
void addFixedPrecedences(const map1to1 &s, const map1to1 &d)
Adds fixed precedences, i.e. enforces the have-to-be order of some activities.
std::vector< DynamicActivity * > mDynamicActivities
Dynamic activities filtered from the robotic cell.
General model for Integer Linear Programming problem.
It represents the power saving mode of the robot.
RoboticLine const * mLine
Pointer to an active robotic cell.
void addSelectablePrecedences(const map1to1 &s, const map1to1 &d, const map2to1 &w)
It adds selectable precedences which model alternative orders of activities.
void addCollisions(const map1to1 &s, const map1to1 &d, const map2to1 &x, const map2to1 &y, const map4toN &c)
Adds constraints that enforce a collision-free solution.
ConstraintsGenerator(Robot *r, const PrecalculatedMapping *m)
Generation of the constraints for a given robot.
SparseMatrix< double > mA
Constraint matrix.
std::map< uint32_t, uint32_t > map1to1
Identification of the activity is mapped to the index of the variable.
void addAllPrecedences(const map1to1 &s, const map1to1 &d, const map2to1 &y, const map2to1 &w)
It calls all the methods related to the order of activities.
void initializeDataStructures()
It initializes the member variables and removes all the constraints.
void addGlobalConstraints(const map1to1 &s, const map1to1 &d, const map2to1 &x, const map2to1 &y, const map4toN &c)
Adds all the global constraints, i.e. time lags, spatial compatibility, and collision resolution...
void addMaximalDurationConstraints2(const map1to1 &d, const map2to1 &y)
Constraints restricting the maximal duration of dynamic activities with respect to their selected mov...
double mCycleTime
Copied robot cycle time.
void addDurationConstraints(const map1to1 &d, const map2to1 &z, const map2to1 &y)
It constructs all the constraints that limit the duration of activities.
ConstraintsGenerator()
Empty constructor, the object needs to be assigned a robot or robotic cell later. ...
ConstraintsGenerator(const RoboticLine &l, const PrecalculatedMapping *m)
Generation of the constraints for a given robotic cell.
void addMinimalDurationConstraints2(const map1to1 &d, const map2to1 &y)
Constraints restricting the minimal duration of dynamic activities with respect to their selected mov...
void addUniquePointSelection(const map2to1 &x)
Just one location, i.e. coordinate, is selected for each static activity.
Location of the robot used either during work (welding) or waiting.
The robotic cell corresponds to an instance of this class.
The structure contains the maps for fast searching in the robotic cell.
void addConstraint(SparseMatrix< double >::Row &row, Operator op, const double &b, std::string conDesc="")
Add constraint "row'*vars op b" into the formulation.
Mapping of integer, to be more precise binary, variables of the energy optimization problem...
The file contains various classes devoted to abstract representation of the robotic cell...
std::map< std::pair< uint32_t, uint32_t >, uint32_t > map2to1
Mapping of variables indexed by two numbers.
uint64_t moveConstraintsToModel(ILPModel &m)
It efficiently moves all the generated constraints to the given model.
Operator
Constants for operators '<=', '=', and '>=', respectively.