Serendip is an independent site partnering with faculty at multiple colleges and universities around the world. Happy exploring!

Emergence 2009: Exploration and Barriers VII

Emergence

Biology 361 = Computer Science 361
Bryn Mawr College, Spring 2009

 

Back to index of models

 

 

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.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
To prevent automated spam submissions leave this field empty.
1 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.