Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

netlogo-users · NetLogo Users

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 7818 - 7847 of 16653   Oldest  |  < Older  |  Newer >  |  Newest Start Topic
Messages: Show Message Summaries Sort by Date ^  
#7818 From: "lang.jim61" <lang.jim61@...>
Date: Mon Jun 2, 2008 12:39 pm
Subject: predator prey simulations
lang.jim61
Send Email Send Email
 
Hi,
I am planning to simulate the anti predator behaviour of a species and
wonder if Netlogo is a suitable environment. I need to simulate group
cohesion, co-operative hunting etc and, as I do not have a great deal
of programming experience, would appreciate any advice.

Thanks

Jim

#7819 From: auth1lag
Date: Mon Jun 2, 2008 3:15 pm
Subject: Defining minimum distances between patches of a different state
auth1lag
 
Hi to everyone,
my problem is how to define the distance between each patch of a
certain type (e.g. URBAN-PATCHES) to the nearest patch of a different
type (e.g. COMMERCIAL-PATCHES).
Obviously I need a procedure that takes each patch and searches for the
minimum distance, but which exactly could that be?

Thanks in advance for helping me out...

#7820 From: Howard Noble <howard.noble@...>
Date: Mon Jun 2, 2008 3:46 pm
Subject: Re: predator prey simulations
howardnoble
Send Email Send Email
 
Have you seen the existing predator-prey models in the 'Models Library'
in NetLogo? (e.g. open NetLogo and presss ctrl-m to go to the models
library).

Through the web you can find other predator-prey NL models e.g.:
Googling "predator prey netlogo" gives:

http://academic.evergreen.edu/m/mcavityd/NetLogo.htm

I am also a newbie to NL programming but I am managing to learn the
language through looking at the NL dictionary and programming guides,
looking at how other models are coded, and the support through this list
is really useful.

Howard

lang.jim61 wrote:
> Hi,
> I am planning to simulate the anti predator behaviour of a species and
> wonder if Netlogo is a suitable environment. I need to simulate group
> cohesion, co-operative hunting etc and, as I do not have a great deal
> of programming experience, would appreciate any advice.
>
> Thanks
>
> Jim
>
>
>

#7821 From: "cplusplus_guru" <cplusplus_guru@...>
Date: Mon Jun 2, 2008 5:46 pm
Subject: NetLogo as a plain, basic, classic, generic Logo?
cplusplus_guru
Send Email Send Email
 
Can NetLogo be used as a plain, basic, classic, generic Logo?

I want to start working with NetLogo with just a bare-bones screen,
with one turtle and a command prompt.  I am not interested in NetLogo
models just yet, but some NetLogo features, particularly the Java Sound
interface.

#7822 From: "James Steiner" <gregortroll@...>
Date: Mon Jun 2, 2008 6:22 pm
Subject: Re: Defining minimum distances between patches of a different state
askturtlezero
Send Email Send Email
 
Something like this:


min-one-of AGENTSET [ distance myself ]

For example, assuming that patches-own [ nearest-commercial ], you
could do this:

ask urban-patches
[ set nearest-commercial min-one-of commercial-patches [ distance myself ]
]


"distance myself" means "the distance between this patch, and the
patch that is making me run this code"

In this case, it is each urban patch, in turn,  making the commercial
patches run the code "distance myself".  So, "myself" refers back to
the urban patch.

Hope this helps~

~~James





On Mon, Jun 2, 2008 at 11:15 AM, auth1lag <no_reply@yahoogroups.com> wrote:
> Hi to everyone,
> my problem is how to define the distance between each patch of a
> certain type (e.g. URBAN-PATCHES) to the nearest patch of a different
> type (e.g. COMMERCIAL-PATCHES).
> Obviously I need a procedure that takes each patch and searches for the
> minimum distance, but which exactly could that be?
>
> Thanks in advance for helping me out...

#7823 From: Manuel M <mnl_moreira@...>
Date: Mon Jun 2, 2008 7:52 pm
Subject: retrieving who
mnl_moreira
Send Email Send Email
 
Hi colleagues,

I am pretty new in netlogo's world, I wonder if you can help me with a simple question.

How can I ask a turtle to inform me about his ID?

I know how to use the who function to select a particular turtle but I do not know how to ask the turtle to give me ID.

The dictionary says: " You can use the turtle reporter to retrieve a turtle with a given who number" but I cannot find out how to do it from the code

Thanks in advance,

Manuel


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar

#7824 From: "Bergen-Hill, Tobin A." <tbergenhill@...>
Date: Mon Jun 2, 2008 4:30 pm
Subject: RE: predator prey simulations
tbergenhill
Send Email Send Email
 

Jim:

 

For a relevant example, check out the “Wolf Sheep Predation” model in NetLogo’s Model Library, found under the Biology folder. 

 

--

Tobin Bergen-Hill

Lead Simulation Modeling Engineer, E526

tbergenhill@...

703-983-3759

From: netlogo-users@yahoogroups.com [mailto:netlogo-users@yahoogroups.com] On Behalf Of lang.jim61
Sent: Monday, June 02, 2008 8:39 AM
To: netlogo-users@yahoogroups.com
Subject: [netlogo-users] predator prey simulations

 

Hi,
I am planning to simulate the anti predator behaviour of a species and
wonder if Netlogo is a suitable environment. I need to simulate group
cohesion, co-operative hunting etc and, as I do not have a great deal
of programming experience, would appreciate any advice.

Thanks

Jim


#7825 From: "mxanthakis" <mxanthakis@...>
Date: Tue Jun 3, 2008 8:22 am
Subject: Netlogo loop command
mxanthakis@...
Send Email Send Email
 
Hi,

I would like to perform a loop in Netlogo model.
I want to change a variable's value with step 1,2,3,4... every time
and every time the first variable reach number 12 a second variable
start from number 1, then when the first variable reach the value 24
the second variable to be set to value 24 etc.

How can I create such a loop in Netlogo?

Thanks in advance

Michael

#7826 From: "Howard" <howard.noble@...>
Date: Tue Jun 3, 2008 9:28 am
Subject: Re: retrieving who
howardnoble
Send Email Send Email
 
I can't answer your specific problem because I am not entirely sure
what you want to do with 'who' but he's a little bit of a messy tip.
If you put this into google:

filetype:nlogo who

you'll find lots of nlogo programs with examples of using who.
hopefully one of them will be close to what you want.

regards, howard

--- In netlogo-users@yahoogroups.com, Manuel M <mnl_moreira@...> wrote:
>
> Hi colleagues,
>
> I am pretty new in netlogo's world, I wonder if you can help me with
a simple question.
>
> How can I ask a turtle to inform me about his ID?
>
> I know how to use the who function to select a particular turtle but
I do not know how to ask the turtle to give me ID.
>
> The dictionary says: "
>         You can use the turtle reporter to retrieve a turtle with a
given
>         who number" but I cannot find out how to do it from the code
>
> Thanks in advance,
>
> Manuel
>
>
>
> __________________________________________________
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
>

#7827 From: "getachew" <getishas@...>
Date: Tue Jun 3, 2008 9:35 am
Subject: Netlogo and real world Data
getishas
Send Email Send Email
 
Hello Dear Netlogo Users

I am new netlogo user and currently trying to model bargaining power
of farmers and traders at farmgate transaction. I have got a
difficulty of intering spesific variables to each type of agents? Is
that the same if inspect each agent and fill the data manually? and
then start defining each variables in the procedure tab? waiting your
response and even an excellent idea.

Sincerly,

#7828 From: "lang.jim61" <lang.jim61@...>
Date: Tue Jun 3, 2008 11:14 am
Subject: Re: predator prey simulations
lang.jim61
Send Email Send Email
 
Thank you very much for the advice.

JIm

--- In netlogo-users@yahoogroups.com, "lang.jim61" <lang.jim61@...>
wrote:
>
> Hi,
> I am planning to simulate the anti predator behaviour of a species
and
> wonder if Netlogo is a suitable environment. I need to simulate group
> cohesion, co-operative hunting etc and, as I do not have a great deal
> of programming experience, would appreciate any advice.
>
> Thanks
>
> Jim
>

#7829 From: Esther Verreau <everreau@...>
Date: Tue Jun 3, 2008 1:55 pm
Subject: Re: retrieving who
estherverreau
Send Email Send Email
 
>
> I am pretty new in netlogo's world, I wonder if you can help me with a simple
question.
>
> How can I ask a turtle to inform me about his ID?
>
> I know how to use the who function to select a particular turtle but I do not
know how to ask the turtle to give me ID.
>
> The dictionary says: "
>        You can use the turtle reporter to retrieve a turtle with a given
>        who number" but I cannot find out how to do it from the code
>

Hi Manuel -

You should probably take a look at the variables section of the
programming guide:

http://ccl.northwestern.edu/netlogo/docs/programming.html#variables

turtles can access their own variables directly, for example.

ask turtles[ print who ]

will print the who numbers of all the turtles to the command center.

the observer can access turtle variables using OF, for example:

print [who] of turtle 0

will print '0' to the command center.

hope this helps.

esther

#7830 From: Howard Noble <howard.noble@...>
Date: Tue Jun 3, 2008 3:39 pm
Subject: Re: linking
howardnoble
Send Email Send Email
 
Thanks for all these code examples James. I'll admit for a newbie like me I struggled to understand how NL achieves what it does. I set myself the task of trying to write the "pseudocode" for the procedure below as a way of familiarising myself with the NL language. I thought it might be interesting for any other newbies on this list to see, and also for the more experienced programmers to be able to correct my misinterpretations.

I've modified the code slightly to:

to form-link
 if is-computer? computer-being-used [
 stop
 ]
 ;; simply find an unused computer (that is not this computer)
 let free-computer one-of other computers with [ not is-person? user-id  ]
 ;; is there a free computer?
 if is-computer? free-computer
 [  ;; use this computer
  set computer-being-used free-computer
  ;; logon to the computer
  ;; (tell the free computer that I am using it)
  ask free-computer [ set user-id myself ]
]
end


lines 2 and 3: The is-breed? (is-computer) primitive description in the NL dictionary " Reports true if value is of the given type, false otherwise." is a bit to cryptic for me and its difficult to search for examples of how this primitive is used because "breed" will equate to a large number of names. How I understand this primitive is that in this case, if computer-being-used reports as holding anything but nobody then the procedure will stop. In terms of what I am trying to achieve this means that if a computer has been associated with a person then there's no need to form-link.

line 6: let's a procedure variable called free-computer hold the breed and who number of a person user-id, where the person is not associated with the calling  computer, and is not already assocatiated with another computer. In general I find this the most confusing line, I really find it hard to understand what the code in the square brackets is doing

line 8: again, i find this difficult to understand because I am not sure how is-computer? works but I think it means that if free-computer holds anything except nobody then...
line 10: computer-being-used is set to the who number and breed stored in free-computer procedure variable
line 13: then I don't understand how this line works, i don't understand how you can ask free-computer anything as its not an agent but a procedure variable. generally i see that user-id is being set to the who number of the agent that is calling it e.g. in this case user-id is being set to the who number of the computer that is running this procedure.

In short, there's I don't know how this works because I'm finding the NL too cryptic, and its difficult to find examples of how primitives have been used elsewhere in code. Hopefully I can learn from this list.

Anyway, I don't know if this is a useful exercise for other NLs newbie's - I can take a hint :-)

James Steiner wrote:
Oh, right.
You can use the OTHER operator to exclude an agent itself from an
agentset... so we'd do that in the first part:
(capitalized for emphasis, only. Netlogo code is case-insensitive)
;; simply find an unused computer (that is not this computer)
let free-computer one-of OTHER computers with [ not is-person? user ]
;; is there a free computer?
if is-computer? free-computer
[ ;; use this computer
set using free-computer
;; logon to the computer
;; (tell the free computer that I am using it)
ask free-computer [ set user myself ]
]
Another way to write the "one-of other... " line would be this:
one-of computers with [ not is-person? user and self != myself ]
SELF and MYSELF are concepts that give some users trouble, but are
very useful to understand.
Please keep asking questions!
~~James
On Thu, May 29, 2008 at 11:35 AM, Howard Noble
<howard.noble@...> wrote:
Thanks James.
This is a lot more than I bargained for with my question so I'll try
battle through all the concepts I don't understand yet.
You've given me loads of new ideas too e.g. allow the simulation user to
create two types of simulation: one heterogeneous based on mean
parameters, and one homogeneous, based on a single individual. I'll call
the second version "if everyone was like me" ...the world will fall apart!
One quick question. I want to use the linking version to tie agents
together (because it is easiest way to show the relationship in the
View). The code you sent through throws an error because the computers
try to link to themselves eventually. How can I stop this? I tried
something like:
...
if (is-computer? free-computer) and (is-computer? free-computer not self)
[ create-usage-with free-computer ]
...
but this is grammatically wrong. I can't work out how to write this
correctly.
H


#7831 From: "Hengeveld, Geerten" <geerten.hengeveld@...>
Date: Wed Jun 4, 2008 9:36 am
Subject: Re: predator prey simulations
geertenhenge...
Send Email Send Email
 
Hi Jim,

next to the predator-prey and wolf-sheep examples, there are some
flocking examples that will improve your flock cohesion. I'm not sure
for an example on cooperative hunting, but Netlogo would be the ideal
place to start true agent-based simulations on this! (you'll have to
figure out the algoritms there by yourself.)

Geerten

#7832 From: neverlate19
Date: Wed Jun 4, 2008 12:32 pm
Subject: About Supply Chain Issue,build the Third-Party logistics model
neverlate19
 
hi,dear friends:
   i need build the Third-Party logistics model in supply chain network,
Do anyfriend know the model of Third-Party logistics ??

#7833 From: Howard Noble <howard.noble@...>
Date: Wed Jun 4, 2008 8:49 am
Subject: optimisation
howardnoble
Send Email Send Email
 
Hello,

I've got what I want to achieve in one part of my program working but
the code is very clunky and needs speeding up.

Can anyone suggest some coding approaches or general ideas as to how I
can improve this code. It seems that hatching causes things to slow down
dramatically (despite the number of agents being small):

(What I am trying to do is create a 'realistic' simulation that will
predict actual monetary and CO2 emissions through computer usage within
an organisation. this is toy code so  i can make events happen (not
currently triggering any events) according to the time of day, week,
year, and run the simulation over a specific time (hard coded here).

The .nlogo file is here:
http://modelling4all.wikidot.com/local--files/temp-howard/calculating-time4June2\
008a.nlogo

Thanks, howard

globals [
is-working-day?
hour-in-day
hour-in-week
current-day
week
year
total-recycled
]

turtles-own [ age ]

to setup
ca
crt 2
ask turtles [
fd random 10
set age random 8
set color blue
]
set hour-in-week 0
set is-working-day? "true"
set total-recycled 0
set hour-in-day 0
set current-day "monday"
set week 0
set year 0
end

to go
calculate-is-working-day?
increment-time
ask turtles [
   get-older
   purchase
   recycle
]
tick
if ticks >= (24 * 365 * 10) [
stop
]
end

to increment-time
set hour-in-week (hour-in-week + 1)
work-out-hour-in-day
work-out-day
end

to work-out-hour-in-day
set hour-in-day (hour-in-day + 1)
if hour-in-day = 24 [
set hour-in-day 0
]
end

to work-out-day
if hour-in-week <= 24 [
set current-day "monday"
]
if hour-in-week > 24 and hour-in-week < 2 * 24 [
set current-day "tuesday"
]
if hour-in-week > 2 * 24 and hour-in-week < 3 * 24 [
set current-day "wednesday"
]
if hour-in-week > 3 * 24 and hour-in-week < 4 * 24 [
set current-day "thursday"
]
if hour-in-week > 4 * 24 and hour-in-week < 5 * 24 [
set current-day "friday"
]
if hour-in-week > 5 * 24 and hour-in-week < 6 * 24 [
set current-day "saturday"
]
if hour-in-week > 6 * 24 and hour-in-week < 7 * 24 [
set current-day "sunday"
]
end

to calculate-is-working-day?
ifelse hour-in-week <= (5 * 24) [
set is-working-day? "true"
]
[
set is-working-day? "false"
]
if hour-in-week >= (7 * 24)  [
update-weeks
set hour-in-week 0
]
end

to update-weeks
set week week + 1 ;; count the number of weeks that have passed
if week = 52 [
update-years
set week 0
]
end

to update-years
set year year + 1
end

to get-older
set age age + 1 ;; this is by 1 hour
end

to purchase
if age > 24 * 365 * 2 [ ;; purchase after 2 years
hatch 1 [
set age 0
set color red
fd 3
]
]
end

to recycle
if age > 24 * 365 * 3 [ ; make computer die if older than 3 years
set total-recycled total-recycled + 1
die
]
end

#7834 From: "Daniel Tanis" <daniel.tanis@...>
Date: Wed Jun 4, 2008 3:30 pm
Subject: Order
daniel.tanis
Send Email Send Email
 
Hello,
I need some help to establish the order in which my simulation procedures are been made.
I have a GO command that asks turtles to do a sequence of procedures and than a sequence of Report commands that calculate the sum of all turtles values that have been calculated by the GO commands.
My problem is that I would like to use the first two reporters for my the last five procedures in GO command.
How do I do that and how do I know what is calculated first and second and third and so on ?
 
Regards
Daniel Tanis

#7835 From: "jelaly" <younesje@...>
Date: Wed Jun 4, 2008 9:13 pm
Subject: Trouble with pairing up players
jelaly
Send Email Send Email
 
I am trying to simulate a group of players playing the ultimatum
bargaining game, with a selection process in which players pair up,
with the more successful player reproducing and the less successful
player being eliminated. I am having trouble pairing up players in
NetLogo: it is simple to have a player select a random opponent, but
I want this opponent, as well as the acting player, to be removed
from the competition pool until the next turn.

The following is the code that I am currently using:

   ask turtles [

   set competed? 0
   set birth? 0

   let opponent one-of other turtles
   let opponent2 one-of other turtles with [competed? = 0]

   ifelse random 2  = 0 ;; "coin-flip"

   [if offer >= [bottom-line] of opponent [set money money + 100 -
offer]]

   [if bottom-line <= [offer] of opponent [set money money + [offer]
of opponent]]

   set money money - 25 - .25 * money

   if opponent2 != nobody
   [
   if money = [money] of opponent2
   [set competed? 1 set [competed?] of opponent2 1]
   if money > [money] of opponent2
   [set birth? 1 set competed? 1 set [kill?] of opponent2 1 set
[competed?] of opponent2 1]
   if money < [money] of opponent2
   [set kill? 1 set competed? 1 set [birth?] of opponent2 1 set
[competed?] of opponent2 1]
   ]

   ]

   ask turtles with [kill? = 1] [die]
   ask turtles with [birth? = 1] [hatch 1 [forward random 5 right
random 360 set money 0]]


With this code, players find a random opponent. If they have equal
money to the opponent, both survive. If one player has more money,
that player hatches and the other dies after all turtles have played.

I would expect this program to keep the population constant. However,
when I run it, the population decreases on the first turn, then is
maintained for the remainder of the game.

Any help on this would be greatly appreciated. I would be happy to
forward the entire file to someone if it would be helpful.

#7836 From: Esther Verreau <everreau@...>
Date: Wed Jun 4, 2008 9:35 pm
Subject: Re: Netlogo and real world Data
estherverreau
Send Email Send Email
 
Hi -

On Tue, 3 Jun 2008, getachew wrote:

> Hello Dear Netlogo Users
>
> I am new netlogo user and currently trying to model bargaining power
> of farmers and traders at farmgate transaction. I have got a
> difficulty of intering spesific variables to each type of agents? Is
> that the same if inspect each agent and fill the data manually? and
> then start defining each variables in the procedure tab? waiting your
> response and even an excellent idea.
>

I don't understand what you want to do.

are you asking if typing variables in the fields in the agent monitors is
the same as typing "set variable value" in the procedures or command
center?  If so the answer is yes.

You want to set turtle variables to specific values, do you have that data
in a file?  do you want read data from a file?  See the File I/O section
of the programming guide:

http://ccl.northwestern.edu/netlogo/docs/programming.html#fileio

If I've missed the point of your question please try rephrasing it.

thanks

esther

#7837 From: Esther Verreau <everreau@...>
Date: Wed Jun 4, 2008 9:44 pm
Subject: Re: Netlogo loop command
estherverreau
Send Email Send Email
 
Hi Michael -

On Tue, 3 Jun 2008, mxanthakis wrote:

> I would like to perform a loop in Netlogo model.
> I want to change a variable's value with step 1,2,3,4... every time
> and every time the first variable reach number 12 a second variable
> start from number 1, then when the first variable reach the value 24
> the second variable to be set to value 24 etc.
>
> How can I create such a loop in Netlogo?
>

I'm not sure I understand what you want. There is a WHILE operator in
NetLogo.  You can probably do what you are asking with that and some
local variables. However, if you explain to me more generally what you
want to do I might be able to be more helpful.  Usually there's a way in
NetLogo to avoid using direct loops like that.

good luck.

esther

#7838 From: "James Steiner" <gregortroll@...>
Date: Wed Jun 4, 2008 10:42 pm
Subject: Re: Order
askturtlezero
Send Email Send Email
 
The order that procedure and reporter definitions appear in the
procedure pane does not affect the order you can use them in GO or
other procedures.

In a procedure, commands execute in the order they appear, one after the other.

If it is important that ALL turtles complete ONE procedure before any
turtles begin the NEXT procedure, use seperate ask clauses:

ask turtles [ do-procedure-one ]
ask turtles [ do-procedure-two ]

If it is important that each turtle complete all the commands before
ANY other turtle starts running any commands, then put the commands
inside a single ASK:

ask turtles
[ do-procedure-one
   do-procedure-two
   do-procedure-three
]

I hope this helps.

On Wed, Jun 4, 2008 at 11:30 AM, Daniel Tanis <daniel.tanis@...> wrote:
> Hello,
> I need some help to establish the order in which my simulation procedures
> are been made.
> I have a GO command that asks turtles to do a sequence of procedures and
> than a sequence of Report commands that calculate the sum of all turtles
> values that have been calculated by the GO commands.
> My problem is that I would like to use the first two reporters for my the
> last five procedures in GO command.
> How do I do that and how do I know what is calculated first and second and
> third and so on ?
>
> Regards
> Daniel Tanis

#7839 From: Manuel M <mnl_moreira@...>
Date: Thu Jun 5, 2008 12:13 am
Subject: Re: retrieving who
mnl_moreira
Send Email Send Email
 
Thanks, Esther and Howard for your help!



--- El mar 3-jun-08, Esther Verreau <everreau@...> escribió:
De: Esther Verreau <everreau@...>
Asunto: Re: [netlogo-users] retrieving who
Para: netlogo-users@yahoogroups.com
Fecha: martes, 3 de junio de 2008, 10:55 am

>
> I am pretty new in netlogo's world, I wonder if you can help me with a simple question.
>
> How can I ask a turtle to inform me about his ID?
>
> I know how to use the who function to select a particular turtle but I do not know how to ask the turtle to give me ID.
>
> The dictionary says: "
> You can use the turtle reporter to retrieve a turtle with a given
> who number" but I cannot find out how to do it from the code
>

Hi Manuel -

You should probably take a look at the variables section of the
programming guide:

http://ccl.northwes tern.edu/ netlogo/docs/ programming. html#variables

turtles can access their own variables directly, for example.

ask turtles[ print who ]

will print the who numbers of all the turtles to the command center.

the observer can access turtle variables using OF, for example:

print [who] of turtle 0

will print '0' to the command center.

hope this helps.

esther


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar

#7840 From: getachew woldie <getishas@...>
Date: Thu Jun 5, 2008 9:09 am
Subject: Re: Netlogo and real world Data
getishas
Send Email Send Email
 

Thank you very much that is what i wanted to ask. I will try this and will ask you for any other.

Getachew

GETACHEW ABEBE WOLDIE
PhD Student
Justus Liebig University GIESSEN
Institute of Agricultural Policy and Market Research
Senckenberg Strasse-3, D-35390,
GIESSEN, GERMANY
Tel. +49 641 99 37027 (work),
+496414983060(home)
+4917662116540 (mobile)
E-mail: Getachew.A.Woldie@...


--- On Thu, 6/5/08, Esther Verreau <everreau@...> wrote:
From: Esther Verreau <everreau@...>
Subject: Re: [netlogo-users] Netlogo and real world Data
To: netlogo-users@yahoogroups.com
Date: Thursday, June 5, 2008, 12:35 AM

Hi -

On Tue, 3 Jun 2008, getachew wrote:

> Hello Dear Netlogo Users
>
> I am new netlogo user and currently trying to model bargaining power
> of farmers and traders at farmgate transaction. I have got a
> difficulty of intering spesific variables to each type of agents? Is
> that the same if inspect each agent and fill the data manually? and
> then start defining each variables in the procedure tab? waiting your
> response and even an excellent idea.
>

I don't understand what you want to do.

are you asking if typing variables in the fields in the agent monitors is
the same as typing "set variable value" in the procedures or command
center? If so the answer is yes.

You want to set turtle variables to specific values, do you have that data
in a file? do you want read data from a file? See the File I/O section
of the programming guide:

http://ccl.northwes tern.edu/ netlogo/docs/ programming. html#fileio

If I've missed the point of your question please try rephrasing it.

thanks

esther



#7841 From: "Daniel Tanis" <daniel.tanis@...>
Date: Thu Jun 5, 2008 2:46 pm
Subject: Re: Order
daniel.tanis
Send Email Send Email
 
Thank you, it is usefull.
And how does it work with the report procedures?
 I have:
 
ask turtles
[ do-procedure-one
do-procedure-two
do-procedure-three
]
 
and for procedure-two, turtles must use a specific report result. What I want is that the second turtle to do procedure-two use a Reporter that was calculated based on the result of the first turtle to do procedure-two.
Is it possible?
Or to I have to use globals?
 
Regards
Daniel Tanis
2008/6/4 James Steiner <gregortroll@...>:

The order that procedure and reporter definitions appear in the
procedure pane does not affect the order you can use them in GO or
other procedures.

In a procedure, commands execute in the order they appear, one after the other.

If it is important that ALL turtles complete ONE procedure before any
turtles begin the NEXT procedure, use seperate ask clauses:

ask turtles [ do-procedure-one ]
ask turtles [ do-procedure-two ]

If it is important that each turtle complete all the commands before
ANY other turtle starts running any commands, then put the commands
inside a single ASK:

ask turtles
[ do-procedure-one
do-procedure-two
do-procedure-three
]

I hope this helps.



On Wed, Jun 4, 2008 at 11:30 AM, Daniel Tanis <daniel.tanis@...> wrote:
> Hello,
> I need some help to establish the order in which my simulation procedures
> are been made.
> I have a GO command that asks turtles to do a sequence of procedures and
> than a sequence of Report commands that calculate the sum of all turtles
> values that have been calculated by the GO commands.
> My problem is that I would like to use the first two reporters for my the
> last five procedures in GO command.
> How do I do that and how do I know what is calculated first and second and
> third and so on ?
>
> Regards
> Daniel Tanis



#7842 From: saied salah <saied_sartawi@...>
Date: Thu Jun 5, 2008 9:34 pm
Subject: Hi everyone.
saied_sartawi
Send Email Send Email
 

Dear All,,

 

I need someone help me to do my simulation, and I will pay money for anyone who would like to help me, My idea easy and clear.

 

Regards

 

 

Saeed



#7843 From: Seth Tisue <seth@...>
Date: Thu Jun 5, 2008 10:34 pm
Subject: Re: Trouble with pairing up players
sethtisue
Send Email Send Email
 
>>>>> "jelaly" == jelaly  <younesje@...> writes:

  jelaly> I am trying to simulate a group of players playing the
  jelaly> ultimatum bargaining game, with a selection process in which
  jelaly> players pair up, with the more successful player reproducing
  jelaly> and the less successful player being eliminated. I am having
  jelaly> trouble pairing up players in NetLogo: it is simple to have a
  jelaly> player select a random opponent, but I want this opponent, as
  jelaly> well as the acting player, to be removed from the competition
  jelaly> pool until the next turn.

  jelaly> The following is the code that I am currently using:

  jelaly>   ask turtles [

  jelaly>   set competed? 0 set birth? 0

  jelaly>   let opponent one-of other turtles let opponent2 one-of other
  jelaly> turtles with [competed? = 0]

I'm not sure if this is the cause of your bug (or the only cause), but I
think you probably meant to use multiple ASK commands, like this:

   ask turtles [ set competed? 0 ]
   ask turtles [ let opponent ... ]

so that all of the turtles set their competed? variable to 0 before any
turtle chooses an opponent.

Also, while it will work fine to use 0 to mean false and 1 to mean true,
it's more idiomatic NetLogo to use the boolean true and false values
directly:

   ask turtles [ set competed? false ]

then instead of writing:

   ask turtles with [birth? = 1]

you can just write:

   ask turtles with [birth?]

--
Seth Tisue / http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/

#7844 From: Seth Tisue <seth@...>
Date: Thu Jun 5, 2008 10:42 pm
Subject: Re: optimisation
sethtisue
Send Email Send Email
 
>>>>> "Howard" == Howard Noble <howard.noble@...> writes:

  Howard> Can anyone suggest some coding approaches or general ideas as
  Howard> to how I can improve this code. It seems that hatching causes
  Howard> things to slow down dramatically (despite the number of agents
  Howard> being small):

If I run your model for even just a few seconds, I end up with several
thousand turtles.  I only see a few turtles in the view, but that's
because most of the turtles are stacked up on top of each other.
Perhaps that's your bug?  I'd suggest adding a monitor to the model that
shows "count turtles", so you can keep an eye on the agent count.

Also, try changing the view update mode from "continuous" to
"tick-based" and pushing the speed slider all the way over towards
"faster".  In the default position, the view gets updated once per tick.
You're going through a lot of ticks very quickly, so NetLogo is spending
a lot of its time updating the view.  Pushing the speed slider to the
right will decrease the frequency of view updates.  (We don't recommend
using the "continuous" setting for normal modeling purposes.  It's
usually only useful if you're just messing with code and don't want to
bother using the tick counter.)

--
Seth Tisue / http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/

#7845 From: Jim Lyons <teacherjim42@...>
Date: Thu Jun 5, 2008 11:01 pm
Subject: Re: linking
jimlyons37
Send Email Send Email
 
Howard,
If  you would like to see yet another example of using links, check out the simple model I uploaded to this group's file area, dynamic-linking.nlogo. It uses links to assign computers to users as they arrive. It illustrates techniques for doing things in NetLogo you may find useful. Enjoy!

Jim Lyons


On Jun 3, 2008, at 11:39 AM, Howard Noble wrote:

Thanks for all these code examples James. I'll admit for a newbie like me I struggled to understand how NL achieves what it does....


#7846 From: Seth Tisue <seth@...>
Date: Thu Jun 5, 2008 11:07 pm
Subject: Re: linking
sethtisue
Send Email Send Email
 
>>>>> "Howard" == Howard Noble <howard.noble@...> writes:

  Howard> line 13: then I
  Howard> don't understand how this line works, i don't understand how
  Howard> you can ask *free-computer* anything as its not an agent but a
  Howard> procedure variable.

free-computer is a variable which contains an agent.  so if you write:

   ask free-computer [ ... ]

you're asking the agent stored in the variable to do something.

  Howard> generally i see that *user-id *is being set
  Howard> to the who number of the agent that is calling it e.g. in this
  Howard> case user-id is being set to the who number of the computer
  Howard> that is running this procedure.

Not the who number.  The agent itself.  Who numbers aren't used in this
code at all.  (That's standard NetLogo style.  Usually you don't need to
use who numbers at all, unless you're doing something unusual.)

Hope this helps,

--
Seth Tisue / http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/

#7847 From: Seth Tisue <seth@...>
Date: Thu Jun 5, 2008 11:12 pm
Subject: Re: NetLogo as a plain, basic, classic, generic Logo?
sethtisue
Send Email Send Email
 
>>>>> "cplusplus" == cplusplus guru <cplusplus_guru@...> writes:

  cplusplus> Can NetLogo be used as a plain, basic, classic, generic
  cplusplus> Logo?  I want to start working with NetLogo with just a
  cplusplus> bare-bones screen, with one turtle and a command prompt.  I
  cplusplus> am not interested in NetLogo models just yet, but some
  cplusplus> NetLogo features, particularly the Java Sound interface.

If you only want one turtle you can create one using "crt 1" or "cro 1".
(The former will give you a turtle with a random color and heading; the
latter always results in a gray turtle facing north.)  Then you can
change the command center from "observer>" to "turtles>" (using the
popup menu, or just press the Tab key) and issue turtle commands.

http://ccl.northwestern.edu/netlogo/docs/faq.html#logodiffs has a
discussion of language differences between plain Logo and NetLogo.

--
Seth Tisue / http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/

Messages 7818 - 7847 of 16653   Oldest  |  < Older  |  Newer >  |  Newest Start Topic
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help