def run(self, vacuum_class, max_steps=10000):
scores = []
for seed in seeds:
logging.debug('Running seed {}...'.format(seed))
random.seed(seed)
dve = RandomDirtyVacuumEnvironment()
dve.add_to_random_empty_square(vacuum_class())
step = 0
steps_to_clean = 0
while step < max_steps:
dve.step()
step += 1
if not dve.is_clean():
steps_to_clean += 1
scores.append(Result(seed, dve.agents[0].performance,
steps_to_clean))
return scores
评论列表
文章目录