--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/1fb09abb-90b3-47fc-b80f-c4c85f979162%40googlegroups.com.
Complementary file to the below post.I added parts of the code file in this question. Period1 and Period2 represent different time periods in the model.Hopefully, anyone can help me with this struggling problem.Mang thanks in advance!Best,Dengxiao
--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/9370a84c-cf68-4e8b-b1ec-e1e394df349d%40googlegroups.com.
Hi Dengxiao,
Thanks for writing.
From what I understand the difference between period 1 and period 2 is just the maximum number of turtles allowed.
Without your code it is difficult to tell what is going on. I have attached a model that attempts to capture what you are saying.
One thing I noticed was that the model runs so much faster when the max number of turtles is random. This is because the turtles are dying at a rapid rate.
Until I vastly increased the number of turtles, I couldn’t see them move in the second condition.
Here are a few notes on my program:
When a patch has its turtles die, it turns yellow.
I use the procedures expt1 and expt2 to set up the two different initial conditions
I used random-seed to insure that the same random choices were made in for periods 1 and 2
https://ccl.northwestern.edu/netlogo/docs/dictionary.html#random-seed
I used wait so the result of the first period could be seen for a few seconds before switching conditions,
https://ccl.northwestern.edu/netlogo/docs/dictionary.html#wait
And also during period 2 to slow down the turtles so they could be seen.
Another thing you could do is to create a plot of the number of turtles over time, then you could see the rate at which they change.
https://ccl.northwestern.edu/netlogo/docs/programming.html#plotting
I used show to print the number of yellow patches.
https://ccl.northwestern.edu/netlogo/docs/dictionary.html#show
If this doesn’t help, perhaps you can share your model or code with netlogo-users in order to get more specific help.
Aaron
--
Aaron Brandes, Software Developer
Center for Connected Learning and Computer-Based Modeling
--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
netlogo-user...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/netlogo-users/1fb09abb-90b3-47fc-b80f-c4c85f979162%40googlegroups.com.
Hi Dengxiao,
Your file code.nlogo does not show the initialization step in which you create the different breeds of turtles, and set the patch files.
That is why Pradeesh found that nothing happened.
Also if the second period is starting with different initial conditions you should expect some differences in behavior or results.
In addition there is randomness in your model, because “ask n-of” will make different choices during the first and second period, unless you use the NetLogo
random-seed primitive, as I suggested earlier.
Aaron
--
Aaron Brandes, Software Developer
Center for Connected Learning and Computer-Based Modeling
To view this discussion on the web visit
https://groups.google.com/d/msgid/netlogo-users/CANOZKcj7u815i_QUFRALX8W5cEPgUWsC8GqUi0Ut_B4rBUzMYg%40mail.gmail.com.
Hi All,
For anyone who had trouble with the .rar file Dengxiao sent previously (a Windows archive) I am posting the two files it contains, as well as the text from the original post
I am sorry I forget to add the “drawing patches” in the code. This version of the code can show the initialization step.
I guess I need to reinitialize the patches. In my case, I should reset the CurrentStorage of the patches. I run the model, the [CurrentStorage] of the patches are the maximum storage in the FirstProcedure, even I let all the turtles die on the patches. I also added a procedure between these two time periods which is
“`if day = 30 [ask patches with [color = 64.2] [set CurrentStorage 0]]” to reset the patch variable. However, it doesn’t work, it showed the [CurrentStorage] of the patches still the maximum storage in FirstProcedue, not to zero. From day 31, I set the patches have the new maximum storage and the turtles move to the patches, however, nothing happened during this period (the tick counter runs but the turtles don't move to the patches) and the [CurrentStorage] of each patch is still the maximum storage in FirstProcedure.
I guess if I reset the [CurrentStorage] of the patches correctly, the model will work as what I expected. The way I reset the patches’ variable seems doesn’t work. Do you have any ideas?
Cheers,
Dengxiao
发送自 Windows 10 版邮件应用
Hi Dengxiao,
I really like the graphics of your model.
When I ran it there was action happening after day 30.
The model runs slowly. If you move the ticks slider all the way to the right it will run faster.
If you want to compare the first and second period and have it run faster you might want to do something to reduce the number of agents produced.
It’s possible your model would run better with more memory
Closing other applications might also be helpful.
Also, just in case you are running with an unplugged laptop:
You can gather information by using any or all of the following lines in the command center. (Or you could put them all into a procedure and call that.)
print max [ CurrentStorage ] of patches
print SecondStorage
print count RiverVolumes
print count WaterVolumes
print count Crops
plotting some of these variables might also be useful
RiverVolumes were up to 241810 by day 40.
The model is barely moving on day 42 at time 2
RiverVolumes 290810
On the other hand Crops are at 9816 and have barely changed.
I suggest you experiment more with the model using plots and print statements to learn whether it is doing what you want/expect.
Aaron
--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
netlogo-user...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/netlogo-users/B60CD144-6712-4EC9-AC5A-89298171CAA6%40ads.northwestern.edu.
--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/b4a8805b-0b58-4d78-85f4-11f35acc27ef%40googlegroups.com.