time:schedule-event should handle times less than one millisecond in the future
@ERSUCC is already working on this.
Since Feb 23, 2026.
Assessment
This issue has not been assessed yet.
Description
time:schedule-event takes an argument that is the future time at which the event is to be scheduled. When ticks are associated with logotimes (via time:anchor-schedule), then this argument can be a logotime.
When that logotime is less than one millisecond past the current time, schedule-event raises an error, saying that you tried to schedule an event in the past. We ought to be able to catch and prevent this error, and instead put the event at the top of the event queue so it is next for execution.
This problem is important because it is standard in discrete event simulation to use random-exponential to determine the time between events, and random-exponential often produces very small values.
The Library model Distribution Center Discrete Event Simulator provides an example, at lines 166-170. The commented-out statement
time:schedule-event "observer" [ -> receive-an-order ] time:plus sim-time time-to-next-order "minutes"
would always work if this problem was fixed, but it currently raises an error occasionally.
- Dominant language
- Scala
- Stars
- 8
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NetLogo/Time-Extension
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 68/100
NetLogo/Time-Extension#39 ·
-
documentation
NetLogo/Time-Extension#52 · 9 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
NetLogo/Time-Extension#50 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
NetLogo/Time-Extension#49 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
NetLogo/Time-Extension#47 · 1 comment ·
All issues in NetLogo/Time-Extension
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ergoplatform/ergodocs#614 ·
-
area:ci enhancement requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/datafusion-comet#6078 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug delta-datalayout flink
Difficulty 2/5 1-3 hours Newbie friendliness 86/100