Mushroom Hunt

466 views
Skip to first unread message

Alan Isaac

unread,
May 19, 2014, 1:03:52 PM5/19/14
to au-ec...@googlegroups.com
Use this thread to post questions and discussion about the Mushroom Hunt model.

Kevin Carrig

unread,
May 19, 2014, 11:06:29 PM5/19/14
to au-ec...@googlegroups.com
In the Mushroom-Hunt model, we initialize some clusters of red patches (representing mushrooms) before creating the World and the hunters. The code for this process makes use of the in-radius functionality. Some additional research of clustering methods in NetLogo pointed me towards the K-Means algorithm extension(https://github.com/NetLogo/K-Means-Extension). Could you discuss a particular instance or situation where it would make sense to cluster the mushrooms with this algorithm rather than the base function in NetLogo? My understanding is that K-Means is also randomized and I was curious if there are any gains (or losses) in choosing one clustering method over the other? 

Alan Isaac

unread,
May 20, 2014, 1:28:01 PM5/20/14
to au-ec...@googlegroups.com
K-Means Clustering

I may misunderstand your question, but I think of k-means clustering as applied ex post to known spatial data, not ex ante for generating such data.  I suppose one could create a mushroom distribution, then have the observer partition it ex post into clusters, and then make predictions are about the "stickiness" of cluster choice during harvesting.

Adaora Isichei

unread,
May 24, 2014, 5:19:12 PM5/24/14
to au-ec...@googlegroups.com
The basic idea of this model was to create a model were a hunter in the forest hunting for mushrooms. I was able to create a setup button and a go button. I created the red clusters, this represented the mushrooms. I was able to change the background of the screen to a green background. During this exercise I changed the size and color of the hunter, I was also able to adjust the radius of the groups of mushrooms. I also successfully altered the number of hunters and mushroom groups.

Natalie Chambers

unread,
May 24, 2014, 9:29:18 PM5/24/14
to au-ec...@googlegroups.com

When creating the code for the mushroom hunt I was interested in the role of the patch coordinates and specificity at which you can tell a turtle to go on a patch. The forward command, which allows the turtle to move in “steps” rather to coordinates (The turtle moves forward by number steps, one step at a time; If number is negative, the turtle moves backward) is actually very useful when modeling situations in economics and we will hopefully be able to use in our model.

Also when reading about the topology of the Netlogo interface I was thinking a lot about situations in economics where the world need to be a box versus a torus or cylinder. In the models we have been practicing with it seems logical why the models are torus or boxed. For instance in Kevin’s counterterrorism project proposal would the agents need to have a limited world or could the turtle wrap around? Understanding the action of the turtles in this scenario seems a bit more complicated to understand.

Amanda Saville

unread,
May 25, 2014, 3:19:11 PM5/25/14
to au-ec...@googlegroups.com
I'm not sure if anyone else is having trouble with this or not, but I thought I would ask!

While I implemented the Mushroom Hunt as outlined in Chapter 2 without issues (largely because the book walks you through every step), I'm having some difficulty with the alterations.  I rejoiced loudly when I was able to get my mushroom patches to grow back, but I am now having trouble with the metabolism and energy part of it (after I post this I will revisit talking-to turtles in case there is something I overlooked/forgot).  

What I attempted in my code was to put an "ifelse" statement for when time-since-last-found >= 1
If true, energy would equal energy minus metabolism (with metabolism already set at 0.001) AND energy must be greater than min-energy.  If false, energy would equal energy + 1.
When I click the check box to check for errors or syntax, no errors come up.  It is not until I attempt to run the model that I get an error message that redirects me back to my code stating: "expected input to be a number but got the TRUE/FALSE true instead."

I'm not sure if I went about this the wrong way or if others have run into similar difficulties and were able to overcome them--I should probably mention I have this bit of code written in my "to search" procedure.

Similarly, I wasn't entirely sure how to constrain the hunters' speed to 1, so I just inserted "set max-speed 1" also in my "to search" procedure... I didn't discover a way to tell with the model running if this in fact did anything at all.  How can we tell the speed of the turtles?  Don't the turtles always move at speed 1 (one movement per tick?)


Amanda Saville

unread,
May 25, 2014, 3:22:39 PM5/25/14
to au-ec...@googlegroups.com
I also forgot to mention that my metabolism part wasn't giving me issues until I attempted to constrain energy using min-energy.  Prior to that, my model ran with declining energy at a rate of 0.001 for every time-since-last-found >=1.

Matthew Reardon

unread,
May 27, 2014, 11:55:15 AM5/27/14
to au-ec...@googlegroups.com
Amanda, 

I'm not sure of the default speed, but turtle (hunter) speed can be set using the forward (fd) command.  Since we arent supposed to post code yet, if you go back and look at the traffic example from the models library, there is a good example of constraining speed to a min/max range.


Additionally, what I've noticed is that the Check option under the code tab is not really helpful for determining if your code actually works, just if the command is complete.  I get error messages for things like "expected input to be a number..." or "Scale-color expected 4 inputs, a number, a number, a number, a number."  Whether or not the code actually does my intended purpose is pretty much decided when I run it and observe the outcome.


On Monday, May 19, 2014 1:03:52 PM UTC-4, Alan Isaac wrote:

Alan Isaac

unread,
May 27, 2014, 6:55:52 PM5/27/14
to au-ec...@googlegroups.com
Speed

There are two main ways of changing speed, depending on whether on not you want you turtles to explicitly touch intermediate patches.  If not, you can just fd 5 instead of fd 1, each step.  If you want to touch intervening patches then you can use repeat to go forward the same fixed distance more times.  An example of the latter approach can be found in the Zombie Apocalypse model: http://www.personal.kent.edu/~mdball/zombies1_4.htm

Adin Dobkin

unread,
May 27, 2014, 10:06:26 PM5/27/14
to au-ec...@googlegroups.com
I too had a couple issues implementing this system.

As Matthew noted, the check procedure seems to simply ensure that your syntax is in proper form, but doesn't check the logic behind it (a number of other programming languages do the same).  

My main problem is that the program is technically running, but not as it should.  I think a rejiggering of the 'ifelse' statement is probably what's needed.

Amanda Saville

unread,
May 28, 2014, 12:48:49 AM5/28/14
to au-ec...@googlegroups.com
Matthew and Dr. Isaac,

Thank you for helping to clear up the speed question, and looking at the code from the traffic model was really helpful!  I finally got my mushroom hunt to run in such a way that I think (hope) is correct.

And I cleaned up some of my code that wasn't doing anything at all except taking up space with the correct syntax.  The Check button is definitely useful, but I will be more careful to observe the outcomes rather than trust that my code is functioning solely on Check. 

Amanda Saville

unread,
May 28, 2014, 12:51:09 AM5/28/14
to au-ec...@googlegroups.com
Adin,

Have you been able to adjust your code to get the program to run properly?  If not, are there any parts you'd like to discuss?

Natalie Chambers

unread,
May 28, 2014, 1:17:36 AM5/28/14
to au-ec...@googlegroups.com
When we are submitting our code should we attach the file so you can see our slider and plot or just copy and paste the code in?

Sebastien Lundby-Thomas

unread,
May 28, 2014, 3:06:37 AM5/28/14
to au-ec...@googlegroups.com
I am still having difficulty getting the regrowth function to be properly assigned to the patches under my initial set up. I have moved beyond this step and believe the parts of my go coding are about right, but until I fix the setup I cannot use the check tool to make sure the latter parts of my code are correct.

Adin Dobkin

unread,
May 28, 2014, 6:19:02 AM5/28/14
to au-ec...@googlegroups.com
Amanda,

Thanks for checking in - I didn't notice it until just now.  Mine isn't working quite as well as I would have liked, but as I'm heading to work now, I'll drop it here and continue to play with it for the rest of the day.
Mushroom Hunt.nlogo

Natalie Chambers

unread,
May 28, 2014, 7:28:56 AM5/28/14
to au-ec...@googlegroups.com
;; the following variables are defined here for use throughout the rest of the code 
globals
 [
   num-clusters
   growback-time
   max-energy
   min-energy
   max-speed
 ]
 
 patches-own
[
  harvest-time
]

 turtles-own
 [
   time-since-last-found
   energy
   metabolism
 ]
 
;;  Alteration 2: introduces a simple setup for the following procedures 
to setup
  
  ca
setup-globals
setup-patches
setup-turtles
reset-ticks
 
end  

;; this procedure is the main procedure for the mushroom hunt
to go 
  if ticks >= 500 [ stop ];; this stops the simulation after 500 ticks have occured
   ask turtles [search]
   ask patches
  [ if pcolor = yellow 
    [ if ticks - harvest-time >= growback-time ;; Alteration 6: this command turns patches (mushrooms) red to indicate the mushroom has grown back
    [set pcolor red ] 
    ]
  ]
  if ticks mod 100 = 0 ;; Alteration 10: This command clears the trails of the hunters every 100 ticks
  [clear-drawing] 
  tick
end 

;; Alteration 3: this procedure assigns values the global variables (defined above) and the values they will take on
to setup-globals
  set num-clusters 4
  set growback-time 100
  set max-energy 10
  set min-energy .4
  set max-speed 1
end

;; this procedure creates random patches on the board that are classified as mushrooms in this model
to setup-patches
  ask n-of num-clusters patches
 [
   ask n-of 20 patches in-radius 5
    [
      set pcolor red
    ]
 ] 
end 

;;this procedure creates the turtles (hunters) and assigns attributes to the turtles
to setup-turtles
  crt n-hunters ;; Alteration 5: this creates n number of hunters which can be adjusted by the slider in the model
 [
   set size 2
   set color yellow
   set time-since-last-found 999
   set energy 1
   set metabolism .001
   pen-down
 ]
end

;;this procedure outlines the way that the turtles (hunters) will search for the red patches (mushrooms) in the program 
to search 
   ifelse time-since-last-found <= 20 ;;this section tells the turtles if they have found the patch in less than 20 ticks the hunter will rotate randomly 
   [right (random 181) - 90]
   [right (random 21) - 10]
   
   fd max-speed ;; Alteration 7: this sets the speed of the hunter the maximum speed
   
  ifelse pcolor = red ;; set the patch has not been harvested 
  [
    set time-since-last-found 0
    set pcolor yellow ;; set the patch has been harvested
    set harvest-time ticks
    if energy + 1 <= max-energy ;;Alteration 9: the hunters will gain one additional unit of energy up until the maximum energy values
    [ set energy energy + 1 ]
  ]
  
  [
    set time-since-last-found time-since-last-found + 1
  ]
  if energy >= min-energy ;; Alteration 8: Shows how the hunters energy is effected by its metabolism, but is constrain by the set minimum energy
  [set energy energy - metabolism ]
  set color scale-color yellow energy .4 1 ;; As the energy for the hunter decreases the color of the hunter changes from dark to light
   
end

MushroomHunt2.nlogo

Amanda Saville

unread,
May 28, 2014, 8:29:14 AM5/28/14
to au-ec...@googlegroups.com
globals
[
  num-clusters ;; the number of mushroom patches
  growback-time ;; the amount of time (in ticks) it takes for mushrooms to grow back after being picked
  max-energy ;; the maximum amount of energy of each hunter
  min-energy ;; the minimum amount of energy of each hunter
  max-speed  ;; the maximum speed at which a hunter can search
]

patches-own
[
  harvest-time ;; marks the time (in ticks) since a mushroom has last been picked
]


turtles-own
[
  time-since-last-found ;; the time (in ticks) since a turtle has last found a mushroom
  energy ;; a turtle's energy level
  metabolism ;; the rate at which a turtle's energy level decreases
]

to startup
  setup
end

to setup ;; initializes mushroom hunt
  ca
  setup-globals
  setup-patches
  setup-turtles
  reset-ticks
end

to setup-globals
  set num-clusters 4 ;; sets the number of mushroom clusters in world
  set growback-time 100 ;; the number of ticks since a mushroom has been picked before it grows back
  set max-energy 10 ;; the maximum amount of energy for each turtle
  set min-energy 0.4 ;; the minimum amount of energy for each turtle
  set max-speed 1 ;; the maximum speed at which a turtle can search for mushrooms
end

to setup-patches
  ask n-of num-clusters patches
  [
    ask n-of 20 patches in-radius 5
    [
      set pcolor red ;; asks 20 patches within a radius of 5 of randomly chosen patches to set color to red (to symbolize mushrooms)
    ]
  ]
end

to setup-turtles
  crt n-hunters ;; creates the number of turtles as determined by the slider
  [
    set size 2
    set color yellow
    set time-since-last-found 999 
    pen-down ;; tracks the paths of the turtles during their searches
    set energy 1 
    set metabolism 0.001
    
  ]
end
  
to go
  tick
  ask patches 
  [ 
    if pcolor = yellow
    [
      if ticks > growback-time
      [
        if harvest-time < ticks - growback-time ;; prompts mushrooms to grow back after 100 ticks have passed since harvest-time
        [set pcolor red]
      ]
    ]
  ]
  if ticks mod 100 = 0
  [
    cd ;; clears paths of turtles every 100 ticks
  ] 
  ask turtles [search]
  update-plots
end

to search
  ifelse time-since-last-found <= 20
  [
    right (random 181) - 90
  ]
  [
    right (random 21) - 10
  ]
  forward max-speed
  ifelse pcolor = red
  [
    set time-since-last-found 0 ;; sets turtle's time-since-last-found to zero
    set harvest-time ticks ;; sets harvest-time to the tick-value at the time the mushroom was "picked"
    set pcolor yellow ;; turns a patch yellow after a mushroom has been harvested
    
  ]
  [
    set time-since-last-found time-since-last-found + 1
  ]
  ifelse time-since-last-found >= 1
  [
    set energy energy - metabolism ;; for all ticks in which a turtle has not found a mushroom, energy will decrease by its metabolic rate
    if energy < min-energy
    [
      set energy min-energy ;; constrains a turtle's energy to min-energy
    ]
  ]
  [set energy energy + 1 ;; adds energy to a turtle for picking a mushroom (time-since-last-found = 0)
    if energy > max-energy
    [set energy max-energy ;; constrains a turtle's energy to max-energy
    ]
  ]
  set color scale-color yellow energy min-energy max-energy ;; scales a turtle's color to match its energy level
end
MushroomHunt.nlogo

Adaora Isichei

unread,
May 28, 2014, 8:36:49 AM5/28/14
to au-ec...@googlegroups.com

This is what I have thus-far. I have been trying to figure out no.9 on words. I will keep working on it and post an updated file soon

 globals
 [
   num-clusters
   growback-time
   max-energy
   min-energy
   max-speed
 ]
 turtles-own
 [time-since-last-found
   energy
 ]

to setup
  clear-all

  setup-globals
  setup-patches
  setup-turtles
  reset-ticks
end

to setup-globals
 
 set growback-time 100
  set max-energy 10
  set min-energy 0.4
  set max-speed 1
 
end
  to setup-patches
    [ harvest-time
       set energy 1
       set metabolism 0.001 ]
   
    ask patches [if pcolor = yellow
      [if ticks - harvest time >= growback-time
        [set pcolor red]
      ]
  end
 
  
 
  to setup-turtles
    create-turtles n-hunter
  end
 
   
   
 to Go
   tick
ask turtles [
  [ search ] ; this code enables our hunters to search
set color scale-color red]
fd max-speed

end
 
to search

ifelse time-since-last-found <= 20
[right (random 181) - 90]
[right (random 21) - 10]
 forward 1


ifelse pcolor = red
[ set time-since-last-found 0
  set pcolor yellow ]

[
  set time-since-last-found time-since-last-found + 1
]
 end
patches-own [
  grow-back]


On Monday, May 19, 2014 1:03:52 PM UTC-4, Alan Isaac wrote:
MushroomHunt.nlogo

Alan G Isaac

unread,
May 28, 2014, 8:50:54 AM5/28/14
to AU-ECON-ABS on behalf of Natalie Chambers
**Posting Code for Discussion**

In this case, both please. But when you submit your Gambler's Ruin assignment,
just attach the .nlogo file in Blackboard.

Thanks,
Alan Isaac

Mia Raths

unread,
May 28, 2014, 8:57:05 AM5/28/14
to au-ec...@googlegroups.com


On Monday, May 19, 2014 1:03:52 PM UTC-4, Alan Isaac wrote:
Mushrooms.nlogo
Message has been deleted

Matthew Reardon

unread,
May 28, 2014, 9:10:54 AM5/28/14
to au-ec...@googlegroups.com
globals [ num-clusters growback-time max-energy min-energy max-speed]
turtles-own [ time-since-last-found energy metabolism]
patches-own [ harvest-time ]






to setup ;; question 2
  ca
  setup-globals
  setup-patches
  setup-turtles
  reset-ticks
end


to setup-globals
  set growback-time 100
  set max-energy 10
  set min-energy 0.4
  set max-speed 1
  set num-clusters 4
end

to setup-patches
  ask n-of num-clusters patches
  [ 
    ask n-of 20 patches in-radius 5
    [
      set pcolor red
      ]
  ]
end

to setup-turtles
  crt n-hunters [ 
  set energy 1
  set metabolism 0.001
  set color yellow
  set time-since-last-found 999
  pd
  ]
end





to go
  tick
  ask turtles [search]
  ask turtles [
    if (ticks >= harvest-time + growback-time) [ set pcolor red ]]
  
  if (ticks mod 100 = 0)
   [ 
    cd
    ]
  
end

to search
  ifelse time-since-last-found <= 20
  [right (random 181) - 90]
  [right (random 21) - 10]
  
  forward max (list energy max-speed)
  set energy  max (list min-energy (energy - metabolism))
  
  
  set color scale-color yellow energy 0 max-energy
  ifelse (pcolor = red)
  [
    set energy min (list max-energy (energy + 1))
    set harvest-time ticks
    set time-since-last-found 0
    set pcolor yellow
  ]
  [
    set time-since-last-found time-since-last-found + 1
  ]
  
  
  
end

On Monday, May 19, 2014 1:03:52 PM UTC-4, Alan Isaac wrote:
MushroomHunt.nlogo

Alan Isaac

unread,
May 28, 2014, 9:13:18 AM5/28/14
to au-ec...@googlegroups.com
Completed Assignment: Mushroom Hunt

By preparing the Mushroom Hunt, you have taken a big "readiness" step for your NetLogo programming!  Between the Mushroom Hunt and the Coin Flipping Exercises, you have accumulated the tools you need to prepare the Gambler's Ruin assignment for Monday.  You now also have a better sense of how time-consuming it is to program when your first starting, so you probably can see the reasonableness of estimating the the Gambler's Ruin assignment may take 20 hours to complete.  Allocating enough time if you hope to finish on time is a big "lesson learned" for some of you, and I need to remind you that the Gambler's Ruin submission cannot be accepted late.(Submit the Gambler's Ruin assignment on Blackboard, not on this list.)

After you get a chance to look at your classmates' Mushroom Hunt code, I would love for this thread to now include some "lessons learned" discussion.

One "lesson learned" I think I see in the submissions concerns verification.  From my posted lecture on this topic, you know that there a different types of errors that can end up in your code.  The NetLogo code checker is a big help: it looks for a variety of syntax errors and provides a helpful analysis when it finds one. (If you do not find the analysis helpful, post it to the *NetLogo Programming* thread to get help with it.)  But like other interpreted languages, NetLogo cannot find all syntax errors just be looking through your code.  To find some errors, you need to run your code and produce a "runtime error".  You can limit errors that can be caught by the syntax checker pretty easily (just recheck your code every time you add a line or two), but debugging runtime errors can be frustrating and time consuming (especially as your programs get longer and more complex).

Alan Isaac

unread,
May 28, 2014, 9:38:50 AM5/28/14
to au-ec...@googlegroups.com
Step 9 says: "Each time a mushroom is harvested, set the patch’s harvest-time to the ticks value. Also, add 1 to the hunter’s energy, but then constrain energy not to exceed max-energy."  A mushroom is "harvested" whenever one is found (i.e., whenever a hunter lands on a red patch).  One thing that happens then is that the patch turns yellow.  You need to make two more things happen: reset the patch's harvest-time attribute, and add 1 to the hunter's energy (but then use min to make sure energy does not get too big).  Note that you get the ticks value by using ticks.  (E.g., try entering print ticks after your setup.)

Note that this question falls into the "time constraint" lesson learned that I mentioned.  You want to ask questions like this substantially before an assignment is due, and you cannot know ahead of time what problems you will run into.  Therefore you need to make sure that you are essentially done with an assignment days before it is due, to allow time for unanticipated problems.

Cheers,
Alan Isaac



On Wednesday, May 28, 2014 8:36:49 AM UTC-4, Adaora Isichei wrote:

This is what I have thus-far. I have been trying to figure out no.9 on words..

Adaora Isichei

unread,
May 28, 2014, 9:59:22 AM5/28/14
to au-ec...@googlegroups.com

I made some alterations to my codes and I seems to be working great.  I would appreciate your input, please let me know if I missed a step.
 [

   num-clusters
   growback-time
   max-energy
   min-energy
   max-speed
 ]
 
 patches-own
 
 
 [ harvest-time
   grow-back
   ]
 
 turtles-own
 [time-since-last-found
   energy
   metabolism
 ]

to setup
  clear-all

  setup-globals
  setup-patches
  setup-turtles
  reset-ticks
end

to setup-globals
  set num-clusters 4

 set growback-time 100
  set max-energy 10
  set min-energy 0.4
  set max-speed 1
 
end
  to setup-patches
     ask n-of num-clusters patches
  [
    ask n-of 20 patches in-radius 5
    [
      set pcolor red
    ]
  ]
  end
 
  
  to setup-turtles
    create-turtles n-hunter
    [set color yellow

       set energy 1
       set metabolism 0.001
    ]
  end
   
   
 to Go
   tick

    ask patches
  [
    if pcolor = yellow
    [
      if ticks > growback-time
      [
        if harvest-time < ticks - growback-time
        [set pcolor red]
      ]
    ]
  ]

ask turtles [ search ] ; this code enables our hunters to search


end
 
to search

ifelse time-since-last-found <= 20
[right (random 181) - 90]
[right (random 21) - 10]
 forward 1

ifelse pcolor = red
[ set time-since-last-found 0

  set pcolor yellow ]
[
  set time-since-last-found time-since-last-found + 1
]

 end

On Monday, May 19, 2014 1:03:52 PM UTC-4, Alan Isaac wrote:

Kevin Carrig

unread,
May 28, 2014, 10:37:11 AM5/28/14
to au-ec...@googlegroups.com
Anyone have any luck with modification 9, "adding a plot of the average energy of your hunters"? I highlighted the section below where the plot is initialized, but I'm not completely sure it is behaving as it should.

globals ;;initialize global variables in the model 
[
  num-clusters
  growback-time
  max-energy
  min-energy
  max-speed 
]

turtles-own ;; assign attributes to each turtles
[time-since-last-found energy metabolism]

patches-own ;; includes step-4 modification
[harvest-time]


to setup-globals ;;initiate values for global variables- includes step 3 modificatons
  set num-clusters 4
  set growback-time 100
  set max-energy 10
  set min-energy 0.4
  set max-speed 1
end

to setup-patches ;; create 'mushrooms' using in-radius function
    ask n-of num-clusters patches
  [
    ask n-of 20 patches in-radius 5
    [
      set pcolor red 
    ]
  ]
end

to setup-turtles ;;includes step 5 modification
  crt n-hunters 
  [
    set size 2
    set color yellow
    set time-since-last-found 999 
    pen-down 
    set energy 1 
    set metabolism 0.001
    
  ]
end

to setup ;; includes step 2 modifications
  ca
  setup-globals
  setup-patches
  setup-turtles
  reset-ticks
  
  set num-clusters 4
  
  ask n-of num-clusters patches
  [
    ask n-of 20 patches in-radius 5
      [
        set pcolor red
      ]
  ]
  
  crt 2
  [
    set size 2
    set color yellow
    set time-since-last-found 999
    pen-down
  ]
  
  reset-ticks
end

to go
  tick
  ask turtles [search]
  wait .05
  plotxy ticks mean [energy] of turtles ;;Modification 11-Add a plot of the average energy of your hunters
end

to search
  ifelse time-since-last-found <= 20
    [right (random 181) - 90]
    [right (random 21) - 10]
    forward max-speed
    
  ifelse pcolor = red
  [
    set time-since-last-found 0 
    set harvest-time ticks 
    set pcolor yellow  
  ]
  
  [set time-since-last-found time-since-last-found + 1]
  
  ifelse time-since-last-found >= 1
  [
    set energy energy - metabolism 
    if energy < min-energy
    [set energy min-energy]
  ]
  [set energy energy + 1 
    if energy > max-energy
    [set energy max-energy 
    ]
  ]
  set color scale-color yellow energy min-energy max-energy 
end

Kevin Carrig

unread,
May 28, 2014, 10:51:33 AM5/28/14
to au-ec...@googlegroups.com
What economic activities could you model by modifying the Mushroom Hunt model? Might a simple modification of the model be useful for thinking about e.g. agricultural day labor? Post this discussion in the *Mushroom Hunt* thread.

It seems as if a simple modification to the Mushroom Hunt model could be implemented to explore some methods for optimization of labor or finding the most efficient allocation of agricultural day labor. This would effectively be an experiment to explore return to scale values. The hunter agents would be replaced by some set of workers that are tasked with collecting an arbitrary agricultural product (in this case, mushrooms). We understand some decreasing returns to scale in physical labor- if too many agents work the field to collect a finite amount of agriculture, the addition of one agent may lead to a less than proportional increase in output (i.e. too many workers in the field may lead to efficiency losses as laborers must spend time working around one another [and accordingly witness a fall in their max speed]). In this case, some of our initial attributes may not be applicable to the agricultural day labor model. For example, growback-time would not make sense in static model where we observing a one-period window of agriculture collection. 

An interesting application may be the use of 'pen-down' to define link intersections between the turtles (workers). We can program some fall in efficiency for each worker whose link intersects that of another turtle. We can interpret this as the time lost when two laborers are forced to work around one another or a reduction in each agent's max speed. 




Alan Isaac

unread,
May 28, 2014, 12:08:24 PM5/28/14
to au-ec...@googlegroups.com
Plotting

Can you elaborate on your concerns?  The required reading included a section on plotting
https://subversion.american.edu/aisaac/notes/netlogo-intro.xhtml#plotting-first-steps
which included a link to
http://ccl.northwestern.edu/netlogo/docs/programming.html#plotting
You want the section "Plotting Points": you can just use plot instead of plotxy,
so things are simpler than you are making them.  Also see the discussion of
Ticks and Plotting at http://luis.izqui.org/resources/NetLogo-5-0-QuickGuide.pdf
Finally, take a look at Natalie's implementation, and ask if you have further questions.
(Note: Natalie uses the ability of plots to contain their code, so you will need
to look via the Interface tab.)

Alan Isaac


On 5/28/2014 10:37 AM, Kevin Carrig via AU-ECON-ABS wrote:> Anyone have any luck with modification 9, "adding a plot of the average energy of your hunters"? I highlighted the section below where the plot is

Adaora Isichei

unread,
May 29, 2014, 1:28:40 PM5/29/14
to au-ec...@googlegroups.com

Thanks Kevin for posting the code for the plot, I have the same concern. My plot was a continuous straight line, I wasn't sure how to define the plot but your command makes more sense. However, can someone explain why the graph turns into a continuous solid black horizontal line.

Adaora Isichei

unread,
May 29, 2014, 1:31:56 PM5/29/14
to au-ec...@googlegroups.com
Thanks Professor Isaac, Just saw your post on plotting.
Reply all
Reply to author
Forward
0 new messages