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
As noted above, the chaos game generalizes the behavioral rules to use the vertices of
a regular ngon 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 and any r value in the set
Hint: Where in our code do we see the number 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
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?
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 r
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
