英文:
How to Print out the maximum speed of the agent as the output consistently shows zero
问题
I am encountering difficulties setting the maximum speed for my agents and unable to obtain the correct value when attempting to print it. The output consistently shows zero. I would appreciate your assistance in resolving this issue.
英文:
I am encountering difficulties setting the maximum speed for my agents and unable to obtain the correct value when attempting to print it. The output consistently shows zero. I would appreciate your assistance in resolving this issue.
Input code and Output display
答案1
得分: 1
getSpeed
返回代理的分配速度,而不是它实际移动时的当前速度,在代理静止时可能为零。 在代理移动时调用 traceln
,您会得到速度。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论