NetLogo / NetLogo/Time-Extension

time:schedule-event should handle times less than one millisecond in the future

Open
#53 5 comments 0 reactions 1 assignee View on GitHub

@ERSUCC is already working on this.

Since Feb 23, 2026.

Dominant language
Scala
Stars
8
Forks
4
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.