Question: Implementing the general chaos game 1 . As noted above, the chaos game generalizes the behavioral rules to use the vertices of a regular n

Implementing the general chaos game
1. As noted above, the chaos game generalizes the behavioral rules to use the vertices of
a regular n-gon as target points, and for each painter agent to move a fraction r of the
distance to the randomly selected vertex. Consider how we might modify the model
to support any n value in the set {3,4,...,12}, and any r value in the set
{0.01,0.02,...,0.99}?(Hint: Where in our code do we see the number 3, representing
the number of vertices? Can we replace that literal value with a variable that can be
controlled in the user interface? Similarly, where do we see the number 0.5,
representing the fraction of the distance to the target vertex that the painter turtle
moves? Can we replace that literal value with a variable controlled in the user
interface?)
2. Add two sliders (to control n and r) and modify the code as necessary to change the
model into one that implements the general chaos game. Make sure you still get the
expected results with n =3, r =0.5.
3. Experiment with different values of n and r. Can you find other interesting
combinations of values?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!