online random, remove best sonar, fixed error on test room line

This commit is contained in:
MaximZaitsev
2016-08-26 17:53:47 +03:00
parent f854b70cea
commit b6f4a63b63
2 changed files with 4 additions and 4 deletions
@@ -18,7 +18,7 @@ class ControllerEmulator : Controller {
private val MOVE_VELOCITY = 0.05//sm/ms
private val ROTATION_VELOCITY = 0.05//degrees/ms
private val ADD_RANDOM = false
private val ADD_RANDOM = true
enum class MoveDirection {
LEFT,
@@ -123,7 +123,7 @@ class ControllerEmulator : Controller {
continue
}
val currentDistance = Math.round(Math.sqrt(Math.pow(xIntersection - xSensor0, 2.0)
+ Math.pow(yIntersection - ySensor0, 2.0)) * 1000000)
+ Math.pow(yIntersection - ySensor0, 2.0)))
if (currentDistance < result) {
result = currentDistance
}
+2 -2
View File
@@ -68,7 +68,7 @@ object Room {
val leftLine = Line(1.0, 0.0, 150.0)
val bottomLine = Line(0.0, 1.0, 20.0)
val rightLine = Line(-1.2, 1.0, 140.0)
val rightLine2 = Line(1.0, 1.0, -350.0)
val rightLine2 = Line(1.0, 0.0, -200.0)
val walls = listOf<Wall>(Wall(upLine, 200, -150, 300, 300),
Wall(leftLine, -150, -150, 300, -20),
@@ -79,4 +79,4 @@ object Room {
return walls
}
}
}