报错位置
assert all([action_i in ACTION_MEANING.keys() for action_i in agents_action]), \
"Invalid action found in the list of sampled actions {}" \
". Valid actions are {}".format(agents_action, ACTION_MEANING.keys())

经检查,发现传给agents_action的数据形式错误

agents_action需要的是一维数组,数组长度根据智能体个数而定
故在赋值给agents_action前,将actions改为
actions = np.array(actions).flatten()

本文档探讨了在处理智能体动作列表时遇到的错误,指出actions需要转换为一维数组以确保与ACTION_MEANING键的有效对应。作者提供了修复方法并强调了正确数据结构的重要性。

938

被折叠的 条评论
为什么被折叠?



