Fix propagation of a finished route

This commit is contained in:
Alexander Nozik 2023-05-02 13:52:06 +03:00
parent 74b86dbc59
commit 8947998e0c

View File

@ -240,7 +240,7 @@ public class Obstacles(public val obstacles: List<Obstacle>) {
var paths = tangentsToFirstObstacle.map { TangentPath(listOf(it)) } var paths = tangentsToFirstObstacle.map { TangentPath(listOf(it)) }
while (!paths.all { it.isFinished }) { while (!paths.all { it.isFinished }) {
paths = paths.flatMap { it.nextSteps() } paths = paths.flatMap { if(it.isFinished) listOf(it) else it.nextSteps() }
} }
return paths.map { return paths.map {
CompositeTrajectory2D( CompositeTrajectory2D(