英文:
Anylogic Error : root.arrival: Trying to schedule an event in the past. Negative timeout: NaN
问题
我有一个连接到MQTT网络的AnyLogic模型。当它接收到一些消息(有时根本没有消息)时,它会抛出这个错误并停止模型。
root.arrival: 尝试在过去安排事件。负超时:NaN
java.lang.RuntimeException: root.arrival: 尝试在过去安排事件。负超时:NaN
at com.anylogic.engine.Engine.error(Unknown Source)
at com.anylogic.engine.EventOriginator.d(Unknown Source)
at com.anylogic.engine.EventTimeout.restartTo(Unknown Source)
at com.anylogic.engine.jk$d.a(Unknown Source)
at com.anylogic.engine.jk$d.execute(Unknown Source)
at com.anylogic.engine.Engine.j(Unknown Source)
at com.anylogic.engine.Engine.le(Unknown Source)
at com.anylogic.engine.Engine.d(Unknown Source)
at com.anylogic.engine.Engine$l.run(Unknown Source)
我已经检查了所有变量,确保它们不为null或负值,它们似乎都没有问题。这个错误似乎是随机的,因为它可以在运行时的开始、结束或中间出现。我不指望在这里得到明确的解决方案。但如果我知道在哪里查找负值,那将非常有帮助。
提前感谢您。
英文:
I have an anylogic model that connects to an MQTT network. When it receives some messages (sometimes no messages at all) it throws this error and stops the model.
root.arrival: Trying to schedule an event in the past. Negative timeout: NaN
java.lang.RuntimeException: root.arrival: Trying to schedule an event in the past. Negative timeout: NaN
at com.anylogic.engine.Engine.error(Unknown Source)
at com.anylogic.engine.EventOriginator.d(Unknown Source)
at com.anylogic.engine.EventTimeout.restartTo(Unknown Source)
at com.anylogic.engine.jk$d.a(Unknown Source)
at com.anylogic.engine.jk$d.execute(Unknown Source)
at com.anylogic.engine.Engine.j(Unknown Source)
at com.anylogic.engine.Engine.le(Unknown Source)
at com.anylogic.engine.Engine.d(Unknown Source)
at com.anylogic.engine.Engine$l.run(Unknown Source)
I've already checked all the variables for null or negative values and they seem to be in the clear. This error seems random since it can appear at the beginning, the end or the middle of the runtime. I'm not expecting a clear solution for the issue here. But if I can know where to look for negative values that'll be great.
Thank you in advance.
答案1
得分: 1
Your Source block arrival
is set up in a way that it tries to create agents "in the past", likely due to how you set the model start time or what data it is fed from. If the model starts in 2023 but your data wants to create agents in 2021, this is what you get.
Change the data or the setup
英文:
Your Source block arrival
is set up in a way that it tries to create agents "in the past", likely due to how you set the model start time or what data it is fed from. If the model starts in 2023 but your data wants to create agents in 2021, this is what you get.
Change the data or the setup
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论