def __init__(self, test_files, engine_cmd, time_settings): self.engine = EngineController(StdioEngine(engine_cmd, log)) self.time_settings = time_settings self.tests = [ Test(test_file, self.time_settings.time_per_test) for test_file in test_files ]
def add_engine(self, name, cmd): self.engines[name] = EngineController(StdioEngine(cmd, None))
wrong['goal'] = True if (len(wrong) > 0): print "=========================" print pos.to_long_str() print result if wrong.has_key('goal'): print "Wrong goal move generated" print extra if wrong.has_key('result'): print "should be", move if __name__ == '__main__': try: rabbits_pos_fn = sys.argv[1] except IndexError: print "Usage: %s rabbits_pos_file" % sys.argv[0] sys.exit(1) engine_cmd = './akimot -c default.cfg -l' engine = EngineController(StdioEngine(engine_cmd, log)) for pos, move in map(lambda x: x.split('#'), (open(rabbits_pos_fn, 'r').readlines())): do_test(engine, pos.strip(), move.strip()) engine.quit() engine.cleanup()