solver  1.0
InstancesReader.h
Go to the documentation of this file.
1 /*
2  This file is part of the EnergyOptimizatorOfRoboticCells program.
3 
4  EnergyOptimizatorOfRoboticCells is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  EnergyOptimizatorOfRoboticCells is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with EnergyOptimizatorOfRoboticCells. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef HLIDAC_PES_INSTANCES_READER_H
19 #define HLIDAC_PES_INSTANCES_READER_H
20 
27 #include <stdint.h>
28 #include <string>
29 #include <vector>
30 #include "RoboticLine.h"
32 
43  public:
44  InstancesReader() { }
46  void readInstances();
47  std::vector<RoboticLine> dataset() const { return mLines; }
48  std::vector<PrecalculatedMapping> precalculatedMappings() const { return mMapping; }
49  std::string datasetName() const { return mDatasetName; }
50  std::string datasetDescription() const { return mDatasetDescription; }
51  private:
59  void fillActivitiesRelations(PrecalculatedMapping& mapping, const RoboticLine& line);
73  void fillInterRobotOperations(PrecalculatedMapping& mapping, const RoboticLine& line);
79  void fillCollisionZones(PrecalculatedMapping& mapping, const RoboticLine& line);
80 
82  std::vector<RoboticLine> mLines;
84  std::vector<PrecalculatedMapping> mMapping;
86  std::string mDatasetName;
88  std::string mDatasetDescription;
89 };
90 
97  public:
102  InstanceChecker(const RoboticLine& line) : mLine(line) { }
104  void checkInstance() const;
105  private:
110  void checkStaticActivity(StaticActivity* sa) const;
115  void checkDynamicActivity(DynamicActivity* da) const;
120  void checkRobotGraph(Robot* r) const;
125  void checkOperation(InterRobotOperation* op) const;
130  void checkCollision(const std::pair<ActivityMode*, ActivityMode*>& col) const;
131 
134 };
135 
136 #endif
void fillInterRobotOperations(PrecalculatedMapping &mapping, const RoboticLine &line)
It fills the searching maps related to the robot synchronizations and spatial compatibility.
void fillCollisionZones(PrecalculatedMapping &mapping, const RoboticLine &line)
It fills the maps for fast searching of colliding movements or locations.
void checkOperation(InterRobotOperation *op) const
Checks that each time lag or spatial compatibility pair is defined for two different robots...
An instance of this class checks a dataset instance.
Instance of this class includes all the data structures and methods related to a robot.
Definition: RoboticLine.h:432
Collection of movements between two static activities.
Definition: RoboticLine.h:261
void fillActivitiesRelations(PrecalculatedMapping &mapping, const RoboticLine &line)
Maps related to activities relations (precedences) are filled.
The class is intended to be used by users for the dataset parsing and checking.
void checkStaticActivity(StaticActivity *sa) const
It checks the activity duration and whether the input power of power saving modes is defined...
std::string mDatasetName
Name of the dataset.
std::string mDatasetDescription
Description of the dataset.
The structures and methods suitable for fast searching in the data structure of the robotic cell...
void checkDynamicActivity(DynamicActivity *da) const
Verifies the activity duration and convexity of energy functions.
void checkCollision(const std::pair< ActivityMode *, ActivityMode * > &col) const
Checks that the collision is defined for two different robots.
Collection of locations in which a robot operation (or waiting) can be performed. ...
Definition: RoboticLine.h:304
void checkInstance() const
The method verifies the correctness of the instance. If incorrect, then an exception is thrown...
void checkRobotGraph(Robot *r) const
It checks that there is a hamiltonian circuit in the robot graph.
std::vector< PrecalculatedMapping > mMapping
Precalculated mappings suitable for fast searching in the data structures of robotic cells...
const RoboticLine & mLine
A reference to a robotic cell that will be tested for inconsistencies.
The inter-robot operation corresponding to the workpiece/weldment handling.
Definition: RoboticLine.h:518
std::vector< RoboticLine > mLines
Robotic cells read from the dataset.
void completeFillingOfMapping()
A wrapper method calling all the related filling methods.
void fillDiscretizedEnergyFunctions(PrecalculatedMapping &mapping, const RoboticLine &line)
Energy functions are piece-wise linearized, and vectors of coordinates are written to the mapping...
The robotic cell corresponds to an instance of this class.
Definition: RoboticLine.h:563
The structure contains the maps for fast searching in the robotic cell.
void readInstances()
It processes the dataset specified in Settings::DATASET_FILE.
The file contains various classes devoted to abstract representation of the robotic cell...
InstanceChecker(const RoboticLine &line)
Constructs an instance checker.