Courses/CS 461/Winter 2006/Martin Olsen
From CSWiki
Contents |
[edit] About me
Name: Martin Olsen
E-mail: molsen@calstatela.edu
[edit] Homework
Week 1 ![]()
Week 2
Week 3 ![]()
Week 4
Week 5
Week 8
Week 9
[edit] NetLogo stuff
[edit] Amplifying after diffusion
I have continued playing around with the deep sea turtles that I made for homework Week 1. I have fixed some stuff. First I have changed the shape, and now they actually look like turtles:
set shape "turtle"
Another problem I had was with the diffusion. I set every patch to have a randomized elevation between 0 and 10000.
set elevation (random 10000)
This works fine, but when I apply the diffusion
repeat smoothness [ diffuse elevation 1 ]
the elevation looses some of its randomness and most of the patches have an elevation around 5000. This is because of the "smudging". Each patch will get influenced by the patches next to it. Note that also the color of the sea is based on the elevation:
set pcolor scale-color blue elevation 0 10000
The result looks like this:

Notice how the deepest is around 5400 and the most shallow is around 4500 and we have a difference of approximately 900. However, what I want is the deepest to be 10000 and the most shallow to be 0. I can of course solve this by having no diffusion at all. But this is not what I want:

Therefore I introduced another variable multiplier:
set deepest deepest - shallow set multiplier 10000 / deepest
and
ask patches [ set elevation elevation - shallow set elevation elevation * multiplier set pcolor scale-color blue elevation 0 10000 ] set shallow 0
The multiplier is used to amplify all the elevations so the distribution will include the entire spectrum between 0 and 10000. Now look at the difference:

[edit] Changing the patch size
Changing the patch size makes it look nicer and less pixelated. However, once I make the patches smaller, I also make the area bigger. So the diffusion effect must be applied more times. Having a pixel size = 2 and x width and y height set to 200. It now takes about 10 seconds to set up the deep sea turtles with smoothness set to 200. But it looks better.
[edit] Source code
Deep sea 2 (Simple model)
Deep sea 4 (More advanced model with sharks and female and male turtles.)

