Talk:Courses/CS 461/Winter 2006
From CSWiki
Contents |
[edit] Installing MASON
A note to anyone installing mason: if you want to install the Java3D package, they highly recommend you install the OpenGL version, but it doesn't work with ATI cards ;). Install the D3D version instead and save yourself the hour of frustration. --User:Rick Strom
[edit] Catching moths
In Biology > EvoLab > Unverified > Bug Hunt Camouflage: to make it easier to catch moths, comment out
if mouse-down? [
and the closing square bracket in the to eat-moths procedure. Then the mouse is always active. Any moth under the mouse is destroyed.
I said in class that the message is "the fit survive" means those who fit their environment survive. That's true, but it doesn't aways mean that those who blend in always fit the environment. Fitting the environment depends on the environment. There are often many different ways to fit well in a given environment.
Russ Abbott 11:30, 22 January 2006 (PST)
[edit] Wealth distribution
In Social Science > Wealth distribution: you will get a constant flat distribution if you set life-expectancy-max and metabolism-max both to 1 and modify the set wealth line in set-initial-turtle-vars to be
set wealth metabolism + 25 ; random 50
That way there is no initial randomness, and since all agents die after one generation, there is no chance for any agent to accumulate wealth.
If you reset the set wealth line to be
set wealth metabolism + random 50
you will get a tripartite distribution as before—although the Lorenz curve will not be very sloped. This shows that just a basic randomness in initial wealth is enough to generate a distribution. But what else could it do. If the initial distribution of wealth is not exactly the same, some agents will have more than others and some will have less just as a result of the random draw.
To turn the Lorenz curve upside-down, change update-lorenz-and-gini-plots so that
let sorted-wealths sort values-from turtles [wealth]
becomes
let sorted-wealths sort-by [?1 > ?2] values-from turtles [wealth]
which sorts the agents riches first instead of poorest first, which is the default. You also have to exchange the + and - signs in set gini-index-reserve.
Russ Abbott 11:30, 22 January 2006 (PST)
[edit] Some questions about randomness
In Biology > Ant Lines how can you get the ant to wander farthest from a straight line path to the food?
[edit] What is the real effect of how NetLogo tends to select an angle for turning?
I first revised the wiggle code to look partly like this.
set angle random-float angle if (random 2 = 0) [set angle (- angle)] rt angle
This selects a random angle between 0 and angle and then makes it negative with a probability of 1/2. So this picks a random turn between -angle and +angle. The code originally was
rt random-float angle lt random-float angle
Do the two versions give you the same distribution of angles?
To answer this, consider whether
(random a) + (random a) + ... + (random a) [n times]
gives you the same distribution as
random (n * a)
which is the flat distribution between 0 and n * a
[edit] What's the effect of the size of angle?
The default value for angle (with the initial way of computing the turn angle) is 38. What happens when you change that value? If you make it larger, the path of the leader ant becomes much more jagged, but overall, it stays closer to the straight-line path to the food. One the other hand, if you decrease angle, the path becomes smoother, but it tends to wander further away from the food. Why is that? A setting of 15 seems to generate an interesting collection of paths. Russ Abbott 11:30, 22 January 2006 (PST)

