Skip to content
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

Using time:go-until with LogoTime #35

Closed
dk-forestry opened this issue Aug 4, 2014 · 4 comments
Closed

Using time:go-until with LogoTime #35

dk-forestry opened this issue Aug 4, 2014 · 4 comments

Comments

@dk-forestry
Copy link

Hi Colin,

Thanks for resolving the last issue that quickly!

Could you also have a look into this question: http://stackoverflow.com/questions/25060039/using-timego-until-in-netlogo-time-extension ?

Here's a copy of the question:

Using the NetLogo time extension on NetLogo 5.1.0 and Windows 8.1, I would like a simulation to stop either at a specific date, or after a specific period of time.

time:go-until should work for this according to the documentation on https://github.com/colinsheppard/time/#discrete-event-scheduler, but I can't figure out how to use it correctly. Here's what I have so far:

extensions [time]

globals[
start-time
current-time
]

to setup
clear-all
reset-ticks

set start-time time:create "2011-01-01"
set current-time time:anchor-to-ticks start-time 1.0 "days"
time:anchor-schedule start-time 1.0 "days"

create-turtles 2
time:schedule-repeating-event-with-period turtles task [fd 1] 1 1.0 "days"
end

to go-until
time:go-until 40
;time:go-until time:create "2011-03-01"
;time:go-until time:plus start-time 33.0 "days"
end

Like this, the sim runs for 40 ticks and then ends as expected. However, when I replace time:go-until 40 with either time:go-until time:create "2011-03-01" or time:go-until time:plus start-time 33.0 "days", I get this error at the start of the simulation:

Extension exception: time: was expecting a number as argument 1, found this instead: {{time:logotime 2011-03-01}}
error while observer running TIME:GO-UNTIL
called by procedure GO-UNTIL
called by Button 'go'

Here's an example from the documentation which should work correctly:

time:go-until time:plus t-datetime 1.0 "hour"
;; Execute events within the next hour; t-datetime is the current time.
What am I missing?

@colinsheppard
Copy link
Owner

Hey again, wow [forehead slap], this is apparently a case of getting ahead of myself during documentation. I clearly intended to add the capability of using a LogoTime and not just a number, but I never implemented it.

Fortunately, it was quick and painless to add, which I just did and I will again release a new version of the extension shortly.

Thank you for using the extension, for your patience, and for bringing these issues to my attention... I appreciate it! Feel free to submit more issues if you have them... as you've probably determined already, I don't monitor stackoverflow, so github is your best bet.

Cheers,
Colin

@kgtroitzsch
Copy link

I am trying to use the time extension together with NetLogo's Behavior Space. My model stops as requested when it is run separately, but in Behaviour Space they never stop (and do not update the view, the monitors and the plots). Any experience with the time extension under Behavior Space?

@colinsheppard
Copy link
Owner

@kgtroitzsch sorry I didn't respond to this, I had a busy Spring. I've never attempted to use the time extension with Behavior Space, so I can't really say why the problem is occurring. I'll add it to my issues list for future investigation.

@kgtroitzsch
Copy link

Dear Colin,

no problem, I found a hack to circumvent the problem J

Best

Klaus


Dr. Klaus G. Troitzsch, Universitätsprofessor (a.D. / retired)

Institut für Wirtschafts- und Verwaltungsinformatik

Universität Koblenz-Landau

e-mail: mailto:kgt@uni-koblenz.de kgt@uni-koblenz.de

www: http://userpages.uni-koblenz.de/~kgt http://userpages.uni-koblenz.de/~kgt,

Von: Colin Sheppard [mailto:notifications@github.com]
Gesendet: Sonntag, 12. Juni 2016 18:58
An: colinsheppard/time
Cc: kgtroitzsch; Mention
Betreff: Re: [colinsheppard/time] Using time:go-until with LogoTime (#35)

@kgtroitzsch https://github.com/kgtroitzsch sorry I didn't respond to this, I had a busy Spring. I've never attempted to use the time extension with Behavior Space, so I can't really say why the problem is occurring. I'll add it to my issues list for future investigation.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #35 (comment) , or mute the thread https://github.com/notifications/unsubscribe/AHsyG1UhKXkmGahinvmKx_NkNPSP5HvYks5qLDqtgaJpZM4CTrYs . https://github.com/notifications/beacon/AHsyGyK3si9dR2hmLtJtbQdEAZVFKbVCks5qLDqtgaJpZM4CTrYs.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants