navigation.py 文件源码

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

项目:Round1 作者: general-ai-challenge 项目源码 文件源码
def on_start(self, event):
        ws = self.get_world().state
        # pick a random object
        self.state.target_obj, = random.sample(objects, 1)
        # give one of it to the learner
        ws.learner_inventory[self.state.target_obj] += 1
        # save how many objects of this we have
        self.state.initial_count = ws.teacher_inventory[self.state.target_obj]
        # inform the world that we can expect to receive such an object
        ws.teacher_accepts.add(self.state.target_obj)

        self.set_message("I gave you {indef_object}. Give it back to me "
                         "by saying \"I give you {indef_object}\"."
                          .format(indef_object=msg.indef_article(
                              self.state.target_obj)))

    # if I have one more of the target object, the learner solved the task.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号