2014-12-10 Voting Lab

posted Dec 10, 2014, 4:47 AM by Samuel Konstantinovich   [ updated Dec 10, 2014, 5:11 AM ]
Goal: Patches can vote

Phase I
Setup:
Assign each patch a pcolor of red or blue randomly.

Go: 
1. Ask every patch to look at how many red/blue neighbors they have. They need to remember this number for later.
2. Ask every patch to change their color if there is a majority ( simple majority, 5 or more of one color.)
You must make sure step 1 completes before you start step 2, or you will count the UPDATED colors of neighbors, which is not the desired effect.

Phase II
Change the setup: 
Make the patches red, blue, green randomly.

Change the Go: 
If there is a majority of any one color ( more than 4 red, more than 4 blue, or more than 4 green ) then change to that color.

Comments