def run_mission(agents_def):
assert len(agents_def) == 2, 'Incompatible number of agents (required: 2, got: %d)' % len(agents_def)
quit = Event()
processes = []
for agent in agents_def:
agent['quit'] = quit
p = Process(target=agent_factory, kwargs=agent)
p.daemon = True
p.start()
if agent['role'] == 0:
sleep(1) # Just to let time for the server to start
processes.append(p)
quit.wait()
for process in processes:
process.terminate()
pig_chase_human_vs_agent.py 文件源码
python
阅读 32
收藏 0
点赞 0
评论 0
评论列表
文章目录