Search the web
Sign In
New User? Sign Up
netlogo-users · NetLogo Users
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 2582 - 2611 of 9892   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
2582
II would like to save in a line only a number and after that to go to the next line. Here is a sample of my code file-open "energy.txt" ask ants [set...
DCalitoiu
Offline Send Email
Feb 2, 2005
4:11 am
2583
Dragos, ... One way is to use file-print "" after each file-write, like this: file-open "energy.txt" ask ants [ set energy_total energy_total + energy ...
Jim Lyons
jimlyons37
Offline Send Email
Feb 2, 2005
4:30 pm
2584
II would like to save in a line only a number and after that to go to the next line. *-SNIP DO YOU KNOW WHAT CAN I TYPE HERE "file-write energy_total" in order...
Martin Rudbeck Jepsen
mrj@...
Send Email
Feb 2, 2005
4:31 pm
2585
Thank you Martin, Thank you Jim. It is working now. Dragos Jim Lyons <jimlyons@...> wrote: Dragos, ... One way is to use file-print "" after each...
Dragos Calitoiu
DCalitoiu
Offline Send Email
Feb 3, 2005
5:26 am
2586
The main difference between Martin and Jim's solutions is this: With file-write, a space is added after each entry, no new-line is added, and strings are...
James Steiner
jps_netlogo
Offline Send Email
Feb 3, 2005
5:28 am
2587
Hello, I`m new here and I have one question: Turtles have a unique ID "who". But Patches? Is there a way to provide patches with a unique ID like "who"? I...
whiteshoe2003
Offline Send Email
Feb 3, 2005
3:13 pm
2588
" Is there a way to provide patches with a unique ID like "who"?" Right yesterday I had to solve exactly this problem. See the attached modell file as one...
Thorsten Schmidt
THO_SCHMIDT@...
Send Email
Feb 3, 2005
8:51 pm
2589
Hello Thorsten, You could try: to pid ca ask patches[set plabel pxcor + 221 - (21 * pycor)] end Regards, Derek...
Derek Rush
derekrush@...
Send Email
Feb 4, 2005
3:12 am
2590
As a side note,a general form to assign ascending numbers (l to r, t to b) to patches is: set patch-id ( (pxcor + screen-edge-x) + (screen-size-x * ...
James Steiner
jps_netlogo
Offline Send Email
Feb 4, 2005
3:40 pm
2591
Here's another solution: Patches AND Turtles both have another important, and unique, identifier: The turtle, or patch, itself. You can store a reference to a...
James Steiner
jps_netlogo
Offline Send Email
Feb 4, 2005
3:40 pm
2592
... Hello Derek, it took me a while to understand, why this mini code snippet is working. Really an elegant way to do it! Thank you a lot, simplicity rocks, ...
Thorsten Schmidt
THO_SCHMIDT@...
Send Email
Feb 4, 2005
3:40 pm
2593
Dear Netlogoers, I am struggling for days now to link groups of patches to a turtle! I am modeling land use where farmers (i.e. 28 turtles) own individual...
Lilibeth Acosta-Michlik
acosta@...
Send Email
Feb 7, 2005
2:48 pm
2594
... You seem to be off to a good start by creating a patch variable like "owner." The trick is to also create a turtle variable that holds the same value,...
John S. Erickson
olyerickson
Offline Send Email
Feb 8, 2005
1:49 pm
2595
Dear Dr. Lilibeth Acosta-Michlik, I would think that the first thing you have to do is to assign the patches to the turtles. Do you have an idea about how the...
Martin Rudbeck Jepsen
mrj@...
Send Email
Feb 8, 2005
1:50 pm
2596
... The two simplest ways to do this are to either assign the farmer turtle itself to the ownership variable of the patch, or to assign the agentset of patches...
James Steiner
jps_netlogo
Offline Send Email
Feb 8, 2005
7:52 pm
2597
John S. Erickson <john.erickson@...> ... Yes. A simimlar approach, when creating a many-to-many relationships, such as groups of farmers jointly owning...
James Steiner
jps_netlogo
Offline Send Email
Feb 10, 2005
12:27 am
2598
Is it possible to run i.e. two dimension cellular automata such as each agent/patch/square change is state simultaneously with the others ( actually this is...
telesoftcomm
Offline Send Email
Feb 11, 2005
2:53 pm
2599
hey there! i was just wondering if anyone could help me write a procedure to-report factorial [n] which calculates the value of n! in netlogo please help me...
chabo1130
Offline Send Email
Feb 12, 2005
3:57 am
2600
... It sure is. For this sort of "simultaneous" your cells need to store their states in two places, for example, "current-state" and "new-state" The cells...
James Steiner
jps_netlogo
Offline Send Email
Feb 12, 2005
3:58 am
2601
to-report factorial [n] let c 1 let f 1 repeat n [ set f f * c set c c + 1 ] report f end ciao, bg chabo1130 <chabo1130@...> wrote: hey there! i was just...
roberto cesari
bovinograsso
Offline Send Email
Feb 12, 2005
10:36 pm
2602
here's another version: to-report factorial [ n ] report ifelse-value ( n = 0 ) [ 1 ] [ n * factorial ( n - 1 ) ] end be careful of hitting netlogo's largest...
Josh Unterman
jwunterman
Offline Send Email
Feb 13, 2005
8:49 am
2603
Here's another version! to-report factorial [ n ] report ifelse-value n = 0 [ 1 ] [ reduce [ ?1 * ?2 ] (n-values n [ 1.0 + ? ] ) ] end ;; if n is 0, report...
James Steiner
jps_netlogo
Offline Send Email
Feb 14, 2005
8:05 pm
2604
... Of course. There are many examples of cellular automata included in the NetLogo models library. Look in Sample Models -> Computer Science -> Cellular...
Andrei
ascheink
Offline Send Email
Feb 14, 2005
8:09 pm
2605
A shorter solution uses recursion: to-report factorial [n] if n = 1 [ report 1 ] report n * factorial (n - 1) end -- Andrei Scheinkman, NetLogo Developer ...
Andrei
ascheink
Offline Send Email
Feb 14, 2005
8:09 pm
2606
... Shorter, eh? Let's late a look at the solutions provided so far! Notes: Andrei's solution as posted tested on (n=1) which prevented it from correctly...
James Steiner
jps_netlogo
Offline Send Email
Feb 16, 2005
12:28 am
2607
... Oops. I also changed the if to if else, eliminating the *implied* else. Did that almost automatically. Sorry. As written, Andrei's code would have been...
James Steiner
jps_netlogo
Offline Send Email
Feb 16, 2005
12:29 am
2608
/Andrei's recursive approach:/ to-report factorial [ n ] ifelse n = 0 [ report 1 ] [ report n * factorial ( n - 1 ) ] end /Roberto's (optimized) iterative...
john s. erickson
olyerickson
Offline Send Email
Feb 16, 2005
3:38 pm
2609
Hello, I am iterating turtles randomly by foreach shuffle values-from turtles [self] [ ask ? [ ... ] ] but they kill each other (some turtles are dead by their...
phidippus
Offline Send Email
Feb 16, 2005
3:40 pm
2610
... phidippus> How do I skip dead turtles? see http://ccl.northwestern.edu/netlogo/docs/faq.html#dead -- Seth Tisue / seth@... / (847) 467-2814 lead...
Seth Tisue
sethtisue
Offline Send Email
Feb 16, 2005
6:18 pm
2611
Well, you could do this: foreach turtle-list [ if ? != nobody [ ask ? [ ... ] ] ] But I have developed a way to create a randomly ordered normal agentset. A...
James Steiner
jps_netlogo
Offline Send Email
Feb 16, 2005
11:48 pm
Messages 2582 - 2611 of 9892   Oldest  |  < Older  |  Newer >  |  Newest
Advanced
Add to My Yahoo!      XML What's This?

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