예제 #1
0
 def test_gen_map(self):
     # Test normalized map first -- ground blocks are converged to one value
     self.assertEqual(normalize_map(zero_map), normalize_map(generate_block(0, 0, 0)))
     # Then test individual blocks
     self.assertEqual(zero_map, generate_block(0, 0, 0))
     # Uses random number generator -- seed inside
     self.assertEqual(zero_map, generate_block(0, 0, 0))
     self.assertNotEqual(zero_map, generate_block(1, 0, 0))
     self.assertNotEqual(zero_map, generate_block(0, 1, 0))
     self.assertNotEqual(zero_map, generate_block(0, 0, 1))
예제 #2
0
def write_obs_map(filepath):
    open(filepath).write(generate_obstacle_map(
        generate_block(0,0,0), len(generate_block(0,0,0))))
예제 #3
0
def write_zero_map(filepath):
    open(filepath).write(generate_block(0,0,0))