예제 #1
0
    def test_25_Colours(self):
        start = time.time()
        inp = Map("images/25colours.ppm")

        # Currently being run with your solution... But this
        #   will be replaced with a call to mine.
        Marcher.findPath(inp, Marcher.all_colour_weight)
        end = time.time()
        print(str(end - start) + "test 7")
예제 #2
0
 def test_Gradient_One(self):
     start = time.time()
     inp = Map("images/grad.ppm")
     cost = Marcher.findPath(inp, similar_colour)
     inp.outputPath()
     end = time.time()
     print(str(end - start) + "test 5")
     self.assertAlmostEqual(cost, 278.7514937, 5)
예제 #3
0
 def test_Maze_Big(self):
     start = time.time()
     inp = Map("images/bigmaze.ppm")
     cost = Marcher.findPath(inp, how_white)
     inp.outputPath()
     end = time.time()
     print(str(end - start) + "test 4")
     self.assertAlmostEqual(cost, 8.6199999, 5)
예제 #4
0
 def test_Two(self):
     start = time.time()
     inp = Map("images/spiral.ppm")
     cost = Marcher.findPath(inp, similar_colour)
     inp.outputPath()
     end = time.time()
     print(str(end - start) + "test 2")
     self.assertAlmostEqual(cost, 991.25540719, 5)
예제 #5
0
 def test_One(self):
     start = time.time()
     inp = Map("images/water.ppm")
     cost = Marcher.findPath(inp, similar_colour)
     inp.outputPath()
     end = time.time()
     print(str(end - start) + "test 1")
     self.assertAlmostEqual(cost, 1280.8152597, 5)
예제 #6
0
 def test_Gradient_Two(self):
     start = time.time()
     inp = Map("images/grad.ppm")
     cost = Marcher.findPath(inp, how_white)
     inp.outputPath()
     end = time.time()
     print(str(end - start) + "test 6")
     self.assertAlmostEqual(cost, 2168.3216577, 5)