pig_chase_dqn_top_down.py 文件源码

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

项目:malmo-challenge 作者: Kaixhin 项目源码 文件源码
def run_experiment(agents_def):
    assert len(agents_def) == 2, 'Not enough agents (required: 2, got: %d)' \
                                 % len(agents_def)

    processes = []
    for agent in agents_def:
        p = Thread(target=agent_factory, kwargs=agent)
        p.daemon = True
        p.start()

        # Give the server time to start
        if agent['role'] == 0:
            sleep(1)

        processes.append(p)

    try:
        # wait until only the challenge agent is left
        while active_count() > 2:
            sleep(0.1)
    except KeyboardInterrupt:
        print('Caught control-c - shutting down.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号