\hypertarget{waddress__functions_8hpp_source}{}\doxysection{waddress\+\_\+functions.\+hpp}
\mbox{\hyperlink{waddress__functions_8hpp}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{12 \textcolor{preprocessor}{\#ifndef \_WADDRESS\_FUNCTIONS\_H\_}}
\DoxyCodeLine{13 \textcolor{preprocessor}{\#define \_WADDRESS\_FUNCTIONS\_H\_}}
\DoxyCodeLine{14 }
\DoxyCodeLine{15 \textcolor{preprocessor}{\#include <string>}}
\DoxyCodeLine{16 \textcolor{preprocessor}{\#include <iostream>}}
\DoxyCodeLine{17 \textcolor{preprocessor}{\#include <math.h>}}
\DoxyCodeLine{18 }
\DoxyCodeLine{19 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{WarehousePickingOpt_8h}{WarehousePickingOpt.h}}"{}}}
\DoxyCodeLine{20 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{helper_8h}{helper.h}}"{}}}
\DoxyCodeLine{21 }
\DoxyCodeLine{22 \textcolor{keyword}{typedef} struct : \textcolor{keyword}{public} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}}}
\DoxyCodeLine{23 \{}
\DoxyCodeLine{24     \textcolor{keywordtype}{int} current\_weight = 0;}
\DoxyCodeLine{25 \} \mbox{\hyperlink{structGRAPH__POINT__T}{GRAPH\_POINT\_T}};}
\DoxyCodeLine{26 }
\DoxyCodeLine{28 \textcolor{keyword}{namespace }\mbox{\hyperlink{namespacesecV}{secV}}}
\DoxyCodeLine{29 \{}
\DoxyCodeLine{30     \textcolor{comment}{// V sector set up}}
\DoxyCodeLine{31     \textcolor{comment}{// TODO not sure about all these values}}
\DoxyCodeLine{32     \textcolor{keyword}{const} \textcolor{keywordtype}{float} x\_offset = 25.0; \textcolor{comment}{// 2.5 meters from fictional left axis to the fictional corridor (at left)}}
\DoxyCodeLine{33     \textcolor{keyword}{const} \textcolor{keywordtype}{float} y\_offset = 0.0;  \textcolor{comment}{// V addresses are at the top of the area -\/ so zero offset set up}}
\DoxyCodeLine{34     \textcolor{keyword}{const} \textcolor{keywordtype}{float} horizontal\_corridor\_width = 24.0,}
\DoxyCodeLine{35                 middle\_vertical\_cor\_width = 37.0, \textcolor{comment}{// middle and side-\/middle vertical corridors are of the same width as in G sector (also in the same place)}}
\DoxyCodeLine{36         side\_middle\_vertical\_cor\_width = 31.0,}
\DoxyCodeLine{37                 side\_side\_vertical\_cor\_width = 5.0;}
\DoxyCodeLine{38 }
\DoxyCodeLine{39     \textcolor{keyword}{const} \textcolor{keywordtype}{float} small\_cell\_depth = 4.0f,}
\DoxyCodeLine{40                 big\_cell\_depth = 6.0f,}
\DoxyCodeLine{41                 pallet\_cell\_depth = 12.0f,}
\DoxyCodeLine{42                 big\_cell\_width = 13.0f,}
\DoxyCodeLine{43                 small\_cell\_width = 1.3f,}
\DoxyCodeLine{44                 pallet\_cell\_width = 10.0f;}
\DoxyCodeLine{45 }
\DoxyCodeLine{46     \textcolor{comment}{// the row (Y coordinate, but in addresse's format), which is first in the opposite of another row -\/> so there is a horizontal corridor between them}}
\DoxyCodeLine{47     \textcolor{comment}{// for the better computation of distance while both addresses are in the same horizontal corridor but not with the same Y coord}}
\DoxyCodeLine{48     \textcolor{keyword}{const} \textcolor{keywordtype}{int} first\_row\_opposite = 0;}
\DoxyCodeLine{49 }
\DoxyCodeLine{50     \textcolor{keyword}{const} vector<int> vertical\_corridors = \{}
\DoxyCodeLine{51         (int)(x\_offset + side\_side\_vertical\_cor\_width * 0.5),                                                                                                                                \textcolor{comment}{// the most left}}
\DoxyCodeLine{52         (int)(x\_offset + side\_side\_vertical\_cor\_width + 10.0 * big\_cell\_width + side\_middle\_vertical\_cor\_width * 0.5),                                                                       \textcolor{comment}{// left from middle}}
\DoxyCodeLine{53         (int)(x\_offset + side\_side\_vertical\_cor\_width + (10 + 10) * big\_cell\_width + side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width * 0.5),                                      \textcolor{comment}{// middle}}
\DoxyCodeLine{54         (\textcolor{keywordtype}{int})(x\_offset + side\_side\_vertical\_cor\_width + (10 + 10 + 8) * big\_cell\_width + side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width + side\_middle\_vertical\_cor\_width * 0.5), \textcolor{comment}{// right from middle}}
\DoxyCodeLine{55         (int)(x\_offset + side\_side\_vertical\_cor\_width + (10 + 10 + 8 + 10) * big\_cell\_width + side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width + side\_middle\_vertical\_cor\_width + side\_side\_vertical\_cor\_width * 0.5)\};}
\DoxyCodeLine{56 }
\DoxyCodeLine{57     \textcolor{comment}{// FIXME 380 is not probably accurate...}}
\DoxyCodeLine{58     \textcolor{keyword}{const} vector<string> rows\_380\_celled = \{\textcolor{stringliteral}{"{}BB"{}}, \textcolor{stringliteral}{"{}DD"{}}\};}
\DoxyCodeLine{59 }
\DoxyCodeLine{60     \textcolor{keyword}{const} map<int, int> V\_East\_exits = \{}
\DoxyCodeLine{61         \{vertical\_corridors[4], y\_offset + pallet\_cell\_depth + horizontal\_corridor\_width * 0.5\},}
\DoxyCodeLine{62         \{vertical\_corridors[4], y\_offset + pallet\_cell\_depth + horizontal\_corridor\_width + small\_cell\_depth + big\_cell\_depth + horizontal\_corridor\_width * 0.5\},}
\DoxyCodeLine{63         \{vertical\_corridors[4], y\_offset + pallet\_cell\_depth + 2 * horizontal\_corridor\_width + 2 * small\_cell\_depth + 2 * big\_cell\_depth + horizontal\_corridor\_width * 0.5\},}
\DoxyCodeLine{64     \};}
\DoxyCodeLine{65 }
\DoxyCodeLine{66     \textcolor{keyword}{const} \textcolor{keywordtype}{int} y\_for\_south\_exits = y\_offset + pallet\_cell\_depth + 2 * horizontal\_corridor\_width + 2 * small\_cell\_depth + 2 * big\_cell\_depth + horizontal\_corridor\_width * 0.5;}
\DoxyCodeLine{67     \textcolor{keyword}{const} map<int, int> V\_South\_exits = \{}
\DoxyCodeLine{68         \{vertical\_corridors[1], y\_for\_south\_exits\},}
\DoxyCodeLine{69         \{vertical\_corridors[2], y\_for\_south\_exits\},}
\DoxyCodeLine{70         \{vertical\_corridors[3], y\_for\_south\_exits\}\};}
\DoxyCodeLine{71 \}}
\DoxyCodeLine{72 }
\DoxyCodeLine{74 \textcolor{keyword}{namespace }\mbox{\hyperlink{namespacesecG}{secG}}}
\DoxyCodeLine{75 \{}
\DoxyCodeLine{76     \textcolor{comment}{// G sector set up}}
\DoxyCodeLine{77     \textcolor{keyword}{const} \textcolor{keywordtype}{float} x\_offset = 40.0;                   \textcolor{comment}{// 4 meters from fictional left axis to the first vertical corridor}}
\DoxyCodeLine{78     \textcolor{keyword}{const} \textcolor{keywordtype}{float} y\_offset = 130.0 + secV::y\_offset; \textcolor{comment}{/*to the 00 row*/}}
\DoxyCodeLine{79     \textcolor{keyword}{const} \textcolor{keywordtype}{float} horizontal\_corridor\_width = 16.0,}
\DoxyCodeLine{80                 middle\_vertical\_cor\_width = 37.0,}
\DoxyCodeLine{81                 side\_middle\_vertical\_cor\_width = 31.0,}
\DoxyCodeLine{82                 side\_side\_vertical\_cor\_width = 20.0;}
\DoxyCodeLine{83 }
\DoxyCodeLine{84     \textcolor{keyword}{const} \textcolor{keywordtype}{float} cell\_depth = 4.0f,}
\DoxyCodeLine{85                 big\_cell\_width = 13.0f,}
\DoxyCodeLine{86                 small\_cell\_width = 1.6f;}
\DoxyCodeLine{87 }
\DoxyCodeLine{88     \textcolor{keyword}{const} vector<int> vertical\_corridors = \{}
\DoxyCodeLine{89         (int)(x\_offset + side\_side\_vertical\_cor\_width * 0.5),                                                                                                                               \textcolor{comment}{// the most left}}
\DoxyCodeLine{90         (int)(x\_offset + side\_side\_vertical\_cor\_width + 7.0 * big\_cell\_width + side\_middle\_vertical\_cor\_width * 0.5),                                                                       \textcolor{comment}{// left from middle}}
\DoxyCodeLine{91         (int)(x\_offset + side\_side\_vertical\_cor\_width + (7 + 10) * big\_cell\_width + side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width * 0.5),                                      \textcolor{comment}{// middle}}
\DoxyCodeLine{92         (\textcolor{keywordtype}{int})(x\_offset + side\_side\_vertical\_cor\_width + (7 + 10 + 7) * big\_cell\_width + side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width + side\_middle\_vertical\_cor\_width * 0.5), \textcolor{comment}{// right from middle}}
\DoxyCodeLine{93         (int)(x\_offset + side\_side\_vertical\_cor\_width + (7 + 10 + 7) * big\_cell\_width + side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width + side\_middle\_vertical\_cor\_width + 7.0 * big\_cell\_width + side\_side\_vertical\_cor\_width * 0.5)\};}
\DoxyCodeLine{94     \textcolor{keyword}{const} vector<int> rows\_246\_celled = \{0, 1, 2, 3, 36, 37, 38, 39, 40\};}
\DoxyCodeLine{95 }
\DoxyCodeLine{96     \textcolor{comment}{// the row (Y coordinate, but in addresse's format), which is first in the opposite of another row -\/> so there is a horizontal corridor between them}}
\DoxyCodeLine{97     \textcolor{comment}{// for the better computation of distance while both addresses are in the same horizontal corridor but not with the same Y coord}}
\DoxyCodeLine{98     \textcolor{keyword}{const} \textcolor{keywordtype}{int} first\_row\_opposite = 1;}
\DoxyCodeLine{99 }
\DoxyCodeLine{100     \textcolor{comment}{// exits of sector G}}
\DoxyCodeLine{101     \textcolor{comment}{// these coordinates should fit the exits of G sector towards the V sector}}
\DoxyCodeLine{102     \textcolor{keyword}{const} \mbox{\hyperlink{structGRAPH__POINT__T}{GRAPH\_POINT\_T}} G\_north\_exit = \{\textcolor{stringliteral}{"{}G00"{}}, (int)y\_offset, 0, 545 + (\textcolor{keywordtype}{int})x\_offset\};}
\DoxyCodeLine{103     \textcolor{keyword}{const} \mbox{\hyperlink{structGRAPH__POINT__T}{GRAPH\_POINT\_T}} G\_lower\_exit = \{\textcolor{stringliteral}{"{}G00"{}}, (int)(y\_offset + 448 + 24 + 24), 0, vertical\_corridors[4] + (int)(side\_side\_vertical\_cor\_width * 0.5)\};}
\DoxyCodeLine{104 \}}
\DoxyCodeLine{105 }
\DoxyCodeLine{107 \textcolor{keyword}{namespace }\mbox{\hyperlink{namespacesecP}{secP}}}
\DoxyCodeLine{108 \{}
\DoxyCodeLine{109     \textcolor{comment}{// P sector set up}}
\DoxyCodeLine{110     \textcolor{comment}{// notice, that P sector is turned by 90 degrees (so rows -\/> columns) against G sector}}
\DoxyCodeLine{111     \textcolor{keyword}{const} \textcolor{keywordtype}{float} x\_offset = 714.0 + secG::x\_offset; \textcolor{comment}{// to the first cell from left site}}
\DoxyCodeLine{112     \textcolor{keyword}{const} \textcolor{keywordtype}{float} y\_offset = 115.0 + secV::y\_offset;}
\DoxyCodeLine{113     \textcolor{keyword}{const} \textcolor{keywordtype}{float} horizontal\_corridor\_width = 20.0, \textcolor{comment}{// width of the only one horizontal corridor}}
\DoxyCodeLine{114         vertical\_cor\_width = 34.0;}
\DoxyCodeLine{115 }
\DoxyCodeLine{116     \textcolor{keyword}{const} \textcolor{keywordtype}{float} cell\_depth = 10.0f,}
\DoxyCodeLine{117                 cell\_width = 9.5f; \textcolor{comment}{// note: measured vertically; it is with of one cell of four, which are in the once visible block}}
\DoxyCodeLine{118 }
\DoxyCodeLine{119     \textcolor{comment}{// definition of only three corridors}}
\DoxyCodeLine{120     \textcolor{comment}{// defining X coordinates of them}}
\DoxyCodeLine{121     \textcolor{comment}{// the rest is neglected, because of the small difference when computing the distance of the far cells of the P sector}}
\DoxyCodeLine{122     \textcolor{keyword}{const} vector<int> vertical\_corridors = \{}
\DoxyCodeLine{123         (int)(x\_offset), \textcolor{comment}{// corridor that is along the 00 column}}
\DoxyCodeLine{124         (int)(x\_offset + 2 * cell\_depth + vertical\_cor\_width * 0.5),}
\DoxyCodeLine{125         (int)(x\_offset + 4 * cell\_depth + vertical\_cor\_width * 1.5),}
\DoxyCodeLine{126         (int)(x\_offset + 6 * cell\_depth + vertical\_cor\_width * 2.5)\};}
\DoxyCodeLine{127 }
\DoxyCodeLine{128     \textcolor{comment}{// defining Y coordinates}}
\DoxyCodeLine{129     \textcolor{keyword}{const} vector<int> horizontal\_cooridors = \{}
\DoxyCodeLine{130         (int)(y\_offset),}
\DoxyCodeLine{131         (int)(y\_offset + 48 * cell\_width + 0.5 * horizontal\_corridor\_width),}
\DoxyCodeLine{132         (int)(y\_offset + 48 * cell\_width + horizontal\_corridor\_width + 10 * cell\_width + 0.5 * horizontal\_corridor\_width)\};}
\DoxyCodeLine{133 }
\DoxyCodeLine{134     \textcolor{comment}{// the row (X coordinate, but in addresse's format), which is first in the opposite of another column -\/> so there is a vertical corridor between them}}
\DoxyCodeLine{135     \textcolor{comment}{// for the better computation of distance while both addresses are in the same vertical corridor but not with the same X coord}}
\DoxyCodeLine{136     \textcolor{keyword}{const} \textcolor{keywordtype}{int} first\_column\_opposite = 1;}
\DoxyCodeLine{137 }
\DoxyCodeLine{138     \textcolor{comment}{// exits of sector P}}
\DoxyCodeLine{139     \textcolor{comment}{// these coordinates should fit the exits of P sector towards the G (GP) sector}}
\DoxyCodeLine{140     \textcolor{keyword}{const} \mbox{\hyperlink{structGRAPH__POINT__T}{GRAPH\_POINT\_T}} P\_middle\_exit = \{\textcolor{stringliteral}{"{}P00"{}}, (int)horizontal\_cooridors[0], 0, (\textcolor{keywordtype}{int})x\_offset\};}
\DoxyCodeLine{141 }
\DoxyCodeLine{142     \textcolor{keyword}{const} \mbox{\hyperlink{structGRAPH__POINT__T}{GRAPH\_POINT\_T}} P\_north\_exit = \{\textcolor{stringliteral}{"{}P00"{}}, (int)y\_offset, 0, (\textcolor{keywordtype}{int})x\_offset\};}
\DoxyCodeLine{143 }
\DoxyCodeLine{144     \textcolor{keyword}{const} \mbox{\hyperlink{structGRAPH__POINT__T}{GRAPH\_POINT\_T}} P\_south\_exit = \{\textcolor{stringliteral}{"{}P00"{}}, (int)y\_offset + 683, 0, (\textcolor{keywordtype}{int})x\_offset\};}
\DoxyCodeLine{145 \}}
\DoxyCodeLine{146 }
\DoxyCodeLine{148 \textcolor{keyword}{namespace }\mbox{\hyperlink{namespacesecGP}{secGP}}}
\DoxyCodeLine{149 \{}
\DoxyCodeLine{150     \textcolor{comment}{// GP sector set up // TODO find the real layout}}
\DoxyCodeLine{151     \textcolor{comment}{// notice, that GP sector is turned by 90 degrees (so rows -\/> columns) against G sector}}
\DoxyCodeLine{152     \textcolor{keyword}{const} \textcolor{keywordtype}{float} x\_offset = 545.0 + secG::x\_offset;}
\DoxyCodeLine{153     \textcolor{keyword}{const} \textcolor{keywordtype}{float} y\_offset = 134.0 + secG::y\_offset;}
\DoxyCodeLine{154     \textcolor{keyword}{const} \textcolor{keywordtype}{float} horizontal\_corridor\_width = 32.0,}
\DoxyCodeLine{155                 vertical\_cor\_width = 18.0;}
\DoxyCodeLine{156 }
\DoxyCodeLine{157     \textcolor{keyword}{const} \textcolor{keywordtype}{float} cell\_gap = 2.9f, \textcolor{comment}{// the gap between some cells (according to the real layout)}}
\DoxyCodeLine{158         cell\_depth = 6.0f,}
\DoxyCodeLine{159                 cell\_width = 11.7f; \textcolor{comment}{// the average of two types below, computed according to the layout of the column}}
\DoxyCodeLine{160                                     \textcolor{comment}{// first\_type\_cell\_width = 10.0f,// the real widths, not used, just approximated}}
\DoxyCodeLine{161                                     \textcolor{comment}{// second\_type\_cell\_width = 13.0f;}}
\DoxyCodeLine{162 }
\DoxyCodeLine{163     \textcolor{keyword}{const} vector<int> vertical\_corridors = \{}
\DoxyCodeLine{164         (int)(x\_offset + cell\_depth + vertical\_cor\_width * 0.5), \textcolor{comment}{// corridor that is along the 00 column}}
\DoxyCodeLine{165         (int)(x\_offset + 2 * cell\_depth + vertical\_cor\_width * 1.5),}
\DoxyCodeLine{166         (int)(x\_offset + 4 * cell\_depth + vertical\_cor\_width * 2.5)\};}
\DoxyCodeLine{167 }
\DoxyCodeLine{168     \textcolor{keyword}{const} vector<int> horizontal\_corridors = \{}
\DoxyCodeLine{169         (int)(y\_offset -\/ 0.5 * horizontal\_corridor\_width),}
\DoxyCodeLine{170         (int)(y\_offset + 6 * cell\_width + 2 * cell\_gap + 0.5 * horizontal\_corridor\_width),}
\DoxyCodeLine{171         (int)(y\_offset + 26 * cell\_width + 13 * cell\_gap + 1.5 * horizontal\_corridor\_width)\};}
\DoxyCodeLine{172 }
\DoxyCodeLine{173     \textcolor{keyword}{const} \textcolor{keywordtype}{int} first\_column\_opposite = 1;}
\DoxyCodeLine{174 }
\DoxyCodeLine{175     \textcolor{keyword}{const} vector<SECTOR\_ADDR\_T> GP\_exits = \{}
\DoxyCodeLine{176         \{\textcolor{stringliteral}{"{}GP0"{}}, horizontal\_corridors[0], 0, (int)(vertical\_corridors[2] + vertical\_cor\_width * 0.5 + 30)\},}
\DoxyCodeLine{177         \{\textcolor{stringliteral}{"{}GP0"{}}, horizontal\_corridors[1], 0, (int)(vertical\_corridors[2] + vertical\_cor\_width * 0.5 + 30)\},}
\DoxyCodeLine{178         \{\textcolor{stringliteral}{"{}GP0"{}}, horizontal\_corridors[2], 0, (int)(vertical\_corridors[2] + vertical\_cor\_width * 0.5 + 30)\},}
\DoxyCodeLine{179     \};}
\DoxyCodeLine{180 \}}
\DoxyCodeLine{181 }
\DoxyCodeLine{183 \textcolor{comment}{// original information unchanged (no recomputing or some mathematical changing)}}
\DoxyCodeLine{184 \textcolor{keyword}{inline} \textcolor{keyword}{namespace }\mbox{\hyperlink{namespacever1}{ver1}}}
\DoxyCodeLine{185 \{}
\DoxyCodeLine{186     \textcolor{keyword}{inline} \textcolor{keyword}{namespace }mapping}
\DoxyCodeLine{187     \{}
\DoxyCodeLine{188         \textcolor{keyword}{inline} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} G\_SectorMapping(\textcolor{keywordtype}{string} raw\_addr)}
\DoxyCodeLine{189         \{}
\DoxyCodeLine{190             \textcolor{comment}{// create the structure for address}}
\DoxyCodeLine{191             \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} parsed\_addr;}
\DoxyCodeLine{192             \textcolor{comment}{// load each part of address using substring function}}
\DoxyCodeLine{193             parsed\_addr.section = raw\_addr.substr(0, 3);}
\DoxyCodeLine{194             parsed\_addr.y\_coord = stoi(raw\_addr.substr(3, 2));}
\DoxyCodeLine{195             parsed\_addr.z\_coord = stoi(raw\_addr.substr(5, 2));}
\DoxyCodeLine{196             parsed\_addr.x\_coord = stoi(raw\_addr.substr(7, 3));}
\DoxyCodeLine{197 }
\DoxyCodeLine{198             \textcolor{keywordflow}{return} parsed\_addr;}
\DoxyCodeLine{199         \}}
\DoxyCodeLine{200         \textcolor{keyword}{inline} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} GP\_SectorMapping(\textcolor{keywordtype}{string} raw\_addr)}
\DoxyCodeLine{201         \{}
\DoxyCodeLine{202             \textcolor{comment}{// same process as by G\_Sector}}
\DoxyCodeLine{203             \textcolor{keywordflow}{return} G\_SectorMapping(raw\_addr);}
\DoxyCodeLine{204         \}}
\DoxyCodeLine{205         \textcolor{keyword}{inline} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} P\_SectorMapping(\textcolor{keywordtype}{string} raw\_addr)}
\DoxyCodeLine{206         \{}
\DoxyCodeLine{207             \textcolor{comment}{// same process as by G\_Sector}}
\DoxyCodeLine{208             \textcolor{keywordflow}{return} G\_SectorMapping(raw\_addr);}
\DoxyCodeLine{209         \}}
\DoxyCodeLine{210         \textcolor{keyword}{inline} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} V\_SectorMapping(\textcolor{keywordtype}{string} raw\_addr)}
\DoxyCodeLine{211         \{}
\DoxyCodeLine{212             (void)raw\_addr;}
\DoxyCodeLine{213             \textcolor{comment}{// TODO}}
\DoxyCodeLine{214             \textcolor{keywordflow}{return} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}}();}
\DoxyCodeLine{215         \}}
\DoxyCodeLine{216     \}}
\DoxyCodeLine{217     \textcolor{keyword}{inline} \textcolor{keyword}{namespace }measuring}
\DoxyCodeLine{218     \{}
\DoxyCodeLine{219         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} \mbox{\hyperlink{namespacever1_a44d9fe10b533d741260808ce1e14893f}{getDistanceInSectorG}}(\mbox{\hyperlink{classWAddress}{WAddress}} first\_addr, \mbox{\hyperlink{classWAddress}{WAddress}} second\_addr)}
\DoxyCodeLine{220         \{}
\DoxyCodeLine{221             \textcolor{comment}{// the numbers of cells, between which there is a corridor}}
\DoxyCodeLine{222             \textcolor{comment}{// as corridors are not numbered, then the number is between the number of neighbouring cells}}
\DoxyCodeLine{223             \textcolor{keyword}{const} vector<float> vertical\_corridors\{7.5, 17.5, 24.5\};}
\DoxyCodeLine{224             \textcolor{keyword}{const} vector<int> horizontal\_corridors\{\};}
\DoxyCodeLine{225             \textcolor{comment}{// rows, which has 1-\/246 cells (the rest has 1-\/31)}}
\DoxyCodeLine{226             \textcolor{keyword}{const} vector<int> rows\_of\_246\_cells\{0, 1, 40\};}
\DoxyCodeLine{227 }
\DoxyCodeLine{228             \textcolor{comment}{// if first\_addr or second\_addr is addresses in 0th or 1st or 40th row, then recalculate its cell-\/value (x axis)}}
\DoxyCodeLine{229             \textcolor{comment}{// cause the rest of rows are each of 1-\/31 cells but in the rows mentioned above are each of 1-\/246 cells}}
\DoxyCodeLine{230             \textcolor{comment}{// this knowledge is stored in these booleans}}
\DoxyCodeLine{231             \textcolor{keywordtype}{bool} first\_addr\_has\_246\_cells = \textcolor{keyword}{false}, second\_addr\_has\_246\_cells = \textcolor{keyword}{false};}
\DoxyCodeLine{232             \textcolor{keywordflow}{if} (find(rows\_of\_246\_cells.begin(), rows\_of\_246\_cells.end(), first\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().y\_coord) != rows\_of\_246\_cells.end())}
\DoxyCodeLine{233             \{}
\DoxyCodeLine{234                 \textcolor{comment}{// the row has 246 cells}}
\DoxyCodeLine{235                 \textcolor{comment}{// 1 cell in 31-\/celled-\/row is 8 cells in 246-\/celled-\/row}}
\DoxyCodeLine{237 \textcolor{comment}{}                first\_addr\_has\_246\_cells = \textcolor{keyword}{true};}
\DoxyCodeLine{238             \}}
\DoxyCodeLine{239 }
\DoxyCodeLine{240             \textcolor{keywordflow}{if} (find(rows\_of\_246\_cells.begin(), rows\_of\_246\_cells.end(), second\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().y\_coord) != rows\_of\_246\_cells.end())}
\DoxyCodeLine{241             \{}
\DoxyCodeLine{242                 second\_addr\_has\_246\_cells = \textcolor{keyword}{true};}
\DoxyCodeLine{243             \}}
\DoxyCodeLine{244 }
\DoxyCodeLine{245             \textcolor{comment}{// do the pattern (it is for the euclidean space)}}
\DoxyCodeLine{246             \textcolor{comment}{// THERE IS STORED THE FINAL DISTANCE}}
\DoxyCodeLine{247             \textcolor{keywordtype}{float} distance = 0;}
\DoxyCodeLine{248 }
\DoxyCodeLine{249             \textcolor{comment}{// THERE IS STORED THE USED CORRIDOR (the nearest to the first address)}}
\DoxyCodeLine{250             \textcolor{keywordtype}{float} used\_corridor = -\/1; \textcolor{comment}{// -\/1 ... unset}}
\DoxyCodeLine{251 }
\DoxyCodeLine{252             \textcolor{comment}{// DISTANCE TO THE NEAREST CORRIDOT from first address}}
\DoxyCodeLine{253             \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} corridor : vertical\_corridors)}
\DoxyCodeLine{254             \{}
\DoxyCodeLine{255                 \textcolor{keywordtype}{float} tmp;}
\DoxyCodeLine{256                 \textcolor{keywordflow}{if} ((\textcolor{keywordtype}{float})first\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().x\_coord < corridor \&\& !first\_addr\_has\_246\_cells)}
\DoxyCodeLine{257                 \{}
\DoxyCodeLine{258                     \textcolor{comment}{// cell in row of 31 cells}}
\DoxyCodeLine{259                     used\_corridor = corridor;}
\DoxyCodeLine{260                     distance += abs((used\_corridor -\/ (\textcolor{keywordtype}{float})first\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().x\_coord));}
\DoxyCodeLine{261                     \textcolor{keywordflow}{break};}
\DoxyCodeLine{262                 \}}
\DoxyCodeLine{263                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((\textcolor{keywordtype}{float})first\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().x\_coord > vertical\_corridors.back() \&\& !first\_addr\_has\_246\_cells)}
\DoxyCodeLine{264                 \{}
\DoxyCodeLine{265                     \textcolor{comment}{// the cell number is greater then last (with highest number) corridor}}
\DoxyCodeLine{266                     \textcolor{comment}{// cell in row of 31 cells}}
\DoxyCodeLine{267                     used\_corridor = vertical\_corridors.back();}
\DoxyCodeLine{268                     distance += abs((used\_corridor -\/ (\textcolor{keywordtype}{float})first\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().x\_coord));}
\DoxyCodeLine{269                     \textcolor{keywordflow}{break};}
\DoxyCodeLine{270                 \}}
\DoxyCodeLine{271                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((tmp = (\textcolor{keywordtype}{float})first\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().x\_coord / 8.0) < corridor \&\& first\_addr\_has\_246\_cells)}
\DoxyCodeLine{272                 \{}
\DoxyCodeLine{273                     \textcolor{comment}{// cell in row of 246 cells -\/ has to be normalized}}
\DoxyCodeLine{274                     used\_corridor = corridor;}
\DoxyCodeLine{275                     distance += abs((used\_corridor -\/ tmp));}
\DoxyCodeLine{276                     \textcolor{keywordflow}{break};}
\DoxyCodeLine{277                 \}}
\DoxyCodeLine{278                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((tmp = (\textcolor{keywordtype}{float})first\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().x\_coord / 8.0) < corridor \&\& first\_addr\_has\_246\_cells)}
\DoxyCodeLine{279                 \{}
\DoxyCodeLine{280                     \textcolor{comment}{// the cell number is greater then last (with highest number) corridor}}
\DoxyCodeLine{281                     \textcolor{comment}{// cell in row of 246 cells -\/ has to be normalized}}
\DoxyCodeLine{282                     used\_corridor = vertical\_corridors.back();}
\DoxyCodeLine{283                     distance += abs((used\_corridor -\/ tmp));}
\DoxyCodeLine{284                     \textcolor{keywordflow}{break};}
\DoxyCodeLine{285                 \}}
\DoxyCodeLine{286             \}}
\DoxyCodeLine{287 }
\DoxyCodeLine{288             \textcolor{comment}{// VERTICAL DISTANCE BETWEEN THE two addresses (first\_addr and second\_addr)}}
\DoxyCodeLine{289             distance += abs((second\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().y\_coord -\/ first\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().y\_coord));}
\DoxyCodeLine{290 }
\DoxyCodeLine{291             \textcolor{comment}{// DISTANCE FROM THE CORRIDOR (stored above) TO THE SECOND ADDRESS}}
\DoxyCodeLine{292             \textcolor{keywordflow}{if} (!second\_addr\_has\_246\_cells)}
\DoxyCodeLine{293             \{}
\DoxyCodeLine{294                 \textcolor{comment}{// cell in row of 31 cells}}
\DoxyCodeLine{295                 distance += abs((used\_corridor -\/ (\textcolor{keywordtype}{float})second\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().x\_coord));}
\DoxyCodeLine{296             \}}
\DoxyCodeLine{297             \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (second\_addr\_has\_246\_cells)}
\DoxyCodeLine{298             \{}
\DoxyCodeLine{299                 \textcolor{comment}{// cell in row of 246 cells -\/ has to be normalized}}
\DoxyCodeLine{300                 distance += abs((used\_corridor -\/ (\textcolor{keywordtype}{float})second\_addr.\mbox{\hyperlink{classWAddress_a97374468d1664da4ccf06c48b8ab9d79}{getWarehouseWAddress}}().x\_coord / 8.0));}
\DoxyCodeLine{301             \}}
\DoxyCodeLine{302 }
\DoxyCodeLine{303             \textcolor{comment}{// return the final distance between}}
\DoxyCodeLine{304             \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{305         \}}
\DoxyCodeLine{306     \}}
\DoxyCodeLine{307 \}}
\DoxyCodeLine{308 }
\DoxyCodeLine{310 \textcolor{keyword}{inline} \textcolor{keyword}{namespace }\mbox{\hyperlink{namespacever2}{ver2}}}
\DoxyCodeLine{311 \{}
\DoxyCodeLine{312     \textcolor{keyword}{inline} \textcolor{keyword}{namespace }mapping}
\DoxyCodeLine{313     \{}
\DoxyCodeLine{314         \textcolor{keyword}{inline} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} GP\_SectorMapping(\textcolor{keywordtype}{string} raw\_addr)}
\DoxyCodeLine{315         \{}
\DoxyCodeLine{316             \textcolor{comment}{// TODO this mapping IS NOT PERFECT, there are place for enhance}}
\DoxyCodeLine{317             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecGP}{secGP}};}
\DoxyCodeLine{318 }
\DoxyCodeLine{319             \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} parsed\_addr;}
\DoxyCodeLine{320 \textcolor{comment}{            /****** GP sector mapping *******/}}
\DoxyCodeLine{321             \textcolor{comment}{// NOTE: SEE DWG FILE FOR BETTER UNDERSTANDING}}
\DoxyCodeLine{322 }
\DoxyCodeLine{323             \textcolor{comment}{// X coord -\/> column}}
\DoxyCodeLine{324             \textcolor{keywordtype}{float} x\_tmp = stof(raw\_addr.substr(3, 2));}
\DoxyCodeLine{325             parsed\_addr.x\_coord\_original = x\_tmp; \textcolor{comment}{// ORIDINAL PART}}
\DoxyCodeLine{326             \textcolor{comment}{// note: columns start from 01}}
\DoxyCodeLine{327             parsed\_addr.x\_coord = x\_offset + x\_tmp * cell\_depth + (x\_tmp -\/ 1) * vertical\_cor\_width;}
\DoxyCodeLine{328             parsed\_addr.x\_coord -\/= (x\_tmp == 3 || x\_tmp == 5) ? cell\_depth : 0;         \textcolor{comment}{// correction according to the real layout and real possible of approach to the cells for picking}}
\DoxyCodeLine{329             parsed\_addr.x\_coord -\/= (x\_tmp == 4 || x\_tmp == 5) ? vertical\_cor\_width : 0; \textcolor{comment}{// correction according to the real layout and real possible of approach to the cells for picking}}
\DoxyCodeLine{330 }
\DoxyCodeLine{331             \textcolor{comment}{// Z coord -\/> stays as it is}}
\DoxyCodeLine{332             parsed\_addr.z\_coord = stoi(raw\_addr.substr(5, 2));}
\DoxyCodeLine{333             parsed\_addr.z\_coord\_original = parsed\_addr.z\_coord; \textcolor{comment}{// ORIDINAL PART}}
\DoxyCodeLine{334 }
\DoxyCodeLine{335             \textcolor{comment}{// Y coord -\/> row}}
\DoxyCodeLine{336             \textcolor{comment}{// if the row is of 246 cells then}}
\DoxyCodeLine{337             \textcolor{keywordtype}{float} y\_tmp = stof(raw\_addr.substr(7, 3));}
\DoxyCodeLine{338             parsed\_addr.y\_coord\_original = y\_tmp; \textcolor{comment}{// ORIDINAL PART}}
\DoxyCodeLine{339             parsed\_addr.y\_coord = y\_offset + y\_tmp * cell\_width + (y\_tmp / 2) * cell\_gap;}
\DoxyCodeLine{340             \textcolor{keywordflow}{if} (x\_tmp > 6)}
\DoxyCodeLine{341                 parsed\_addr.y\_coord += horizontal\_corridor\_width;}
\DoxyCodeLine{342 }
\DoxyCodeLine{343             \textcolor{comment}{// return of the parsed (mapped) address}}
\DoxyCodeLine{344             \textcolor{keywordflow}{return} parsed\_addr;}
\DoxyCodeLine{345         \}}
\DoxyCodeLine{346 }
\DoxyCodeLine{347         \textcolor{keyword}{inline} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} G\_SectorMapping(\textcolor{keywordtype}{string} raw\_addr)}
\DoxyCodeLine{348         \{}
\DoxyCodeLine{349             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecG}{secG}};}
\DoxyCodeLine{350 }
\DoxyCodeLine{351             \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} parsed\_addr;}
\DoxyCodeLine{352 \textcolor{comment}{            /****** G sector mapping *******/}}
\DoxyCodeLine{353 }
\DoxyCodeLine{354             \textcolor{comment}{// Y coord -\/> row}}
\DoxyCodeLine{355             \textcolor{keywordtype}{float} y\_tmp = stof(raw\_addr.substr(3, 2));}
\DoxyCodeLine{356             parsed\_addr.y\_coord\_original = y\_tmp; \textcolor{comment}{// ORIDINAL PART}}
\DoxyCodeLine{357             \textcolor{comment}{// parsed\_addr.y\_coord = ((int)(row\_tmp / 2) * horizontal\_corridor\_width) + (row\_tmp * cell\_depth) + y\_offset + ((int)row\_tmp == 0 ? 0.0 : cell\_depth) /*for the 00 row*/;}}
\DoxyCodeLine{358             parsed\_addr.y\_coord = y\_offset;}
\DoxyCodeLine{359             parsed\_addr.y\_coord += round((y\_tmp -\/ 0.3) / 2) * horizontal\_corridor\_width;}
\DoxyCodeLine{360             parsed\_addr.y\_coord += ((int)y\_tmp \% 2 == 0) ? (y\_tmp * cell\_depth) : (y\_tmp * cell\_depth + cell\_depth);}
\DoxyCodeLine{361             \textcolor{comment}{// Z coord -\/> stays as it is}}
\DoxyCodeLine{362             parsed\_addr.z\_coord = stoi(raw\_addr.substr(5, 2));}
\DoxyCodeLine{363             parsed\_addr.z\_coord\_original = parsed\_addr.z\_coord; \textcolor{comment}{// ORIDINAL PART}}
\DoxyCodeLine{364             \textcolor{comment}{// X coord -\/> column}}
\DoxyCodeLine{365             \textcolor{keywordtype}{float} x\_tmp = stof(raw\_addr.substr(7, 3));}
\DoxyCodeLine{366             parsed\_addr.x\_coord\_original = x\_tmp; \textcolor{comment}{// ORIDINAL PART}}
\DoxyCodeLine{367             \textcolor{keywordflow}{if} (find(rows\_246\_celled.begin(), rows\_246\_celled.end(), y\_tmp) != rows\_246\_celled.end())}
\DoxyCodeLine{368             \{}
\DoxyCodeLine{369                 \textcolor{comment}{// if the row is of 246 cells then}}
\DoxyCodeLine{370 }
\DoxyCodeLine{371                 parsed\_addr.x\_coord = x\_offset + side\_side\_vertical\_cor\_width + x\_tmp * small\_cell\_width;}
\DoxyCodeLine{372                 \textcolor{keywordflow}{if} (x\_tmp > 192)}
\DoxyCodeLine{373                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width * 2 + middle\_vertical\_cor\_width;}
\DoxyCodeLine{374                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_tmp > 136)}
\DoxyCodeLine{375                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width;}
\DoxyCodeLine{376                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_tmp > 56)}
\DoxyCodeLine{377                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width;}
\DoxyCodeLine{378             \}}
\DoxyCodeLine{379             \textcolor{keywordflow}{else}}
\DoxyCodeLine{380             \{}
\DoxyCodeLine{381                 \textcolor{comment}{// if the row is of 31 cells}}
\DoxyCodeLine{382                 parsed\_addr.x\_coord = x\_offset + side\_side\_vertical\_cor\_width + x\_tmp * big\_cell\_width;}
\DoxyCodeLine{383                 \textcolor{keywordflow}{if} (x\_tmp > 24)}
\DoxyCodeLine{384                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width * 2 + middle\_vertical\_cor\_width;}
\DoxyCodeLine{385                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_tmp > 17)}
\DoxyCodeLine{386                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width;}
\DoxyCodeLine{387                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_tmp > 7)}
\DoxyCodeLine{388                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width;}
\DoxyCodeLine{389             \}}
\DoxyCodeLine{390 }
\DoxyCodeLine{391             \textcolor{comment}{// return of the parsed (mapped) address}}
\DoxyCodeLine{392             \textcolor{keywordflow}{return} parsed\_addr;}
\DoxyCodeLine{393         \}}
\DoxyCodeLine{394 }
\DoxyCodeLine{395         \textcolor{keyword}{inline} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} P\_SectorMapping(\textcolor{keywordtype}{string} raw\_addr)}
\DoxyCodeLine{396         \{}
\DoxyCodeLine{397             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecP}{secP}};}
\DoxyCodeLine{398 }
\DoxyCodeLine{399             \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} parsed\_addr;}
\DoxyCodeLine{400 \textcolor{comment}{            /****** P sector mapping *******/}}
\DoxyCodeLine{401 }
\DoxyCodeLine{402             \textcolor{comment}{// X coord -\/> column}}
\DoxyCodeLine{403             \textcolor{keywordtype}{float} x\_tmp = stof(raw\_addr.substr(3, 2));}
\DoxyCodeLine{404             parsed\_addr.x\_coord\_original = x\_tmp; \textcolor{comment}{// ORIDINAL PART}}
\DoxyCodeLine{405             parsed\_addr.x\_coord = x\_offset + round((x\_tmp -\/ 0.3) / 2) * vertical\_cor\_width;}
\DoxyCodeLine{406             parsed\_addr.x\_coord += ((int)x\_tmp \% 2 == 0) ? (x\_tmp * cell\_depth) : (x\_tmp * cell\_depth + cell\_depth);}
\DoxyCodeLine{407 }
\DoxyCodeLine{408             \textcolor{comment}{// Z coord -\/> stays as it is}}
\DoxyCodeLine{409             parsed\_addr.z\_coord = stoi(raw\_addr.substr(5, 2));}
\DoxyCodeLine{410             parsed\_addr.z\_coord\_original = parsed\_addr.z\_coord; \textcolor{comment}{// ORIDINAL PART}}
\DoxyCodeLine{411 }
\DoxyCodeLine{412             \textcolor{comment}{// Y coord -\/> row}}
\DoxyCodeLine{413             \textcolor{comment}{// if the row is of 246 cells then}}
\DoxyCodeLine{414             \textcolor{keywordtype}{float} y\_tmp = stof(raw\_addr.substr(7, 3));}
\DoxyCodeLine{415             parsed\_addr.y\_coord\_original = y\_tmp; \textcolor{comment}{// ORIDINAL PART}}
\DoxyCodeLine{416             parsed\_addr.y\_coord = y\_offset + (y\_tmp -\/ 0.3 / 4) * cell\_width + cell\_width;}
\DoxyCodeLine{417             \textcolor{keywordflow}{if} (x\_tmp > 48) \textcolor{comment}{// TODO after that cell is marked horizontal corridor -\/ BUT ONLY IN THIS CONFIGURATION, not sure if this is for real}}
\DoxyCodeLine{418                 parsed\_addr.y\_coord += horizontal\_corridor\_width;}
\DoxyCodeLine{419 }
\DoxyCodeLine{420             \textcolor{comment}{// return of the parsed (mapped) address}}
\DoxyCodeLine{421             \textcolor{keywordflow}{return} parsed\_addr;}
\DoxyCodeLine{422         \}}
\DoxyCodeLine{423 }
\DoxyCodeLine{424         \textcolor{keyword}{inline} \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} V\_SectorMapping(\textcolor{keywordtype}{string} raw\_addr)}
\DoxyCodeLine{425         \{}
\DoxyCodeLine{426             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecV}{secV}}; \textcolor{comment}{// the specification for sector V is used}}
\DoxyCodeLine{427 }
\DoxyCodeLine{428             \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} parsed\_addr;}
\DoxyCodeLine{429 \textcolor{comment}{            /****** V sector mapping *******/}}
\DoxyCodeLine{430 }
\DoxyCodeLine{431             \textcolor{comment}{// Y coord -\/> row}}
\DoxyCodeLine{432             \textcolor{keywordtype}{int} y\_coord = toupper(raw\_addr.substr(1, 1)[0]) -\/ (int)\textcolor{charliteral}{'A'}; \textcolor{comment}{// from 'VAA' -\/> 'A' -\/> 65, etc...}}
\DoxyCodeLine{433             parsed\_addr.y\_coord\_original = y\_coord;}
\DoxyCodeLine{434             parsed\_addr.y\_coord = y\_offset;}
\DoxyCodeLine{435             parsed\_addr.y\_coord += round((y\_coord + 0.3) / 2) * horizontal\_corridor\_width;}
\DoxyCodeLine{436             parsed\_addr.y\_coord += pallet\_cell\_depth + (y\_coord > 0) ? ((round((y\_coord + 0.3) / 2) * small\_cell\_depth) + (y\_coord / 2 * big\_cell\_depth)) : (0);}
\DoxyCodeLine{437             \textcolor{comment}{// Z coord -\/> stays as it is}}
\DoxyCodeLine{438             parsed\_addr.z\_coord = stoi(raw\_addr.substr(5, 2));}
\DoxyCodeLine{439             parsed\_addr.z\_coord\_original = parsed\_addr.z\_coord;}
\DoxyCodeLine{440             \textcolor{comment}{// X coord -\/> column}}
\DoxyCodeLine{441             \textcolor{keywordtype}{float} x\_coord = stof(raw\_addr.substr(7, 3));}
\DoxyCodeLine{442             parsed\_addr.x\_coord\_original = x\_coord;}
\DoxyCodeLine{443             \textcolor{keywordflow}{if} (y\_coord == 0)}
\DoxyCodeLine{444             \{}
\DoxyCodeLine{445                 \textcolor{comment}{// pallet row AAA}}
\DoxyCodeLine{446                 \textcolor{comment}{// all constants used there serve for better coordinates expression according to the pallet row design}}
\DoxyCodeLine{447                 parsed\_addr.x\_coord = (x\_offset + side\_side\_vertical\_cor\_width + big\_cell\_width * 0.5) + (x\_coord -\/ 1) * pallet\_cell\_width + pallet\_cell\_width * 0.5;}
\DoxyCodeLine{448                 \textcolor{keywordflow}{if} (x\_coord > 36)}
\DoxyCodeLine{449                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width * 2.7 + middle\_vertical\_cor\_width * 1.4;}
\DoxyCodeLine{450                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_coord > 26)}
\DoxyCodeLine{451                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width * 1.2 + middle\_vertical\_cor\_width * 1.4;}
\DoxyCodeLine{452                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_coord > 12)}
\DoxyCodeLine{453                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width * 1.2;}
\DoxyCodeLine{454             \}}
\DoxyCodeLine{455             \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (y\_coord == 1 || y\_coord == 3)}
\DoxyCodeLine{456             \{}
\DoxyCodeLine{457                 \textcolor{comment}{// rows BB and DD of 380 cells}}
\DoxyCodeLine{458                 parsed\_addr.x\_coord = (x\_offset + side\_side\_vertical\_cor\_width) + (x\_coord -\/ 1) * small\_cell\_width + small\_cell\_width * 0.5;}
\DoxyCodeLine{459                 \textcolor{keywordflow}{if} (x\_coord > 280)}
\DoxyCodeLine{460                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width * 1.66 \textcolor{comment}{/*some edit according to the real map*/} + middle\_vertical\_cor\_width;}
\DoxyCodeLine{461                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_coord > 200)}
\DoxyCodeLine{462                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width;}
\DoxyCodeLine{463                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_coord > 100)}
\DoxyCodeLine{464                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width;}
\DoxyCodeLine{465             \}}
\DoxyCodeLine{466             \textcolor{keywordflow}{else}}
\DoxyCodeLine{467             \{}
\DoxyCodeLine{468                 \textcolor{comment}{// rows CCC and EEE (of normal cells)}}
\DoxyCodeLine{469                 parsed\_addr.x\_coord = (x\_offset + side\_side\_vertical\_cor\_width) + (x\_coord -\/ 1) * big\_cell\_width + big\_cell\_width * 0.5;}
\DoxyCodeLine{470                 \textcolor{keywordflow}{if} (x\_coord > 28)}
\DoxyCodeLine{471                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width * 1.66 \textcolor{comment}{/*some edit according to the real map*/} + middle\_vertical\_cor\_width;}
\DoxyCodeLine{472                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_coord > 20)}
\DoxyCodeLine{473                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width + middle\_vertical\_cor\_width;}
\DoxyCodeLine{474                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (x\_coord > 10)}
\DoxyCodeLine{475                     parsed\_addr.x\_coord += side\_middle\_vertical\_cor\_width;}
\DoxyCodeLine{476             \}}
\DoxyCodeLine{477             \textcolor{comment}{// return of the parsed (mapped) address}}
\DoxyCodeLine{478             \textcolor{keywordflow}{return} parsed\_addr;}
\DoxyCodeLine{479         \}}
\DoxyCodeLine{480     \}}
\DoxyCodeLine{481 }
\DoxyCodeLine{482     \textcolor{keyword}{inline} \textcolor{keyword}{namespace }measuring}
\DoxyCodeLine{483     \{}
\DoxyCodeLine{484 }
\DoxyCodeLine{490         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} \mbox{\hyperlink{namespacever2_a82063db6c421969a2e5a17e82f66f39e}{horizontalCorridorSpecialCase\_G\_V}}(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr, \textcolor{keywordtype}{int} first\_row\_opposite)}
\DoxyCodeLine{491         \{}
\DoxyCodeLine{492             \textcolor{comment}{// SPECIAL CASE -\/ CHECK FOR THE SAME ROW -\/ return just the difference}}
\DoxyCodeLine{493             \textcolor{comment}{//  this computation is handled later on, but here it is set for faster result}}
\DoxyCodeLine{494             \textcolor{keywordflow}{if} (first\_addr.y\_coord\_original -\/ second\_addr.y\_coord\_original == 0)}
\DoxyCodeLine{495             \{}
\DoxyCodeLine{496                 \textcolor{keywordflow}{return} abs(first\_addr.x\_coord -\/ second\_addr.x\_coord);}
\DoxyCodeLine{497             \}}
\DoxyCodeLine{498             \textcolor{keywordflow}{else}}
\DoxyCodeLine{499             \{}
\DoxyCodeLine{500                 \textcolor{comment}{// for the next part of computation order the two addresses from down to up by Y coord (remember, in warehouse layout the beggining of axises are in the top left corner )}}
\DoxyCodeLine{501                 \textcolor{keywordflow}{if} (first\_addr.y\_coord\_original > second\_addr.y\_coord\_original)}
\DoxyCodeLine{502                     swap(first\_addr, second\_addr);}
\DoxyCodeLine{503 }
\DoxyCodeLine{504                 \textcolor{comment}{// check for the same horizontal corridor, but not the same Y\_coord}}
\DoxyCodeLine{505                 \textcolor{comment}{// the same corridor if and only if odd number follows the even one}}
\DoxyCodeLine{506 }
\DoxyCodeLine{507                 \textcolor{comment}{// behave according to the number of the first row in first horizotnal corridor}}
\DoxyCodeLine{508                 \textcolor{keywordflow}{if} (first\_row\_opposite \% 2 == 0)}
\DoxyCodeLine{509                 \{}
\DoxyCodeLine{510                     \textcolor{keywordflow}{if} (first\_addr.y\_coord\_original \% 2 == 0 \&\& first\_addr.y\_coord\_original + 1 == second\_addr.y\_coord\_original)}
\DoxyCodeLine{511                         \textcolor{keywordflow}{return} \mbox{\hyperlink{helper_8cpp_aefbaf81b063ae393bd4f5c92d05cb58a}{euclidean\_distance}}(first\_addr, second\_addr);}
\DoxyCodeLine{512                 \}}
\DoxyCodeLine{513                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{514                 \{}
\DoxyCodeLine{515                     \textcolor{keywordflow}{if} (first\_addr.y\_coord\_original \% 2 == 1 \&\& first\_addr.y\_coord\_original + 1 == second\_addr.y\_coord\_original)}
\DoxyCodeLine{516                         \textcolor{keywordflow}{return} \mbox{\hyperlink{helper_8cpp_aefbaf81b063ae393bd4f5c92d05cb58a}{euclidean\_distance}}(first\_addr, second\_addr);}
\DoxyCodeLine{517                 \}}
\DoxyCodeLine{518 }
\DoxyCodeLine{519                 \textcolor{comment}{// NOTE: simple explanation -\/ to match this case handled right above, first row has to be for one unit before the second one}}
\DoxyCodeLine{520             \}}
\DoxyCodeLine{521 }
\DoxyCodeLine{522             \textcolor{keywordflow}{return} -\/1; \textcolor{comment}{// when special case hasn't been recognized}}
\DoxyCodeLine{523         \}}
\DoxyCodeLine{524 }
\DoxyCodeLine{525         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} horizontalCorridorSpecialCase\_P\_GP(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr, \textcolor{keywordtype}{int} first\_row\_opposite)}
\DoxyCodeLine{526         \{}
\DoxyCodeLine{527             \textcolor{comment}{// SPECIAL CASE -\/ CHECK FOR THE SAME ROW -\/ return just the difference}}
\DoxyCodeLine{528             \textcolor{comment}{//  this computation is handled later on, but here it is set for faster result}}
\DoxyCodeLine{529             \textcolor{keywordflow}{if} (first\_addr.x\_coord\_original -\/ second\_addr.x\_coord\_original == 0)}
\DoxyCodeLine{530                 \textcolor{keywordflow}{return} abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{531             \textcolor{keywordflow}{else}}
\DoxyCodeLine{532             \{}
\DoxyCodeLine{533                 \textcolor{comment}{// for the next part of computation order the two addresses from left to right by X coord (remember, in warehouse layout the beggining of axises are in the top left corner )}}
\DoxyCodeLine{534                 \textcolor{keywordflow}{if} (first\_addr.x\_coord\_original > second\_addr.x\_coord\_original)}
\DoxyCodeLine{535                     swap(first\_addr, second\_addr);}
\DoxyCodeLine{536 }
\DoxyCodeLine{537                 \textcolor{comment}{// check for the same verticall corridor, but not the same X\_coord}}
\DoxyCodeLine{538                 \textcolor{comment}{// the same corridor if and only if odd number follows the even one}}
\DoxyCodeLine{539 }
\DoxyCodeLine{540                 \textcolor{comment}{// behave according to the number of the first row in first horizotnal corridor}}
\DoxyCodeLine{541                 \textcolor{keywordflow}{if} (first\_row\_opposite \% 2 == 0)}
\DoxyCodeLine{542                 \{}
\DoxyCodeLine{543                     \textcolor{keywordflow}{if} (first\_addr.x\_coord\_original \% 2 == 0 \&\& first\_addr.x\_coord\_original + 1 == second\_addr.x\_coord\_original)}
\DoxyCodeLine{544                         \textcolor{keywordflow}{return} \mbox{\hyperlink{helper_8cpp_aefbaf81b063ae393bd4f5c92d05cb58a}{euclidean\_distance}}(first\_addr, second\_addr);}
\DoxyCodeLine{545                 \}}
\DoxyCodeLine{546                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{547                 \{}
\DoxyCodeLine{548                     \textcolor{keywordflow}{if} (first\_addr.x\_coord\_original \% 2 == 1 \&\& first\_addr.x\_coord\_original + 1 == second\_addr.x\_coord\_original)}
\DoxyCodeLine{549                         \textcolor{keywordflow}{return} \mbox{\hyperlink{helper_8cpp_aefbaf81b063ae393bd4f5c92d05cb58a}{euclidean\_distance}}(first\_addr, second\_addr);}
\DoxyCodeLine{550                 \}}
\DoxyCodeLine{551 }
\DoxyCodeLine{552                 \textcolor{comment}{// NOTE: simple explanation -\/ to match this case handled right above, first row has to be for one unit before the second one}}
\DoxyCodeLine{553             \}}
\DoxyCodeLine{554 }
\DoxyCodeLine{555             \textcolor{keywordflow}{return} -\/1; \textcolor{comment}{// when special case hasn't been recognized}}
\DoxyCodeLine{556         \}}
\DoxyCodeLine{557 }
\DoxyCodeLine{558         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} \mbox{\hyperlink{namespacever1_a44d9fe10b533d741260808ce1e14893f}{getDistanceInSectorG}}(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{559         \{}
\DoxyCodeLine{560             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecG}{secG}};}
\DoxyCodeLine{561             \textcolor{comment}{//**************************** do the pattern (possible because of the EUCLIDEAN space) ***********************************************}}
\DoxyCodeLine{562             \textcolor{comment}{// THERE IS STORED THE FINAL DISTANCE}}
\DoxyCodeLine{563             \textcolor{keywordtype}{float} distance = 0;}
\DoxyCodeLine{564 }
\DoxyCodeLine{565             \textcolor{comment}{// handling special case}}
\DoxyCodeLine{566             \textcolor{keywordtype}{int} distance\_tmp = \mbox{\hyperlink{namespacever2_a82063db6c421969a2e5a17e82f66f39e}{horizontalCorridorSpecialCase\_G\_V}}(first\_addr, second\_addr, first\_row\_opposite);}
\DoxyCodeLine{567             \textcolor{keywordflow}{if} (distance\_tmp >= 0)}
\DoxyCodeLine{568             \{}
\DoxyCodeLine{569                 \textcolor{keywordflow}{return} distance\_tmp;}
\DoxyCodeLine{570             \}}
\DoxyCodeLine{571 }
\DoxyCodeLine{572             \textcolor{comment}{// for the next part of computation order the two addresses from left to right}}
\DoxyCodeLine{573             \textcolor{keywordflow}{if} (first\_addr.x\_coord > second\_addr.x\_coord)}
\DoxyCodeLine{574                 swap(first\_addr, second\_addr);}
\DoxyCodeLine{575 }
\DoxyCodeLine{576             \textcolor{comment}{// stored x coord of both addresses for better readability}}
\DoxyCodeLine{577             \textcolor{keyword}{auto} first\_addr\_x = first\_addr.x\_coord;}
\DoxyCodeLine{578             \textcolor{keyword}{auto} second\_addr\_x = second\_addr.x\_coord;}
\DoxyCodeLine{579             \textcolor{keywordflow}{for} (\textcolor{keywordtype}{size\_t} i = 0; i < vertical\_corridors.size() -\/ 1; i++)}
\DoxyCodeLine{580             \{}
\DoxyCodeLine{581                 \textcolor{comment}{// check the first address of being between current two corridors}}
\DoxyCodeLine{582                 \textcolor{keywordflow}{if} (first\_addr\_x >= vertical\_corridors[i] \&\& first\_addr\_x <= vertical\_corridors[i + 1])}
\DoxyCodeLine{583                 \{}
\DoxyCodeLine{584                     \textcolor{comment}{// found the column of the first address}}
\DoxyCodeLine{585                     \textcolor{keywordflow}{if} (second\_addr\_x >= vertical\_corridors[i] \&\& second\_addr\_x <= vertical\_corridors[i + 1])}
\DoxyCodeLine{586                     \{}
\DoxyCodeLine{587                         \textcolor{comment}{// the second address fits too}}
\DoxyCodeLine{588                         \textcolor{keywordflow}{if} (first\_addr\_x -\/ vertical\_corridors[i] + second\_addr\_x -\/ vertical\_corridors[i] <}
\DoxyCodeLine{589                             vertical\_corridors[i + 1] -\/ first\_addr\_x + vertical\_corridors[i + 1] -\/ second\_addr\_x)}
\DoxyCodeLine{590                         \{}
\DoxyCodeLine{591                             \textcolor{comment}{// better is left corridor}}
\DoxyCodeLine{592                             distance += first\_addr\_x -\/ vertical\_corridors[i];}
\DoxyCodeLine{593                             distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{594                             distance += second\_addr\_x -\/ vertical\_corridors[i];}
\DoxyCodeLine{595                         \}}
\DoxyCodeLine{596                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{597                         \{}
\DoxyCodeLine{598                             \textcolor{comment}{// better is right corridor}}
\DoxyCodeLine{599                             distance += vertical\_corridors[i + 1] -\/ first\_addr\_x;}
\DoxyCodeLine{600                             distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{601                             distance += vertical\_corridors[i + 1] -\/ second\_addr\_x;}
\DoxyCodeLine{602                         \}}
\DoxyCodeLine{603                     \}}
\DoxyCodeLine{604                     \textcolor{keywordflow}{else}}
\DoxyCodeLine{605                     \{}
\DoxyCodeLine{606                         \textcolor{comment}{// the second address doesnt fit the column as the first address is set to -\/ so count at rest as normall}}
\DoxyCodeLine{607                         \textcolor{comment}{// as we make first address be the left one, count distance to the right corridor}}
\DoxyCodeLine{608                         distance += vertical\_corridors[i + 1] -\/ first\_addr\_x;}
\DoxyCodeLine{609                         distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{610                         distance += second\_addr\_x -\/ vertical\_corridors[i + 1]; \textcolor{comment}{// we know that the second address has to have greater x value, cause its}}
\DoxyCodeLine{611                     \}}
\DoxyCodeLine{612                     \textcolor{comment}{// nothing more to compute -\/ return the result of distance measurement}}
\DoxyCodeLine{613                     \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{614                 \} \textcolor{comment}{// if}}
\DoxyCodeLine{615             \}     \textcolor{comment}{// for}}
\DoxyCodeLine{616             \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{617         \}}
\DoxyCodeLine{618 }
\DoxyCodeLine{619         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} getDistanceInSectorV(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{620         \{}
\DoxyCodeLine{621             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecV}{secV}};}
\DoxyCodeLine{622 }
\DoxyCodeLine{623             \textcolor{comment}{//**************************** do the pattern (possible because of the EUCLIDEAN space) ***********************************************}}
\DoxyCodeLine{624             \textcolor{comment}{// THERE IS STORED THE FINAL DISTANCE}}
\DoxyCodeLine{625             \textcolor{keywordtype}{float} distance = 0;}
\DoxyCodeLine{626 }
\DoxyCodeLine{627             \textcolor{comment}{// handling special case}}
\DoxyCodeLine{628             \textcolor{keywordtype}{int} distance\_tmp = \mbox{\hyperlink{namespacever2_a82063db6c421969a2e5a17e82f66f39e}{horizontalCorridorSpecialCase\_G\_V}}(first\_addr, second\_addr, first\_row\_opposite);}
\DoxyCodeLine{629             \textcolor{keywordflow}{if} (distance\_tmp >= 0)}
\DoxyCodeLine{630                 \textcolor{keywordflow}{return} distance\_tmp;}
\DoxyCodeLine{631 }
\DoxyCodeLine{632             \textcolor{comment}{// for the next part of computation order the two addresses from left to right}}
\DoxyCodeLine{633             \textcolor{keywordflow}{if} (first\_addr.x\_coord > second\_addr.x\_coord)}
\DoxyCodeLine{634                 swap(first\_addr, second\_addr);}
\DoxyCodeLine{635 }
\DoxyCodeLine{636             \textcolor{comment}{// stored x coord of both addresses for better readability}}
\DoxyCodeLine{637             \textcolor{keyword}{auto} first\_addr\_x = first\_addr.x\_coord;}
\DoxyCodeLine{638             \textcolor{keyword}{auto} second\_addr\_x = second\_addr.x\_coord;}
\DoxyCodeLine{639             \textcolor{comment}{// first check for special case -\/ both addresses in the same HORIZONTAL corridor (so the same Y coord) -\/> meaning there is shorter distacne to go}}
\DoxyCodeLine{640 }
\DoxyCodeLine{641             \textcolor{comment}{// find the best way, if the addresses are in the same column (bordered from both sites by vertical corridors)}}
\DoxyCodeLine{642             \textcolor{comment}{// also there is handled the other way with simple subtraction of both coordinates}}
\DoxyCodeLine{643             \textcolor{keywordflow}{for} (\textcolor{keywordtype}{size\_t} i = 0; i < vertical\_corridors.size() -\/ 1; i++)}
\DoxyCodeLine{644             \{}
\DoxyCodeLine{645                 \textcolor{comment}{// check the first address whether it is between current two corridors}}
\DoxyCodeLine{646                 \textcolor{keywordflow}{if} (first\_addr\_x >= vertical\_corridors[i] \&\& first\_addr\_x <= vertical\_corridors[i + 1])}
\DoxyCodeLine{647                 \{}
\DoxyCodeLine{648                     \textcolor{comment}{// decide the column of the second address}}
\DoxyCodeLine{649                     \textcolor{keywordflow}{if} (second\_addr\_x >= vertical\_corridors[i] \&\& second\_addr\_x <= vertical\_corridors[i + 1])}
\DoxyCodeLine{650                     \{}
\DoxyCodeLine{651                         \textcolor{comment}{// the second address fits the same corridor too}}
\DoxyCodeLine{652                         \textcolor{keywordflow}{if} (first\_addr\_x -\/ vertical\_corridors[i] + second\_addr\_x -\/ vertical\_corridors[i] <}
\DoxyCodeLine{653                             vertical\_corridors[i + 1] -\/ first\_addr\_x + vertical\_corridors[i + 1] -\/ second\_addr\_x)}
\DoxyCodeLine{654                         \{}
\DoxyCodeLine{655                             \textcolor{comment}{// better is left corridor}}
\DoxyCodeLine{656                             distance += first\_addr\_x -\/ vertical\_corridors[i];}
\DoxyCodeLine{657                             distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{658                             distance += second\_addr\_x -\/ vertical\_corridors[i];}
\DoxyCodeLine{659                         \}}
\DoxyCodeLine{660                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{661                         \{}
\DoxyCodeLine{662                             \textcolor{comment}{// better is right corridor}}
\DoxyCodeLine{663                             distance += vertical\_corridors[i + 1] -\/ first\_addr\_x;}
\DoxyCodeLine{664                             distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{665                             distance += vertical\_corridors[i + 1] -\/ second\_addr\_x;}
\DoxyCodeLine{666                         \}}
\DoxyCodeLine{667                     \}}
\DoxyCodeLine{668                     \textcolor{keywordflow}{else}}
\DoxyCodeLine{669                     \{}
\DoxyCodeLine{670                         \textcolor{comment}{// the second address doesnt fit the column as the first address is set to -\/ so count the rest as normall}}
\DoxyCodeLine{671                         \textcolor{comment}{// as we make first address be the left one, count distance to the right corridor}}
\DoxyCodeLine{672                         distance += abs(first\_addr\_x -\/ second\_addr\_x);}
\DoxyCodeLine{673                         distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{674                     \}}
\DoxyCodeLine{675                     \textcolor{comment}{// nothing more to compute -\/ return the result of distance measurement}}
\DoxyCodeLine{676                     \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{677                 \} \textcolor{comment}{// if}}
\DoxyCodeLine{678             \}     \textcolor{comment}{// for}}
\DoxyCodeLine{679 }
\DoxyCodeLine{680             \textcolor{comment}{// return just orthogonal distance}}
\DoxyCodeLine{681             \textcolor{keywordflow}{return} \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(first\_addr, second\_addr);}
\DoxyCodeLine{682 }
\DoxyCodeLine{683             \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{684         \}}
\DoxyCodeLine{685 }
\DoxyCodeLine{686         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} getDistanceInSectorP(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{687         \{}
\DoxyCodeLine{688             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecP}{secP}};}
\DoxyCodeLine{689             \textcolor{comment}{//**************************** do the pattern (possible because of the EUCLIDEAN space) ***********************************************}}
\DoxyCodeLine{690             \textcolor{comment}{// THERE IS STORED THE FINAL DISTANCE}}
\DoxyCodeLine{691             \textcolor{keywordtype}{float} distance = 0;}
\DoxyCodeLine{692 }
\DoxyCodeLine{693             \textcolor{comment}{// handling special case}}
\DoxyCodeLine{694             \textcolor{keywordtype}{int} distance\_tmp = \mbox{\hyperlink{namespacever2_a82063db6c421969a2e5a17e82f66f39e}{horizontalCorridorSpecialCase\_G\_V}}(first\_addr, second\_addr, first\_column\_opposite);}
\DoxyCodeLine{695             \textcolor{keywordflow}{if} (distance\_tmp >= 0)}
\DoxyCodeLine{696                 \textcolor{keywordflow}{return} distance\_tmp;}
\DoxyCodeLine{697 }
\DoxyCodeLine{698             \textcolor{comment}{// for the next part of computation order the two addresses from up to down}}
\DoxyCodeLine{699             \textcolor{keywordflow}{if} (first\_addr.y\_coord > second\_addr.y\_coord)}
\DoxyCodeLine{700                 swap(first\_addr, second\_addr);}
\DoxyCodeLine{701 }
\DoxyCodeLine{702             \textcolor{comment}{// decide in which row (divided by the corridor) the first address is}}
\DoxyCodeLine{703             \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} corr = 0; corr < (int)horizontal\_cooridors.size() -\/ 1; corr++)}
\DoxyCodeLine{704             \{}
\DoxyCodeLine{705                 \textcolor{comment}{// if the y coord of first addr fits the space between two corridors}}
\DoxyCodeLine{706                 \textcolor{keywordflow}{if} (horizontal\_cooridors[corr] <= first\_addr.y\_coord \&\& first\_addr.y\_coord <= horizontal\_cooridors[corr + 1])}
\DoxyCodeLine{707                 \{}
\DoxyCodeLine{708                     \textcolor{comment}{// if also the second address is in the same corridor}}
\DoxyCodeLine{709                     \textcolor{keywordflow}{if} (horizontal\_cooridors[corr] <= second\_addr.y\_coord \&\& second\_addr.y\_coord <= horizontal\_cooridors[corr + 1])}
\DoxyCodeLine{710                     \{}
\DoxyCodeLine{711                         \textcolor{comment}{// find the better one of the neighbouring corridors}}
\DoxyCodeLine{712                         \textcolor{keywordflow}{if} (abs(2 * horizontal\_cooridors[corr] -\/ first\_addr.y\_coord -\/ second\_addr.y\_coord) <}
\DoxyCodeLine{713                             abs(2 * horizontal\_cooridors[corr + 1] -\/ first\_addr.y\_coord -\/ second\_addr.y\_coord))}
\DoxyCodeLine{714                         \{}
\DoxyCodeLine{715                             \textcolor{comment}{// better is the upper corridor}}
\DoxyCodeLine{716                             distance += abs(2 * horizontal\_cooridors[corr] -\/ first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{717                             distance += abs(first\_addr.x\_coord -\/ second\_addr.x\_coord);}
\DoxyCodeLine{718                         \}}
\DoxyCodeLine{719                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{720                         \{}
\DoxyCodeLine{721                             \textcolor{comment}{// better is the lower corridor}}
\DoxyCodeLine{722                             distance += abs(2 * horizontal\_cooridors[corr + 1] -\/ first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{723                             distance += abs(first\_addr.x\_coord -\/ second\_addr.x\_coord);}
\DoxyCodeLine{724                         \}}
\DoxyCodeLine{725                     \}}
\DoxyCodeLine{726                     \textcolor{keywordflow}{else}}
\DoxyCodeLine{727                     \{}
\DoxyCodeLine{728                         \textcolor{comment}{// the second address is in other row}}
\DoxyCodeLine{729                         distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{730                         distance += abs(first\_addr.x\_coord -\/ second\_addr.x\_coord);}
\DoxyCodeLine{731                     \}}
\DoxyCodeLine{732                 \}}
\DoxyCodeLine{733             \}}
\DoxyCodeLine{734 }
\DoxyCodeLine{735             \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{736         \}}
\DoxyCodeLine{737 }
\DoxyCodeLine{738         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} getDistanceInSectorGP(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{739         \{}
\DoxyCodeLine{740             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecGP}{secGP}};}
\DoxyCodeLine{741             \textcolor{comment}{//**************************** do the pattern (possible because of the EUCLIDEAN space) ***********************************************}}
\DoxyCodeLine{742             \textcolor{comment}{// THERE IS STORED THE FINAL DISTANCE}}
\DoxyCodeLine{743             \textcolor{keywordtype}{float} distance = 0;}
\DoxyCodeLine{744 }
\DoxyCodeLine{745             \textcolor{comment}{// handling special case}}
\DoxyCodeLine{746             \textcolor{keywordtype}{int} distance\_tmp = \mbox{\hyperlink{namespacever2_a82063db6c421969a2e5a17e82f66f39e}{horizontalCorridorSpecialCase\_G\_V}}(first\_addr, second\_addr, first\_column\_opposite);}
\DoxyCodeLine{747             \textcolor{keywordflow}{if} (distance\_tmp >= 0)}
\DoxyCodeLine{748                 \textcolor{keywordflow}{return} distance\_tmp;}
\DoxyCodeLine{749 }
\DoxyCodeLine{750             \textcolor{comment}{// for the next part of computation order the two addresses from up to down}}
\DoxyCodeLine{751             \textcolor{keywordflow}{if} (first\_addr.y\_coord > second\_addr.y\_coord)}
\DoxyCodeLine{752                 swap(first\_addr, second\_addr);}
\DoxyCodeLine{753 }
\DoxyCodeLine{754             \textcolor{comment}{// decide in which row (divided by the corridor) the first address is}}
\DoxyCodeLine{755             \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} corr = 0; corr < (int)horizontal\_corridors.size() -\/ 1; corr++)}
\DoxyCodeLine{756             \{}
\DoxyCodeLine{757                 \textcolor{comment}{// if the y coord of first addr fits the space between two corridors}}
\DoxyCodeLine{758                 \textcolor{keywordflow}{if} (horizontal\_corridors[corr] <= first\_addr.y\_coord \&\& first\_addr.y\_coord <= horizontal\_corridors[corr + 1])}
\DoxyCodeLine{759                 \{}
\DoxyCodeLine{760                     \textcolor{comment}{// if also the second address is in the same corridor}}
\DoxyCodeLine{761                     \textcolor{keywordflow}{if} (horizontal\_corridors[corr] <= second\_addr.y\_coord \&\& second\_addr.y\_coord <= horizontal\_corridors[corr + 1])}
\DoxyCodeLine{762                     \{}
\DoxyCodeLine{763                         \textcolor{comment}{// find the better one of the neighbouring corridors}}
\DoxyCodeLine{764                         \textcolor{keywordflow}{if} (abs(2 * horizontal\_corridors[corr] -\/ first\_addr.y\_coord -\/ second\_addr.y\_coord) <}
\DoxyCodeLine{765                             abs(2 * horizontal\_corridors[corr + 1] -\/ first\_addr.y\_coord -\/ second\_addr.y\_coord))}
\DoxyCodeLine{766                         \{}
\DoxyCodeLine{767                             \textcolor{comment}{// better is the upper corridor}}
\DoxyCodeLine{768                             distance += abs(2 * horizontal\_corridors[corr] -\/ first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{769                             distance += abs(first\_addr.x\_coord -\/ second\_addr.x\_coord);}
\DoxyCodeLine{770                         \}}
\DoxyCodeLine{771                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{772                         \{}
\DoxyCodeLine{773                             \textcolor{comment}{// better is the lower corridor}}
\DoxyCodeLine{774                             distance += abs(2 * horizontal\_corridors[corr + 1] -\/ first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{775                             distance += abs(first\_addr.x\_coord -\/ second\_addr.x\_coord);}
\DoxyCodeLine{776                         \}}
\DoxyCodeLine{777                     \}}
\DoxyCodeLine{778                     \textcolor{keywordflow}{else}}
\DoxyCodeLine{779                     \{}
\DoxyCodeLine{780                         \textcolor{comment}{// the second address is in other row}}
\DoxyCodeLine{781                         distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{782                         distance += abs(first\_addr.x\_coord -\/ second\_addr.x\_coord);}
\DoxyCodeLine{783                     \}}
\DoxyCodeLine{784                 \}}
\DoxyCodeLine{785             \}}
\DoxyCodeLine{786 }
\DoxyCodeLine{787             \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{788         \}}
\DoxyCodeLine{789 }
\DoxyCodeLine{790         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} getDistanceBetweenSectors\_G\_V(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{791         \{}
\DoxyCodeLine{792             \textcolor{comment}{//**************************** do the pattern (possible because of the EUCLIDEAN space) ***********************************************}}
\DoxyCodeLine{793             \textcolor{comment}{// THERE IS STORED THE FINAL DISTANCE}}
\DoxyCodeLine{794             \textcolor{keywordtype}{float} distance = 0;}
\DoxyCodeLine{795             \textcolor{comment}{// sort the addresses -\/ first G, second V}}
\DoxyCodeLine{796             \textcolor{keywordflow}{if} (first\_addr.section[0] != \textcolor{charliteral}{'G'})}
\DoxyCodeLine{797                 swap(first\_addr, second\_addr);}
\DoxyCodeLine{798             }
\DoxyCodeLine{799             \textcolor{comment}{// special case -\/ both addresses share the same corridor (one between G and V)}}
\DoxyCodeLine{800             \textcolor{keywordflow}{if} (first\_addr.y\_coord\_original == 0 \&\& second\_addr.y\_coord\_original == 4 \textcolor{comment}{/*stands for VEE*/})}
\DoxyCodeLine{801                 \textcolor{keywordflow}{return} \mbox{\hyperlink{helper_8cpp_aefbaf81b063ae393bd4f5c92d05cb58a}{euclidean\_distance}}(first\_addr, second\_addr);}
\DoxyCodeLine{802 }
\DoxyCodeLine{803             \textcolor{comment}{// for the next part of computation order the two addresses from left to right}}
\DoxyCodeLine{804             \textcolor{keywordflow}{if} (first\_addr.x\_coord > second\_addr.x\_coord)}
\DoxyCodeLine{805                 swap(first\_addr, second\_addr);}
\DoxyCodeLine{806 }
\DoxyCodeLine{807             \textcolor{comment}{// mostly used numbers and variables for secV}}
\DoxyCodeLine{808             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecG}{secG}};}
\DoxyCodeLine{809 }
\DoxyCodeLine{810             \textcolor{comment}{// stored x coord of both addresses for better readability of the code below}}
\DoxyCodeLine{811             \textcolor{keyword}{auto} first\_addr\_x = first\_addr.x\_coord;}
\DoxyCodeLine{812             \textcolor{keyword}{auto} second\_addr\_x = second\_addr.x\_coord;}
\DoxyCodeLine{813 }
\DoxyCodeLine{814             \textcolor{comment}{// loop through the corridors from 1, because these are same for both sectors (G\&V)}}
\DoxyCodeLine{815             \textcolor{keywordflow}{for} (\textcolor{keywordtype}{size\_t} i = 0; i < vertical\_corridors.size() -\/ 1; i++)}
\DoxyCodeLine{816             \{}
\DoxyCodeLine{817                 \textcolor{comment}{// check the first address of being between current two corridors}}
\DoxyCodeLine{818                 \textcolor{keywordflow}{if} ((first\_addr\_x >= vertical\_corridors[i] \&\& first\_addr\_x <= vertical\_corridors[i + 1]) ||}
\DoxyCodeLine{819                     (first\_addr\_x < vertical\_corridors[i] \&\& i == 0) || \textcolor{comment}{/*the corridor is somewhere before the first corridor */}}
\DoxyCodeLine{820                     (first\_addr\_x > vertical\_corridors[i + 1] \&\& i + 1 == vertical\_corridors.size() -\/ 1) \textcolor{comment}{/*the corridor is somewhere after the last corridor*/})}
\DoxyCodeLine{821                 \{}
\DoxyCodeLine{822                     \textcolor{comment}{// now try to decide whether the second address is in the same column or not}}
\DoxyCodeLine{823                     \textcolor{keywordflow}{if} ((second\_addr\_x >= vertical\_corridors[i] \&\& second\_addr\_x <= vertical\_corridors[i + 1]) ||}
\DoxyCodeLine{824                         (second\_addr\_x < vertical\_corridors[i] \&\& i == 0) ||}
\DoxyCodeLine{825                         (second\_addr\_x > vertical\_corridors[i + 1] \&\& i + 1 == vertical\_corridors.size() -\/ 1) \textcolor{comment}{/*the corridor is somewhere after the last corridor*/})}
\DoxyCodeLine{826                     \{}
\DoxyCodeLine{827                         \textcolor{comment}{// the second address fits the same column too}}
\DoxyCodeLine{828                         \textcolor{keywordflow}{if} (((first\_addr\_x -\/ vertical\_corridors[i] + second\_addr\_x -\/ vertical\_corridors[i] <}
\DoxyCodeLine{829                               vertical\_corridors[i + 1] -\/ first\_addr\_x + vertical\_corridors[i + 1] -\/ second\_addr\_x) \&\&}
\DoxyCodeLine{830                              i != 0) ||}
\DoxyCodeLine{831                             i + 1 == vertical\_corridors.size() -\/ 1)}
\DoxyCodeLine{832                         \{}
\DoxyCodeLine{833                             \textcolor{comment}{// better is left corridor}}
\DoxyCodeLine{834                             \textcolor{comment}{// or the i+1 vertical corridor is the one most right, so there is no option to use it while passing}}
\DoxyCodeLine{835                             \textcolor{comment}{// from G to V}}
\DoxyCodeLine{836                             distance += first\_addr\_x -\/ vertical\_corridors[i];}
\DoxyCodeLine{837                             distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{838                             distance += second\_addr\_x -\/ vertical\_corridors[i];}
\DoxyCodeLine{839                         \}}
\DoxyCodeLine{840                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{841                         \{}
\DoxyCodeLine{842                             \textcolor{comment}{// better is right corridor}}
\DoxyCodeLine{843                             \textcolor{comment}{// or the used vertical corridor is 0 (viz the condition), so there is no option to use}}
\DoxyCodeLine{844                             \textcolor{comment}{// left corridor -\/ so use the right one}}
\DoxyCodeLine{845                             distance += vertical\_corridors[i + 1] -\/ first\_addr\_x;}
\DoxyCodeLine{846                             distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{847                             distance += vertical\_corridors[i + 1] -\/ second\_addr\_x;}
\DoxyCodeLine{848                         \}}
\DoxyCodeLine{849                     \}}
\DoxyCodeLine{850                     \textcolor{keywordflow}{else}}
\DoxyCodeLine{851                     \{}
\DoxyCodeLine{852                         \textcolor{comment}{// the second address doesnt fit the column as the first address is set to -\/ so count at rest as normall}}
\DoxyCodeLine{853                         \textcolor{comment}{// as we make first address be the left one, count distance to the right corridor}}
\DoxyCodeLine{854                         distance += abs(second\_addr\_x -\/ first\_addr\_x);}
\DoxyCodeLine{855                         distance += abs(first\_addr.y\_coord -\/ second\_addr.y\_coord);}
\DoxyCodeLine{856                     \}}
\DoxyCodeLine{857                     \textcolor{comment}{// nothing more to compute -\/ return the result of distance measurement}}
\DoxyCodeLine{858                     \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{859                 \} \textcolor{comment}{// if}}
\DoxyCodeLine{860             \}     \textcolor{comment}{// for}}
\DoxyCodeLine{861             \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{862         \}}
\DoxyCodeLine{863 }
\DoxyCodeLine{864         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} getDistanceBetweenSectors\_G\_P(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{865         \{}
\DoxyCodeLine{866             \textcolor{comment}{// swap the addresses to fit order G -\/ P}}
\DoxyCodeLine{867             \textcolor{keywordflow}{if} (first\_addr.section[0] == \textcolor{charliteral}{'P'})}
\DoxyCodeLine{868                 swap(first\_addr, second\_addr);}
\DoxyCodeLine{869 }
\DoxyCodeLine{870             \textcolor{comment}{//**************************** do the pattern (possible because of the EUCLIDEAN space) ***********************************************}}
\DoxyCodeLine{871             \textcolor{comment}{// THERE IS STORED THE FINAL DISTANCE}}
\DoxyCodeLine{872             \textcolor{keywordtype}{float} north\_exit\_distance = 0, lower\_exit\_distance = 0;}
\DoxyCodeLine{873             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecG}{secG}};}
\DoxyCodeLine{874             \textcolor{comment}{// distance to the north exit}}
\DoxyCodeLine{875             \textcolor{keywordflow}{if} (first\_addr.x\_coord > vertical\_corridors[4])}
\DoxyCodeLine{876             \{}
\DoxyCodeLine{877                 north\_exit\_distance += abs(first\_addr.x\_coord -\/ vertical\_corridors[4]) + abs(vertical\_corridors[4] -\/ G\_north\_exit.x\_coord);}
\DoxyCodeLine{878                 north\_exit\_distance += abs(first\_addr.y\_coord -\/ G\_north\_exit.y\_coord);}
\DoxyCodeLine{879             \}}
\DoxyCodeLine{880             \textcolor{keywordflow}{else}}
\DoxyCodeLine{881             \{}
\DoxyCodeLine{882                 north\_exit\_distance += abs(first\_addr.x\_coord -\/ G\_north\_exit.x\_coord);}
\DoxyCodeLine{883                 north\_exit\_distance += abs(first\_addr.y\_coord -\/ G\_north\_exit.y\_coord);}
\DoxyCodeLine{884             \}}
\DoxyCodeLine{885             \textcolor{comment}{// lower exit distance}}
\DoxyCodeLine{886             lower\_exit\_distance += \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(first\_addr, secG::G\_lower\_exit);}
\DoxyCodeLine{887             vector<GRAPH\_POINT\_T> queue = \{secP::P\_north\_exit, secP::P\_middle\_exit, secP::P\_south\_exit\};}
\DoxyCodeLine{888             \textcolor{keywordtype}{int} best\_distance\_lower = INT32\_MAX;}
\DoxyCodeLine{889             \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} exit : queue)}
\DoxyCodeLine{890             \{}
\DoxyCodeLine{891                 \textcolor{keywordtype}{int} tmp = \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(secG::G\_lower\_exit, exit) + lower\_exit\_distance;}
\DoxyCodeLine{892                 tmp += \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(exit, second\_addr);}
\DoxyCodeLine{893                 \textcolor{keywordflow}{if} (tmp < best\_distance\_lower)}
\DoxyCodeLine{894                     best\_distance\_lower = tmp;}
\DoxyCodeLine{895             \}}
\DoxyCodeLine{896 }
\DoxyCodeLine{897             \textcolor{keywordtype}{int} best\_distance\_north = INT32\_MAX;}
\DoxyCodeLine{898             \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} exit : queue)}
\DoxyCodeLine{899             \{}
\DoxyCodeLine{900                 \textcolor{keywordtype}{int} tmp = \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(secG::G\_north\_exit, exit) + north\_exit\_distance;}
\DoxyCodeLine{901                 tmp += \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(exit, second\_addr);}
\DoxyCodeLine{902                 \textcolor{keywordflow}{if} (tmp < best\_distance\_north)}
\DoxyCodeLine{903                     best\_distance\_north = tmp;}
\DoxyCodeLine{904             \}}
\DoxyCodeLine{905 }
\DoxyCodeLine{906             \textcolor{keywordflow}{return} (best\_distance\_lower < best\_distance\_north) ? best\_distance\_lower : best\_distance\_north;}
\DoxyCodeLine{907         \}}
\DoxyCodeLine{908 }
\DoxyCodeLine{909         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} getDistanceBetweenSectors\_G\_GP(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{910         \{}
\DoxyCodeLine{911             \textcolor{keywordtype}{int} distance = 0;}
\DoxyCodeLine{912 }
\DoxyCodeLine{913             \textcolor{comment}{// swap the addresses to be in order G -\/> GP}}
\DoxyCodeLine{914             \textcolor{keywordflow}{if} (first\_addr.section.substr(0, 2) == \textcolor{stringliteral}{"{}GP"{}})}
\DoxyCodeLine{915                 swap(first\_addr, second\_addr);}
\DoxyCodeLine{916 }
\DoxyCodeLine{917             \textcolor{comment}{// compute the distance between G address and the edge between G and GP sector}}
\DoxyCodeLine{918             distance += \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(first\_addr, secG::G\_lower\_exit);}
\DoxyCodeLine{919 }
\DoxyCodeLine{920             \textcolor{comment}{// compute the distance between the edge and the GP address}}
\DoxyCodeLine{921             distance += getDistanceInSectorGP(secG::G\_lower\_exit, second\_addr);}
\DoxyCodeLine{922 }
\DoxyCodeLine{923             \textcolor{keywordflow}{return} distance;}
\DoxyCodeLine{924         \}}
\DoxyCodeLine{925 }
\DoxyCodeLine{926         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} getDistanceBetweenSectors\_V\_P(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{927         \{}
\DoxyCodeLine{928             \textcolor{keywordflow}{return} \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(first\_addr, second\_addr);}
\DoxyCodeLine{929         \}}
\DoxyCodeLine{930 }
\DoxyCodeLine{931         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} getDistanceBetweenSectors\_V\_GP(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{932         \{}
\DoxyCodeLine{933             \textcolor{keywordflow}{return} \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(first\_addr, second\_addr);}
\DoxyCodeLine{934         \}}
\DoxyCodeLine{935 }
\DoxyCodeLine{936         \textcolor{keyword}{inline} \textcolor{keywordtype}{int} getDistanceBetweenSectors\_GP\_P(\mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} first\_addr, \mbox{\hyperlink{structSECTOR__ADDR__T}{SECTOR\_ADDR\_T}} second\_addr)}
\DoxyCodeLine{937         \{}
\DoxyCodeLine{938             \textcolor{keyword}{using namespace }\mbox{\hyperlink{namespacesecGP}{secGP}};}
\DoxyCodeLine{939             \textcolor{keywordflow}{if} (first\_addr.section[0] == \textcolor{charliteral}{'P'})}
\DoxyCodeLine{940                 swap(first\_addr, second\_addr);}
\DoxyCodeLine{941 }
\DoxyCodeLine{942             \textcolor{comment}{// loop through all the exists of GP, count all distances and to them and for each of them count distance to}}
\DoxyCodeLine{943             \textcolor{comment}{// the final address in P sector}}
\DoxyCodeLine{944             vector<GRAPH\_POINT\_T> queue = \{secP::P\_north\_exit, secP::P\_middle\_exit, secP::P\_south\_exit\};}
\DoxyCodeLine{945             \textcolor{keywordtype}{int} current\_best = INT32\_MAX;}
\DoxyCodeLine{946             \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} exit : GP\_exits)}
\DoxyCodeLine{947             \{}
\DoxyCodeLine{948                 \textcolor{keywordtype}{int} start\_to\_exit = getDistanceInSectorGP(first\_addr, exit);}
\DoxyCodeLine{949                 \textcolor{keywordtype}{int} tmp\_best = INT32\_MAX;}
\DoxyCodeLine{950                 \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} entrance : queue)}
\DoxyCodeLine{951                 \{}
\DoxyCodeLine{952                     \textcolor{keywordtype}{int} entrance\_to\_final = \mbox{\hyperlink{helper_8cpp_aefbaf81b063ae393bd4f5c92d05cb58a}{euclidean\_distance}}(exit, entrance) + \mbox{\hyperlink{helper_8cpp_a79f3af0080f11bb71ba939bd9ac4e1b3}{orthogonal\_distance}}(entrance, second\_addr);}
\DoxyCodeLine{953                     \textcolor{keywordflow}{if} (entrance\_to\_final < tmp\_best)}
\DoxyCodeLine{954                         tmp\_best = entrance\_to\_final;}
\DoxyCodeLine{955                 \}}
\DoxyCodeLine{956                 \textcolor{keywordflow}{if} (start\_to\_exit + tmp\_best < current\_best)}
\DoxyCodeLine{957                     current\_best = start\_to\_exit + tmp\_best;}
\DoxyCodeLine{958             \}}
\DoxyCodeLine{959 }
\DoxyCodeLine{960             \textcolor{keywordflow}{return} current\_best;}
\DoxyCodeLine{961         \}}
\DoxyCodeLine{962     \}}
\DoxyCodeLine{963 \}}
\DoxyCodeLine{964 }
\DoxyCodeLine{965 \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
