class Tests(unittest.TestCase):
    def setUp(self):
        self.world = GridWorld(10, 10)
        self.obstaclesProb = 0.2
        self.world.addRandomObstacles(math.floor(self.world.getLength() * self.obstaclesProb))
        for cell in self.world.cells:
            if cell.reachable:
                self.goal = cell
                break

    def test_runs(self):
        solution = solve(self.world, self.goal)
        print(enigmaAsStr(solution, self.goal))
Example #2
0
class Tests(unittest.TestCase):
    def setUp(self):
        self.world = GridWorld(10, 10)
        self.obstaclesProb = 0.2
        self.world.addRandomObstacles(
            math.floor(self.world.getLength() * self.obstaclesProb))
        for cell in self.world.cells:
            if cell.reachable:
                self.goal = cell
                break

    def test_runs(self):
        solution = solve(self.world, self.goal)
        print(enigmaAsStr(solution, self.goal))