chunk_vacuum.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:cpsc415 作者: WheezePuppet 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号