31 #define TIMEOVERLAP (1) 86 if (leavePotential >= 0)
88 avoidGoal(_current, _next, _collision, leavePotential);
89 trackBack(_current, _next, _collision, leavePotential);
103 if (_freePotential < 0)
113 int32_t collision = -1;
131 if (_collision != collision)
136 avoidStart(_current, _next, collision, leavePotential);
143 int32_t collision = -1;
146 if (vertexFree || collision != -1)
167 else if (collision != -1)
169 if (collision != -1 && collision != _collision)
173 trackBack(current_n, next_n, collision, leavePotential);
174 avoid(current_n, next_n, collision, leavePotential);
188 if (_freePotential < 0)
192 bool crossingFound =
false;
193 std::vector<std::reference_wrapper<Vertex>> crossing;
199 for (
const Vertex &v : crossing)
203 crossingFound =
true;
213 for (
const Vertex &v : crossing)
217 crossingFound =
true;
225 for (
const Vertex &waitSeg : crossing)
229 int32_t collision = -1;
232 if (vertexFree || collision != -1)
258 else if (collision != -1)
260 if (collision != _collision)
264 moveSegment(current_n, wait_seg_n, collision, leavePotential);
275 if (_freePotential < 0)
278 std::queue<queueElement> empty;
282 newEle.
next = &_next;
296 std::vector<std::reference_wrapper<Vertex>> crossing;
299 for (
const Vertex &v : crossing)
308 int32_t collision = -1;
313 for (
const Vertex &waitSeg : crossing)
319 else if (collision != -1)
330 if (_freePotential < 0)
338 if (vertexIsFree || collision != -1)
378 else if (collision != -1)
380 if (collision != _collision)
407 if (_freePotential < 0)
411 bool foundPredecessorVertex =
false;
414 for (
const Vertex &v : crossing)
419 foundPredecessorVertex =
true;
427 if (!foundPredecessorVertex)
432 for (
const Vertex &waitSeg : crossing)
434 int32_t collision = -1;
438 if (vertexIsFree || collision != -1)
477 else if (collision != -1)
479 if (collision != _collision)
483 moveSegment(move_fwd_n, wait_n, robotDiameter_, leavePotential);
496 if (_freePotential < 0)
506 for (
const Vertex &v : crossing)
516 int32_t collision = -1;
520 for (
const Vertex &waitSeg : crossing)
522 int32_t collision = -1;
526 if (vertexIsFree || collision != -1)
565 else if (collision != -1)
567 if (collision != _collision)
571 moveSegment(move_fwd_n, wait_n, robotDiameter_, leavePotential);
576 else if (collision != -1)
578 if (collision != _collision)
uint32_t getSegmentId() const
const std::vector< uint32_t > & getRobotCollisions() const
returns amount of robot collisions found in each resolve try after resetSession
std::vector< std::reference_wrapper< Vertex > > foundSolutions_
void resetSession(const RouteCoordinatorWrapper *_route_querry, const PotentialCalculator *_pCalc, const uint32_t _robot_radius)
resets the session (setting the new route querry and potential calculator)
const std::vector< std::reference_wrapper< Vertex > > & getPlanningPredecessors() const
bool checkSegment(const Vertex &_next, const uint32_t _startTime, const int32_t _endTime, const uint32_t _diameterPixel, int32_t &_collisionRobot, bool _ignoreGoal=false) const
calls checkSegment of the routeCoordinator using robot
const std::vector< std::reference_wrapper< Vertex > > & getPlanningSuccessors() const
void avoidStart(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
float CalculatePotential(const Vertex &_vertex) const
calculates the potential for a vertex
const uint32_t getEnd() const
calls getEnd of the routeCoordinator using robot
const RouteCoordinatorWrapper * route_querry_
void saveCollision(const uint32_t _coll)
increases the collision count of one robot
int32_t findPotentialUntilRobotOnSegment(const uint32_t _robot, const uint32_t _segId) const
calls findPotentialUntilRobotOnSegment of the routeCoordinator using robot
void avoidGoal(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
bool expandSegment(const Vertex &cSeg, Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
void moveSegment(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
const PotentialCalculator * pCalc_
bool avoidStartSuccessorDone_
const Segment & getSegment() const
uint32_t resolutionAttemp_
std::vector< uint32_t > encounteredCollisions_
std::vector< std::vector< std::unique_ptr< Vertex > > > generatedSubgraphs_
std::vector< std::reference_wrapper< Vertex > > resolve(Vertex &_current, Vertex &_next, int32_t _collision)
resolves a found collision between two robots.
bool avoidStartPredecessorDone_
void avoid(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
void trackBack(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
std::queue< queueElement > queue_
void addCollision(const uint32_t robot)