Beispiel #1
0
    def test_propagate_short(self):
        grid = Grid(8, 8)
        grid.add_source(Source(2, 1))
        grid.propagate(9)

        self.assertEqual(grid[0], [999.0, 999.0, 999.0, 999.0])
        self.assertEqual(grid[1], [1, 1, 1, 999.0])
        self.assertEqual(grid[2], [1, 0, 1, 999.0])
        self.assertEqual(grid[3], [1, 1, 1, 999.0])
Beispiel #2
0
 def test_propagate(self):
     grid = Grid(8, 8)
     grid.add_source(Source(2, 1))
     grid.propagate()
     print (grid)
     self.assertEqual(grid[0], [2, 2, 2, 2])
     self.assertEqual(grid[1], [1, 1, 1, 2])
     self.assertEqual(grid[2], [1, 0, 1, 2])
     self.assertEqual(grid[3], [1, 1, 1, 2])