Search code examples
outputanylogicagent

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.

Input code and Output display Input code and Output display


Solution

  • 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: enter image description here

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