NetLogo User Community Models
WHAT IS IT?
This model builds single-path or multi-path mazes with no cross-overs.
With one walker, the maze is traversable, and any point on the maze can be reached from any other point.
If more than one "walker" is active, then multiple mazes are drawn nestled in each other. Each individual maze is traversable, but the different mazes are not connected.
HOW IT WORKS
A recursive subroutine is used to implement the maze-drawing. Each walker starts at a random location, then wanders the field. With every step, the location is pushed onto the stack. When a dead-end is reached, the walker pops back to the previous turn location, and continues, until no open space remains.
To implement multiple walkers, allow the "curvyness" to be controlled, and reduce stack length for straight runs, the maze procedure has become somewhat complicated, and its basic operation hard to discern. Here is a simplified version to illustrate the basic operation:
HOW TO USE IT
Click "Setup and Build-Maze" to get things started.
OR, click ...forever varying. This will setup and build the maze defined by the sliders, then randomize things and build a different maze, forever. Fun to watch.
Walkers controls the number of walkers drawing the maze.
Path-width controls the width of the path, in patches.
Gap controls the gap between paths.
Curviness controls the tendency to go in a straight line.
Random-Orientation controls the initial direction of the walkers. If off, walkers all start out going up.
One-color controls walker coloring. If off, the walkers are assigned random colors from an attractive palette. If on, the selected pen-color is used for all walkers.
Pen-color, Gap-Color are self-explanitory.
THINGS TO NOTICE
How does the number of walkers affect how long it takes to fill the maze?
Usually we think of the path drawn by the walkers as the maze path, and the background as the "walls" of the maze. But what happens if the width is narrow, and the gap is wide? What qualities does the maze have if we think of the drawn path as "walls" and the gaps as "corridors"? Is this maze traversable?
THINGS TO TRY
Try different numbers of walkers
EXTENDING THE MODEL
Create a subroutine to have a turtle (mouse?) traverse the maze(s). For a single-patch path-width and gap, this is fairly easy, but might be harder for other gaps and widths.
Would a non-recursive routine work better, faster, etc? Would a non-recursive method be easier, or harder to implement?
This model takes advantage of netlogo's support for recursion.
CREDITS AND REFERENCES
COPYRIGHT & LICENSE
(back to the NetLogo User Community Models)