solver  1.0
VariableMappingILP.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_VARIABLE_MAPPING_ILP_H
19 #define HLIDAC_PES_VARIABLE_MAPPING_ILP_H
20 
27 #include <vector>
28 #include <utility>
30 
32 using map2to1 = std::map<std::pair<uint32_t, uint32_t>, uint32_t>;
34 using map4toN = std::map<std::pair<uint64_t, uint64_t>, std::vector<uint32_t> >;
35 
42  public:
47 
49  uint32_t numberOfVariables() const;
50 
73  private:
80 };
81 
97 std::map<uint32_t, uint32_t> inverseMapping(const std::vector<double>& solution, const map2to1& mapping);
98 
99 #endif
Instance of this class includes all the data structures and methods related to a robot.
Definition: RoboticLine.h:432
uint32_t numberOfVariables() const
Total number of variables including both continuous and binary ones.
map4toN c
Binary variables used for collisions resolution.
void addActivityBinaryVariables(Robot *r)
It creates the mapping for x, z, and y variables.
Mapping of continuous variables of the energy optimization problem.
void addActivityOrderBinaryVariables(Robot *r)
It constructs the mapping for w variables.
Mapping of continuous variables occurring in the energy optimization problem.
std::map< std::pair< uint64_t, uint64_t >, std::vector< uint32_t > > map4toN
Mapping of variables indexed by four numbers.
void addCollisionBinaryVariables(const RoboticLine &l)
Mapping of c variables is created.
VariableMappingILP(Robot *r)
Constructs the mapping of all the variables related to robot r.
std::map< uint32_t, uint32_t > inverseMapping(const std::vector< double > &solution, const map2to1 &mapping)
It extracts the variables set to true and returns the ,,selected" indices.
The robotic cell corresponds to an instance of this class.
Definition: RoboticLine.h:563
std::map< std::pair< uint32_t, uint32_t >, uint32_t > map2to1
Mapping of variables indexed by two numbers.
Mapping of continuous and binary variables.