[starlogo-users] Beginner needs help

Eric Klopfer klopfer at MIT.EDU
Sun Dec 17 14:18:03 EST 2006


In a lot of ways StarLogo (and StarLogo TNG) is much easier to work  
with many turtles than they are with 1.

If you have 10 turtles on the screen and you bring out a forward 1  
block and double click on it they will all move forward 1.  To get  
only ones specific turtle among those 10  turtles to move forward 1  
takes more work.

In the context of multi-agent simulations this works well, since we  
assume many agents are doing the same thing in parallel.  But in  
complex interactions around a single agent it doesn't work as well  
(though is still possible as you might see in some of the game  
examples in TNG).  Perhaps there are alternative views that you can  
take on the problem that fit better in this paradigm, which don't  
require you to address specific turtles.

However to get information on individual agents you can use the fact  
that every agent has an id called "who".  This is a unique number  
that you can both get from agents and use to address particular  
agents.  If you click on an agent in spaceland you can find out the  
number of a particular agent through its monitor that pops up.  You  
can see this in the main tutorial (http://education.mit.edu/starlogo- 
tng/tutorial-overview.htm).  Note that the order of creation of who  
values may not be predictable.  You can store and use these numbers,  
but if you create and kill many agents their who values will change.

Similarly the monitor you pop up shows the agent x and y  
coordinates.  These are obtained through the xcor and ycor blocks in  
the Movement palette.

To create a new variable, go to the Procs & Vars (Procedures and  
Variables) category and drag out a new Agent Number block onto the  
Turtles space on the Canvas. You'll see that it gets labeled Turtles  
Agents Number. Change the name of this block to whatever you want the  
variable to be.  The blocks that both get the value for that variable  
and set the value for that variable are in the drawer for that  
breed.  Take a look at the Immunity section of the epidemic tutorial  
for an example of how this is used.  When you make new variables  
you'll see them appear in the agent monitors which I mentioned above  
in the context of who.  We're working on making defining and using  
variables more straightforward for the beta release.

You might also take a look at the previous version of StarLogo and  
the Adventures in Modeling book to learn some of the StarLogo  
basics.  There is much better documentation and explanation in the  
book than we have created for TNG so far.  Hopefully when TNG gets  
its first final release it will start to catch up.  Many of the ideas  
of the previous StarLogo will transfer to TNG (like who values,  
addressing turtles, the modeling paradigm, etc.) and might make  
jumping into TNG easier until comparable documentation exists.

Hope this helps.

Eric


On Dec 17, 2006, at 1:43 PM, Oscar González Seguí wrote:

> Eric:
> I thank your immediate answer.
> You can take me as a wild case of somebody looking for a simulation  
> tool (knowing some mathematics and logic, and a poor BASIC).
>
> I want to do something like this:
>
> I need to create
> one agent (agent of the type turtles), and wish to label it as  
> "1" (or anything)
> each of these turtles  support variables:
> var1: (with integer values)
> var2: idem
> var-of-position (x,y)
>
> That's my one week problem.
> I can create one agent (Create turtles 1)
> But that's all my work.
> How can I know its ID? Or instead call that agent "A1"
> How can I know its x coord and y coord? How can I define:  "Turtles  
> support var1, var2..."?
> How can I know where A1 is standing? :Tell me coord x, coord y of 'A1'
>
> I have already seen the tutorial epidemic. Remains opaque for me.
>
> I'm sorry Professor, that's my situation.
>
> Thanks again.
>
> Oscar
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> -----Mensaje original-----
> De: Eric Klopfer [mailto:klopfer at MIT.EDU]
> Enviado el: Dom 17/12/2006 11:56 a.m.
> Para: Oscar González Seguí
> CC: starlogo-users at media.mit.edu
> Asunto: Re: [starlogo-users] Beginer needs help
>
> Hi Oscar
>
> The notion of developing a programming structure is a good one that
> we have yet to really solidify in TNG.  As the language develops
> we're hoping to do this (the beta version due early next year should
> have a start on this with a reworked blocks canvas).
>
> In the mean time, you can try looking at the tutorials.  In
> particular the epidemic tutorial should take you through much of what
> you are looking for.
> http://education.mit.edu/starlogo-tng/tutorial-epidemic.htm
>
> Eric
>
> On Dec 17, 2006, at 12:18 PM, Oscar González Seguí wrote:
>
> > This is my first message to the list.
> >
> > Thank you developers of StarLogo! Even if at the present I cannot
> > start, I understand it is an incredible tool.
> >
> > I'm learning the basics of StarLogo with the TNG version.
> >
> > 1) I'm trying to create just one agent and stick variables (with
> > values) to it.
> >
> > 2) After that, I'd like to create other agents in same and
> > different shapes (¿or breeds?), each  with variables and values too.
> >
> > 3) After that I want that every one agent compare itself with
> > another when meeting (not exactly colliding, but placed in certain
> > region near around). But this is the future.
> >
> > I attempted to begin with that job during a week. Cannot do the
> > first point.
> >
> > Can you help me?
> >
> > Did anybody build some basic meeting structure?
> >
> > Thank you,
> >
> > Oscar Gonzalez
> >
> >
> > _______________________________________________
> > starlogo-users mailing list
> > starlogo-users at media.mit.edu
> > http://education.mit.edu/mailman/listinfo/starlogo-users
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://education.mit.edu/pipermail/starlogo-users/attachments/20061217/1c1b5d01/attachment-0001.html


More information about the starlogo-users mailing list