Esempio n. 1
0
def run(options):
  random.seed(options.random_seed)
  world_map = terrain.TerrainMap(terrain.read_map(options.map), options.map)
  robots = robot_module.load_robots(options.robots, world_map)
  history = play_history.PlayHistory()
  master.Master(options, robots, world_map, history).run()
  return history, world_map
Esempio n. 2
0
 def setUp(self):
     # Pre-set random seed to get robot #0 at 1,1, and #1 at 1,2.  This makes
     # it simpler to set up shot directions.
     random.seed(1)
     self._options = robotwar.parse_options([])
     self._history = play_history.PlayHistory()
     self._world_map = terrain.TerrainMap('  ', '')
     self._r0 = robot_module.Robot(0, self._world_map)
     self._game = master.Master(self._options, [self._r0], self._world_map,
                                self._history)
     self._round = self._game._prepare_round()
Esempio n. 3
0
 def setUp(self):
     random.seed(0)
     self._options = robotwar.parse_options([])
     self._history = play_history.PlayHistory()