Time control

219 views
Skip to first unread message

holden HK

unread,
Apr 18, 2014, 1:37:28 AM4/18/14
to starlo...@googlegroups.com
Hello,

I'm new to Starlogo TNG, so it's possible my question has already been answer, though I have searched the internet looking for the answer to no avail. I'd like to simulate growth or trigger an event depending on time passed, rather than the actions of other agents. For example, in Scratch there are two simple and useful functions to achieve it, namely "WAIT (n) SEC" and "TIMER"/"RESET TIMER". Is there anything like this in Starlogo TNG, and if not, is there a simple recipe to create such a function of the existing blocks?

Daniel Wendel

unread,
Apr 18, 2014, 1:57:03 PM4/18/14
to starlo...@googlegroups.com
Hi,

I think the command you're looking for is "yield." It pauses the agent for one "tick" which at 1x speed is 1/5th of the second. So if you want to pause for one second, do
repeat 5
  yield

Best,
--Daniel


On Fri, Apr 18, 2014 at 1:37 AM, holden HK <hold...@gmail.com> wrote:
Hello,

I'm new to Starlogo TNG, so it's possible my question has already been answer, though I have searched the internet looking for the answer to no avail. I'd like to simulate growth or trigger an event depending on time passed, rather than the actions of other agents. For example, in Scratch there are two simple and useful functions to achieve it, namely "WAIT (n) SEC" and "TIMER"/"RESET TIMER". Is there anything like this in Starlogo TNG, and if not, is there a simple recipe to create such a function of the existing blocks?

--
You received this message because you are subscribed to the Google Groups "StarLogo TNG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to starlogo-tng...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

holden HK

unread,
Apr 18, 2014, 9:56:07 PM4/18/14
to starlo...@googlegroups.com
Thanks! It does the trick, though it took me a few minutes to realize it makes a difference when you use YIELD in a loop before the instruction to be delayed (it works) and if you use it afterwards (it doesn't).
By the way, is there any updated list of Starlogo TNG instructions? The existing http://education.mit.edu/starlogo-tng/documentation/ does not even mention the YIELD function, which, in the case where the name of the instruction is rather not explicit, makes it hard to guess what it is for. I realize many of my questions are probably very easy to answer, and I could answer them myself if only the documentation was a bit more helpful...

Ian

Daniel Wendel

unread,
Apr 18, 2014, 10:11:02 PM4/18/14
to starlo...@googlegroups.com
Sorry, yeah, the documentation is quite outdated. The only updated source of documentation is the blocks themselves. If you hover over a block, a tooltip will pop up that tells you about the block. And even the tooltips aren't necessarily perfect. But I think the yield one would have helped. We don't have plans to update the TNG docs anytime soon because we are so busy working on StarLogo Nova. Maybe we should find a way to make a wiki so that the community can contribute. I know it would be a much better tool with more documentation.

--Daniel


--
Reply all
Reply to author
Forward
0 new messages