Public Member Functions | Private Member Functions | Private Attributes | List of all members
area_division Class Reference

A class to divide the environment optimally among multiple cyber physical systems (CPSs). More...

#include <area_division.h>

Public Member Functions

 area_division ()
 Constructor. More...
 
void divide ()
 Perform the area division. More...
 
nav_msgs::OccupancyGrid get_grid (nav_msgs::OccupancyGrid map, string cps)
 Get the region assigned to a CPS. More...
 
void initialize_cps (map< string, vector< int >> cpss)
 Define the CPS positions. More...
 
void initialize_map (int r, int c, vector< signed char > src)
 Define the grid map. More...
 

Private Member Functions

void assign (vector< valarray< double >> matrix)
 Define the assignment matrix based on a given distance metric matrix. More...
 
valarray< float > CalcConnectedMultiplier (valarray< float > dist1, valarray< float > dist2)
 Calculate the connected multiplier. More...
 
valarray< double > FinalUpdateOnMetricMatrix (double CM, valarray< double > curentONe, valarray< float > CC)
 Update the metric matrix. More...
 
bool isThisAGoalState (int thres)
 Check if the areas assigned to each robot are of similar size. More...
 

Private Attributes

valarray< int > A
 Area assignment matrix. More...
 
vector< int > ArrayOfElements
 Grid cells not assigned to the robots. More...
 
vector< valarray< int > > BWlist
 A binary array for each CPS which indicates free space. More...
 
int cols
 Number of columns in the grid map. More...
 
vector< vector< int > > cps
 Positions of the CPSs. More...
 
int discr
 Maximum difference between number of assigned grid cells to each CPS. More...
 
vector< signed char > gridmap
 The environment grid map. Robots are represented by 2, obstacles by 1/-2, empty cells by -1. More...
 
int max_iter
 Maximum number of iterations of the optimization process. More...
 
int nr
 Number of robots. More...
 
int ob
 Number of obstacles. More...
 
vector< bool > regions
 Whether the regions of the robots are connected. More...
 
int rows
 Number of rows in the grid map. More...
 
bool success
 Whether the assignment succeeded. More...
 
map< string, int > uuid_map
 UUID mapping of CPSs. More...
 
double variate_weight
 Maximum variate weight of connected components. More...
 

Detailed Description

A class to divide the environment optimally among multiple cyber physical systems (CPSs).

Definition at line 18 of file lib/area_division.h.

Constructor & Destructor Documentation

◆ area_division()

area_division::area_division ( )

Constructor.

Definition at line 3 of file lib/area_division.cpp.

Member Function Documentation

◆ assign()

void area_division::assign ( vector< valarray< double >>  matrix)
private

Define the assignment matrix based on a given distance metric matrix.

Parameters
matrixA matrix of distance metrics.

Definition at line 196 of file lib/area_division.cpp.

◆ CalcConnectedMultiplier()

valarray< float > area_division::CalcConnectedMultiplier ( valarray< float >  dist1,
valarray< float >  dist2 
)
private

Calculate the connected multiplier.

Parameters
dist1
dist2
Returns
The connected multiplier array.

Definition at line 265 of file lib/area_division.cpp.

◆ divide()

void area_division::divide ( )

Perform the area division.

Definition at line 12 of file lib/area_division.cpp.

◆ FinalUpdateOnMetricMatrix()

valarray< double > area_division::FinalUpdateOnMetricMatrix ( double  CM,
valarray< double >  curentONe,
valarray< float >  CC 
)
private

Update the metric matrix.

Parameters
CMCorrection multiplier.
curentONeCurrent metric matrix.
CCConnected multiplier array.
Returns
The updated metric matrix.

Definition at line 231 of file lib/area_division.cpp.

◆ get_grid()

nav_msgs::OccupancyGrid area_division::get_grid ( nav_msgs::OccupancyGrid  map,
string  cps 
)

Get the region assigned to a CPS.

Parameters
mapOriginal grid map.
cpsUUID of the CPS.
Returns
Grid map which contains obstacles in cells assigned to the CPS.

Definition at line 130 of file lib/area_division.cpp.

◆ initialize_cps()

void area_division::initialize_cps ( map< string, vector< int >>  cpss)

Define the CPS positions.

Parameters
cpssMapping from UUIDs to positions of the CPSs.

Definition at line 155 of file lib/area_division.cpp.

◆ initialize_map()

void area_division::initialize_map ( int  r,
int  c,
vector< signed char >  src 
)

Define the grid map.

Parameters
rNumber of rows in the grid map.
cNumber of columns in the grid map.
srcGrid map describing the environment in the ROS format.

Definition at line 187 of file lib/area_division.cpp.

◆ isThisAGoalState()

bool area_division::isThisAGoalState ( int  thres)
private

Check if the areas assigned to each robot are of similar size.

Parameters
thresThe maximum number of grid cells that the areas assigned to different robots is allowed to differ.
Returns
True, if the maximum assigned area to any robot is at most thresh larger than the minimum assigned area to any robot, false otherwise.

Definition at line 243 of file lib/area_division.cpp.

Member Data Documentation

◆ A

valarray<int> area_division::A
private

Area assignment matrix.

Definition at line 137 of file lib/area_division.h.

◆ ArrayOfElements

vector<int> area_division::ArrayOfElements
private

Grid cells not assigned to the robots.

Definition at line 142 of file lib/area_division.h.

◆ BWlist

vector<valarray<int> > area_division::BWlist
private

A binary array for each CPS which indicates free space.

Definition at line 132 of file lib/area_division.h.

◆ cols

int area_division::cols
private

Number of columns in the grid map.

Definition at line 97 of file lib/area_division.h.

◆ cps

vector<vector<int> > area_division::cps
private

Positions of the CPSs.

Definition at line 122 of file lib/area_division.h.

◆ discr

int area_division::discr
private

Maximum difference between number of assigned grid cells to each CPS.

Definition at line 157 of file lib/area_division.h.

◆ gridmap

vector<signed char> area_division::gridmap
private

The environment grid map. Robots are represented by 2, obstacles by 1/-2, empty cells by -1.

Definition at line 117 of file lib/area_division.h.

◆ max_iter

int area_division::max_iter
private

Maximum number of iterations of the optimization process.

Definition at line 112 of file lib/area_division.h.

◆ nr

int area_division::nr
private

Number of robots.

Definition at line 102 of file lib/area_division.h.

◆ ob

int area_division::ob
private

Number of obstacles.

Definition at line 107 of file lib/area_division.h.

◆ regions

vector<bool> area_division::regions
private

Whether the regions of the robots are connected.

Definition at line 147 of file lib/area_division.h.

◆ rows

int area_division::rows
private

Number of rows in the grid map.

Definition at line 92 of file lib/area_division.h.

◆ success

bool area_division::success
private

Whether the assignment succeeded.

Definition at line 152 of file lib/area_division.h.

◆ uuid_map

map<string, int> area_division::uuid_map
private

UUID mapping of CPSs.

Definition at line 127 of file lib/area_division.h.

◆ variate_weight

double area_division::variate_weight
private

Maximum variate weight of connected components.

Definition at line 87 of file lib/area_division.h.


The documentation for this class was generated from the following files:


area_division
Author(s): Micha Sende
autogenerated on Thu Oct 31 2019 09:22:46