online random, remove best sonar, fixed error on test room line
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user