# Emergent Algorithm

Made by Tonya Sedgwick, Christina Reimond, Dan Cheng and Abhishek Tayal

Made by Tonya Sedgwick, Christina Reimond, Dan Cheng and Abhishek Tayal

Created: September 28th, 2014

0

Here are the links to the videos!

1st iteration:

__https://www.dropbox.com/s/9y9xa7oc3g39hdj/Assignment%205%201st%20Iteration.mp4?dl=0__

2nd iteration:

__https://www.dropbox.com/s/domgcny4xqingkp/Assignment%205%202nd%20Iteration.mp4?dl=0__

With our algorithm, each player randomly generates a number of steps between 1 and 10.

Each player then starts in a corner, facing inward toward the space.

Each of the players starts out walking forward. If there are no people or walls nearby on a collision course, the player takes the number of steps from what she/he got at the beginning(1 to 10), then flips a coin to decide which direction to turn. If the coin shows heads, then turn right; if tails, then turn left. The player then repeats the process (taking the appropriate number of steps again, etc.)

However, between each step, the player checks if he or she is on a collision course with any other player, or a wall.

The movement score will be the number of collisions during the movement, since the more collisions happen, the movement has more entropy.

If the player is on a collision course with another nearby player (within approximately 2 feet), the one that is located closest to the camera flips a coin. If this player flips heads, then that player’s “value” is head, while the other player’s “value” is tails. Then, the player who is further from the camera flips a coin to determine who “wins” and can continue in the same direction, while the other player turns. If heads is flipped, then the player who has that value wins, and similarly for tails.

If the two players are the same distance from the camera, then the one who is closest to the left boundary (from the camera’s point of view) flips the coin to determine player values, and the one more to the right determines who wins. After two players have determined a winner, the winner continues in the same direction, while the other player flips a coin to turn. Then each player starts over with his or her respective number of steps.

If the player is on a collision course with a nearby wall (within approximately 2 feet), then the player flips a coin to determine whether to turn left or right, and does so. Then, the player starts over with his or her number of steps.

We tried to write our pseudocode in a way that reflects how a participant would actually perform the action (a performance algorithm-- much as the pseudocode was presented to us for the previous assignment). For example, when a player finds his or her random number of steps, he or she first finds the number, then assigns it to numsteps.

//Each person starts in one of the four corners, facing inward toward the space.

width = field.width; //get the width of the field

length = field.length; //get the length of the field

//initial positions

person1 = (0, 0); //left up corner

person2 = (length, 0); // right up corner

person3 = (0, width); //left down corner

person4 = (length, width); //right down corner

void main() //main instructions for each person

1 + random(9) = numsteps; // get a number between 1 and 10

timer on

while (timer > 0 and timer <180) //3 minutes

for i in numsteps

step forward

// If there will be a collision, x will be person colliding with if no collision, x=None

collision() = x

if (x != None)

closerToCamera(x,self) = y // find who is closest to camera

// I am closer to camera, so I flip coin to see who is heads/tails

if (y == self)

random(1) = myVal // if 0, I am heads, if 1 I am tails

otherPlayerFlip() = flip // other player flips to see who “wins”

// I lose so change direction

if (flip != myVal)

random(1) = direction

if (direction == 0) turn right

else turn left

// otherwise, I win so start over with numsteps in same direction

// other player is closer to camera, so they flip coin decide who is H/T

if (y != self)

otherPlayerFlip() = flip // other player flips to see who is H/T

// notice that flip is the value that other player takes

if (flip == 0) 1 = myVal

else 0 = myVal

// I flip to decide who wins

random(1) = flip

if (flip != myVal) // I lose, so change direction

random(1) = direction

if (direction == 0) turn right

else turn left

break //start over with numsteps

if boundaryClose() // nearby boundary is on collision course with self

random(1) = flip

if (flip == 0) turn right

else turn left

break //start over with numsteps

// if self reaches this point then there were no near collisions, and the full duration of

// numsteps was carried out, so change direction

random(1) = flip

if (flip == 0) turn right

else turn left

We chose to conduct our project in two spaces with very different sizes. Our first recording shows us following the algorithm in a squash court, which is a small, enclosed space. Notice that our boundaries are the back wall, the two side walls, and the red horizontal line closest to the camera. This choice of space should result in higher entropy, since smaller space means more collisions--both with each other, and the boundaries. More indeterminacy and randomness, since collisions involve flipping coins to determine which way each person should go, adding more unexpected movements.

For our second recording, we chose a space outside between Wean and Porter Halls. This is a much larger space, which we expect to result in much less entropy as there probably will be fewer collisions. Less collisions means the movement is more predictable, so there is less indeterminacy and randomness.

Entropy was also introduced into our project in that we would sometimes drop coins or make mistakes, which added to randomness. In addition, as mentioned previously, we would expect entropy to be much greater in a small space, since less space results in more “collisions” between players, and also between players and boundaries.

There also is a level of indeterminacy in that coin flips are not something we control; they are relatively random, so we do not know how our movements will be affected ahead of time.

The emergent forms that are created are different in each of the two iterations. Each of us follows the same algorithm (though with different random numbers generated). The process that emerges in the first iteration is such that we are interacting with each other much more. Visually, this looks like a filled screen, with a lot of collisions and not very much negative space. This creates a rushed feeling. In the second iteration, where only one collision occurs, the visual is filled with negative space. The piece feels slower and calmer. These emergent properties have the potentiality for being compared to city sidewalks--which are generally less wide than rural sidewalks, but have more people using them.