简体   繁体   中英

Discrete Event Scheduling in NetLogo: Executing some command on some specific tick

My code has one condition:

    if ticks = 10^7 [ do-something ]

Now this condition is checked on every ticks though I know exactly when I have to execute the command. This might be slowing my code. The time extension does exactly this by time:go command. My command using time extension is:

     time:schedule-event patches task do-something 1000000

But this throwing an error:

Extension exception: Attempted to schedule an event for tick 999999.0 which is before the present 'moment' of 1000000.0
error while observer running TIME:SCHEDULE-EVENT
   called by procedure GO
   called by Button 'go'

Is there something I am missing? Or any other efficient way to schedule some event at specific tick without checking the ticks condition every tick?

If this looks like a bug in the time extension, please post it at https://github.com/colinsheppard/time/issues and tell us where we can find your code. (Or email it to me.) Steve R.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM