![]() Now that we’re using the tick counter (automatically created with reset-ticks), we should tell NetLogo that it only needs to update the view once per tick, instead of continuously updating it. Repeat to see the effects of the random initialization. Switch to the Interface tab and press the setup button you made before. end completes the definition of the “setup” procedure.reset-ticks starts the tick counter, now that setup is otherwise complete.That makes the turtle move to the point with those coordinates. Finally each turtle runs the setxy command with those two numbers as inputs. Then each turtle runs the reporter random-ycor, same for the Y axis. First each turtle runs the reporter random-xcor which will report a random number from the allowable range of turtle coordinates along the X axis. A reporter, as opposed to a command, reports a result. setxy random-xcor random-ycor is a command using “reporters”.After create-turtles we can put commands for the new turtles to run, enclosed by square brackets.They start out standing at the origin, that is, the center of patch 0,0. create-turtles 100 creates 100 turtles.Basically, it wipes the slate clean for a new model run. All the patches turn black and any turtles you might have created disappear. ![]()
0 Comments
Leave a Reply. |