17 #ifndef HLIDAC_PES_ROBOTIC_LINE_H
18 #define HLIDAC_PES_ROBOTIC_LINE_H
50 IN, OUT, INNER, WAIT, MOVEMENT,
62 std::ostringstream ss;
80 uint32_t from()
const {
return mFrom; }
81 uint32_t to()
const {
return mTo; }
84 std::vector<Monomial> energyFunction()
const {
return mEnergyFunction; }
117 uint32_t pid()
const {
return mPid; }
118 void pid(
const uint32_t& pid) {
mPid = pid; }
119 void powerSaveModeName(
const std::string& name) {
mName = name; }
120 std::string powerSaveModeName()
const {
return mName; }
123 void expectedInputPower(
const double& expectedInputPower) {
mExpectedInputPower = expectedInputPower; }
176 uint32_t point()
const {
return mPoint; }
177 std::vector<LocationDependentPowerConsumption> locationDependentPowerConsumption()
const {
203 uint32_t aid()
const {
return mAid; }
205 void successors(
const std::vector<Activity*>& successors) {
mSuccessors = successors; }
207 std::vector<Activity*> successors()
const {
return mSuccessors; }
208 void predecessors(
const std::vector<Activity*>& predecessors) {
mPredecessors = predecessors; }
210 std::vector<Activity*> predecessors()
const {
return mPredecessors; }
211 void minAbsDuration(
const double& minAbsDuration) {
mMinAbsDuration = minAbsDuration; }
213 void maxAbsDuration(
const double& maxAbsDuration) {
mMaxAbsDuration = maxAbsDuration; }
215 virtual size_t numberOfModes()
const = 0;
254 std::vector<Location*> locations()
const {
return mLocations; }
255 virtual size_t numberOfModes()
const override {
return mLocations.size(); }
282 std::vector<Movement*> movements()
const {
return mMovements; }
283 virtual size_t numberOfModes()
const override {
return mMovements.size(); }
308 std::vector<StaticActivity*> in, w, out;
309 std::vector<DynamicActivity*> mv;
310 std::vector<StaticActivity*> con1, con2;
322 Robot(uint32_t& fromActivityId, uint32_t& fromPointId,
const uint32_t& numberOfInputs,
const uint32_t& numberOfOutputs,
const ProjectParameters& par);
324 std::vector<Activity*> activities()
const {
return mActivities; }
325 std::vector<RobotPowerMode*> robotModes()
const {
return mRobotModes; }
356 mCompositeBlock
createAssemblyBlock(uint32_t& fromActivityId, uint32_t& fromPointId,
const uint32_t& numberOfInputs)
const;
365 mCompositeBlock
createDisassemblyBlock(uint32_t& fromActivityId, uint32_t& fromPointId,
const uint32_t& numberOfOutputs)
const;
375 mCompositeBlock
createComplexBlockHelper(uint32_t& fromActivityId, uint32_t& fromPointId,
const uint32_t& numberOfSeq,
const std::string& op)
const;
397 void connect(uint32_t& fromActivityId, mCompositeBlock& b,
const std::vector<StaticActivity*>& from,
398 const std::vector<StaticActivity*>& to,
bool fullyConnected =
true)
const;
406 mCompositeBlock
mergeBlocks(
const std::vector<mCompositeBlock>& blocks)
const;
436 double length()
const {
return mLength; }
437 int32_t height()
const {
return mHeight; }
464 uint32_t mode1()
const {
return mMode1; }
466 uint32_t mode2()
const {
return mMode2; }
498 size_t operator() (
const Pair& p)
const {
499 hash<Activity*> ptrHash;
500 hash<uint32_t> modeHash;
501 return ptrHash(p.activity1())^ptrHash(p.activity2())^modeHash(p.mode1())^modeHash(p.mode2());
523 uint32_t oid()
const {
return mOid; }
524 std::string name()
const {
return mName; }
525 void name(
const std::string& name) {
mName = name; }
526 std::vector<TimeLag> timeLags()
const {
return mTimeLags; }
527 void timeLags(
const std::vector<TimeLag>& timeLags) {
mTimeLags = timeLags; }
561 std::vector<Robot*> robots()
const {
return mRobots; }
563 std::vector<Pair> collisions()
const {
return mCollisions; }
565 std::vector<std::string> warnings()
const {
return mWarnings; }
The class represents the robot movement between two coordinates.
double mProductionCycleTime
The calculated production cycle time for *this robotic cell.
mCompositeBlock createBlockOfOperations(uint32_t &fromActivityId, uint32_t &fromPointId, const ActivityType &t1, const ActivityType &t2, const Interval< uint32_t > &numSeq, const Interval< uint32_t > &seqLength) const
It is a core method for the decomposition of the robot work to well-defined blocks.
Auxiliary class encapsulating two activities to form collision or spatial compatibility pair...
Activity * mActivity2
Second activity.
void generateSpatialCompatibilityPairs(Activity *a1, Activity *a2)
It is an auxiliary method for the constructor that helps to generate the compatibility pairs...
The base class incorporating common properties for robot operations and movements.
The structure with desired properties for the generated instances.
TimeLag(Activity *from, Activity *to, const double &length, const int32_t &height)
It initializes the time lag between two activities.
ActivityType mType
The type of the activity, see ActivityType enum.
The class specifies input power of the robot for a particular robot configuration.
uint32_t mAid
Identification of the activity.
Instance of the class includes all the data structures and methods related to a robot.
RobotPowerMode * mMode
A pointer to the related power saving mode of the robot.
Pair(Activity *activity1, const uint32_t &mode1, Activity *activity2, const uint32_t &mode2)
It initializes the structure representing the pair of activities.
Activity * mFrom
The activity from which the arc is leaving.
Location(const uint32_t &point, const std::vector< RobotPowerMode * > &robotModes, const ProjectParameters &par)
It constructs the object representing a location of an operation from the robot point of view...
bool operator==(const Pair &p) const
It compares two Pair data-structures and returns the result of comparison.
std::vector< InterRobotOperation > mInterRobotOperations
Inter-robot operations for a weldment/workpiece passing.
std::vector< Location * > mLocations
The collection of possible robot configurations, i.e. locations, for this operation.
~Robot()
It frees the memory occupied by dynamically allocated activities and power saving modes...
double mExpectedInputPower
Expected input power of the robot if it is not dependent on the robot configuration (joint values)...
Collection of movements between two static activities.
void generateCollisions(const ProjectParameters &par)
It generates collisions between robots.
uint32_t mOid
Integer identification of the inter-robot operation.
Activity(const uint32_t &aid, const ActivityType &type)
The base constructor called from the derived classes for initialization of attributes.
ProjectParameters mParameters
Desired properties of generated instances defined in the input configuration file.
std::vector< RobotPowerMode * > mRobotModes
Available power saving modes for this robot.
uint32_t mPid
Identification of the robot power saving mode, unique for the robot.
std::vector< std::string > mWarnings
Warnings produced during the generation of this robotic cell. Written to the console later to not mix...
std::vector< Pair > mCollisions
Collisions between robots.
std::vector< Robot * > mRobots
Robots incorporated in the robotic cell.
uint32_t mMode2
The mode of the second activity, i.e. a movement or location identification.
uint32_t mPoint
Identification of the robot configuration for the given location and operation.
InterRobotOperation(uint32_t oid, Activity *out, Activity *in, const ProjectParameters &par)
It creates the inter-robot operation according the desired parameters stated in ProjectParameters dat...
virtual ~DynamicActivity() override
It frees the memory occupied by dynamically allocated movements.
Movement(const uint32_t &from, const uint32_t &to, const ProjectParameters &par)
The constructor creates the movement according to the desired properties given in the project configu...
virtual ~StaticActivity() override
It frees the memory occupied by dynamically allocated locations.
uint32_t mTo
Identification of the end coordinate of the movement.
double mLength
The time offset of the inter-robot arc.
Collection of locations in which a robot operation can be performed.
Activity * mTo
The activity to which the arc is entering.
The file declares the structure for storing the properties of generated instances.
It represents the part of energy functions, i.e. where is the duration of the movement.
~RoboticLine()
It frees all the memory occupied by robots.
It represents the power saving mode of the robot.
double mMaxAbsDuration
The maximal absolute duration of the activity to remain feasible.
double mMinDuration
The minimal possible duration of the robot movement.
StaticActivity(const uint32_t &aid, uint32_t &fromPoint, const ActivityType &type, const std::vector< RobotPowerMode * > &robotModes, const ProjectParameters &par)
It generates the static activity, i.e. robot operation, according to the configuration.
std::vector< Activity * > mSuccessors
The successors of the activity.
The structure containing the activities in a block.
Instance of TimeLag class defines a time relation between two different robots.
int32_t mHeight
The time offset in the number of cycles.
void connect(uint32_t &fromActivityId, mCompositeBlock &b, const std::vector< StaticActivity * > &from, const std::vector< StaticActivity * > &to, bool fullyConnected=true) const
It interconnects two sub-blocks and adds the generated dynamic activities to the block b...
std::string mName
The name of the inter-robot operation.
Activity * mActivity1
First activity.
std::vector< LocationDependentPowerConsumption > mLocationDependentPowerConsumption
It defines the power consumption for the robot power saving modes that input power is dependent on th...
Robot(uint32_t &fromActivityId, uint32_t &fromPointId, const uint32_t &numberOfInputs, const uint32_t &numberOfOutputs, const ProjectParameters &par)
It constructs the robot according to the desired parameters.
std::vector< Activity * > mPredecessors
The predecessors of the activity.
mCompositeBlock createDisassemblyBlock(uint32_t &fromActivityId, uint32_t &fromPointId, const uint32_t &numberOfOutputs) const
It creates a block composed of disassembling/cutting the workpiece and taking its parts to other robo...
mCompositeBlock createComplexBlockHelper(uint32_t &fromActivityId, uint32_t &fromPointId, const uint32_t &numberOfSeq, const std::string &op) const
It is an auxiliary method wrapping complex calls to createBlockOfOperations method.
LocationDependentPowerConsumption(RobotPowerMode *mode, const uint32_t &modeIdx, const ProjectParameters &par)
It constructs the object encapsulating the information about the input power for the given robot conf...
double mMaxDuration
The maximal duration of the movement.
std::vector< Monomial > mEnergyFunction
The inter-robot operation corresponding to the workpiece/weldment handling.
RobotPowerMode(const uint32_t &pid, const double &delay)
It constructs the robot's power saving mode.
double mInputPower
Input power of the robot for a given robot configuration, see also the Location class.
mCompositeBlock mergeBlocks(const std::vector< mCompositeBlock > &blocks) const
It copies the activities (their pointers) in blocks to the one composite block.
mCompositeBlock createAssemblyBlock(uint32_t &fromActivityId, uint32_t &fromPointId, const uint32_t &numberOfInputs) const
It creates a block composed of gathering required parts to a bench and their assembly/welding to one ...
double mMinAbsDuration
The minimal absolute duration of the activity to remain feasible.
It represents the location of robotic work.
The robotic cell corresponds to an instance of this class.
double mMinimalDelay
The minimal time in seconds which is required for the stationary robot to apply this power saving mod...
std::vector< Activity * > mActivities
A collection of activities belonging to the robot.
mCompositeBlock createSerialSequence(uint32_t &fromActivityId, uint32_t &fromPointId) const
The method creates a block of a fixed sequence of operations, e.g. welding, cutting, without alternatives and updates the identification values.
std::string numberToString(const T &number)
It converts the number to string.
void calculateProductionCycleTime(const ProjectParameters &par)
It calculates production cycle time with respect to the desired dilatation factor.
double lowerBoundOfCycleTime() const
The method calculates an estimation of cycle time.
std::string mName
The name of the power saving mode, e.g. "motors", "brakes", etc.
uint32_t mFrom
Identification of the start coordinate of the movement.
std::vector< Pair > mSpatialCompatibility
Spatial compatibility pairs, i.e. a handover takes place at the right location for both involved robo...
RoboticLine(const ProjectParameters &par)
It generates all the required data-structures for the robotic cell, i.e. an instance of a robotic cel...
uint32_t mMode1
The mode of the first activity, i.e. a movement or location identification.
std::vector< Movement * > mMovements
The collection of movements between two static activities.
DynamicActivity(const uint32_t &aid, StaticActivity *fromActivity, StaticActivity *toActivity, const ProjectParameters &par)
It generates the dynamic activity with respect to the desired properties.
std::vector< TimeLag > mTimeLags
Time lags ensuring the correct time synchronization between robots.