打印出代理的最大速度作为输出,一直显示为零。

huangapple go评论56阅读模式
英文:

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,您会得到速度。

英文:

As per code-complete, getSpeed returns the assigned speed of the agent, not the actual current speed it moves at, this may be zero when it is stationary:
打印出代理的最大速度作为输出,一直显示为零。

Call your traceln while the agent moves and you get the speed.

huangapple
  • 本文由 发表于 2023年5月15日 13:35:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76251122.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定