(robot1, memory1, robot2, memory2)
| 8 | } |
| 9 | |
| 10 | function compareRobots(robot1, memory1, robot2, memory2) { |
| 11 | let total1 = 0, total2 = 0; |
| 12 | for (let i = 0; i < 100; i++) { |
| 13 | let state = VillageState.random(); |
| 14 | total1 += countSteps(state, robot1, memory1); |
| 15 | total2 += countSteps(state, robot2, memory2); |
| 16 | } |
| 17 | console.log(`Robot 1 needed ${total1 / 100} steps per task`) |
| 18 | console.log(`Robot 2 needed ${total2 / 100}`) |
| 19 | } |
| 20 | |
| 21 | compareRobots(routeRobot, [], goalOrientedRobot, []); |
no test coverage detected