-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ising: use no-display
instead of repeat
to speed up model
#131
Conversation
Cool idea. There are advantages and disadvantages to both. I think the Finally, not sure how much of a consideration this is, but NLW doesn't support I think I slightly prefer the |
You're right. That's a problem.
Also a very good point. |
I think If you made Ising use it, it would be the only model in Sample Models to do so. |
I wasn't aware of |
99%, if not 100%, of uses in the past were to compensate for the nonexistence of tick-based updates in older NetLogo versions, or were just because people didn't understand they should be using tick-based updates instead. It's also really hard to implement in a fully general way, so even before NLW existed, I was already looking ahead to future NL or NL-like engines that might not be capable of updating the display from arbitrary places in the code. There are pretty fundamental reasons it isn't in NLW currently and might never be in NLW — I think there's an issue somewhere with discussion on that. |
Oh and I'll just throw one more thing on this: |
I understand. Thanks for the explanation. Still, when using tick-based updates, it leaves NetLogo without a way to advance the tick counter without triggering a display update (since |
There is definitely a missing NetLogo feature here; see my comment at NetLogo/NetLogo#741. |
Right. Allowing NetLogo to skip frames to hit the target frame rate would indeed fix our Ising problem without needing to resort to any |
I found a different way to speed up the Ising model: instead of using
repeat 1000
and thenticks-advance 1000
, I useno-display
to turn off view updates and explicitly calldisplay
every 1000 ticks.This is, in my opinion, a much less convoluted way to achieve the desired result. It also means that
go
runs once per tick instead of once every 1000 ticks, which is more intuitive.@UriCCL, @arthurhjorth, @qiemem, what do you think? Unless someone has an objection, I will update the info tab accordingly and merge the changes.
(@UriCCL, here is the direct link for downloading the updated model if you want to check it out: https://raw.githubusercontent.com/NetLogo/models/ising-no-display/Sample%20Models/Chemistry%20%26%20Physics/Ising.nlogo )