Serendip is an independent site partnering with faculty at multiple colleges and universities around the world. Happy exploring!
Reply to comment
Emergence 2009: Exploration and Barriers VII
Biology 361 = Computer Science 361
Bryn Mawr College, Spring 2009
Download/view: RandomFillBarriers.nlogo
HOW TO USE IT |
SETUP and GO buttons are standard.
While the DRAW-BARRIER button is on, the observer can draw barriers in the world witht he mouse by clicking and holding while moving the mouse. Additional barriers can be drawn while the model is running.
When AUTO-RESET is on, every time the turtle has visited every patch (that hasn't been made into a barrier), the number of ticks required to fill every patch is stored and the world resets and continues to run. This is an easy way to complete numerous runs to get an average filltime. The RUN# monitor keeps track of how many runs have been completes
The PERCENT VISITED plot and monitor keep track of the percentage of patches the turtle has visited within each run.
The AVERAGE FILLTIME plot and monitor keep a running average of how long the turtle takes to visit all patches in each run. |
THINGS TO TRY |
Draw different types of barriers and see how they affect filltime. |
NETLOGO FEATURES |
This model makes use of lists to keep a record of filltime values. The list is used to keep a running average of filltime with the MEAN primitive. It also uses the ONE-OF primitive, which gives a random item from a list. |
EXTENDING THE MODEL |
Try making barriers work when the turtle moves more than one patch at a time. Also, try to make a second 'setup-redraw' button that does a normal setup plus re-drawing the barriers as they were drawn. |
RELATED MODELS |
This model is built on a simplified version of 'RandomFill.' It lacks some of the features of that model because so far I have only figured out how to make barriers work reliably if the turtle moves one patch per tick, and only on the four cardinal headings. |
Models created using NetLogo.