Switch back to the Interface, click “setup” and “go”, and watch your turtles graze! Let’s create a structured environemnt through which they will move. Now we’ve got 100 turtles aimlessly moving around, completely unaware of anything else around them. We’d like to keep go as simple as possible, so that it is easy to understand.Įventually, it will include many other things you want to have happen as the model runs, such as calculating something or plotting the results.Įach of these things to do will have its own procedure and each procedure will have its own unique name. We could have, but during the course of building your model, it’s likely that you’ll add many other parts. Why couldn’t we have just written all of these commands in go instead of in a separate procedure? Green sticky notes when you’ve gotten this to work. Once finished adding the code, go back to the Interface, click setup to initialize and go to make your agents move. The “-“ combines “move” and “turtles” into a single name. Earlier, we used red - 2, with spaces, in order to subtract two numbers, but here we want move-turtles, without spaces. Note there are no spaces around the hyphen in move-turtles. The “Disable until ticks start” prevents you from pressing go before setup. The “Forever” checkbox makes the button stay down once pressed, so its commands run over and over again, not just once.
0 Comments
Leave a Reply. |