1

The documentation of commUser.getPosition() advices to return Optional.absent() if no position can be determined. Yet, lines 170 in CommRenderer throws an exception if commUser.getPosition() is absent:

  helper.fillCircle(user.getPosition().get(), DOT_RADIUS);

The method exampleCommunicationAgent.getPosition() returns absence, if RoadUser is not on roadmap - which happens sometimes, but I cannot pinpoint when exactly. It might have something to do with increasing the speed, but I can't reproduce it reliably.

user442934
  • 13
  • 4
  • Ah, this looks like a bug. It's probably hard to reproduce because it is related to multi-threading, the renderer is called from the GUI thread. Based on your description it appears that the position gets changed during the execution of the render() call. A fix would be to call the getPosition() method once and locally store the result instead of repeatedly calling it. I'll try to fix this in the coming days, feel free to send a pull request if you want to help. Thanks for reporting this! – rinde May 17 '18 at 11:13

1 Answers1

0

This bug is fixed as of RinSim 4.4.5.

rinde
  • 1,181
  • 1
  • 8
  • 20