Question: Start NetLogo software to explore agent-based models. Start by selecting File and then Models Library from the main menu at the top of the interface.
Start NetLogo software to explore agent-based models. Start by selecting File and then Models Library from the main menu at the top of the interface. You will see many models in the library. Lets start by examining models for scenarios that we have already modeled before.
1. Predator-Prey Model in NetLogo Under Help in the top menu, select NetLogo User Manual. A webpage will come up with lots of intfo and tutorials for NetLogo. We are going to start by skipping to Learning NetLogo > Tutorial #1: Models. Once you have followed the directions in this tutorial, you will have investigated the interface choices and also looked at the Info tab at the top and read about the model. Be sure you have investigated both the wolfsheep model and the wolf-sheep-grass model. In addition to the notes that you wrote down during the tutorial, write down a few sentences about what you observe, and the differences between these two versions of the model. Now try looking at the code to see if you can understand how the model is defined in the code. Note that in NetLogo, the agents are called turtles. In the code, it is important to define what happens during setup and what happens upon go.
2. Infectious Disease Models in NetLogo This time when you select the Models Library, go to the bottom under Alternative Visualizations and select, Virus Alternative Visualization. Follow the same procedure that you did in part 1. Setup the model, click go and observe what happens. Read the Info tab about the model. Go back to the Interface and make changes that affect the model behavior. Write down a few sentences about the model, the parameters, and what happens.
3. Next try writing a NetLogo model yourself. Start by going to File in the main menu at the top of the page and select New. Click on the Code tab and use copy and paste to enter the text below. Go to the Interface tab. We need to add buttons for setup and go. Do this by selecting the Button choice from the menu at the top of the interface and then clicking on the Add choice. When you go down to the area to the left of the Patch, the button will appear and you have the option to enter code associated with the button. Write setup in the window labeled command. Now do this again for a go button. Edit the go button by doing a right click on the button and click on the Forever option. Now try running your model by clicking on setup and go. Go back to the code and see if you can understand how the code works. Save the model again before exiting. CODE TO USE DURING TUTORIAL ; Unconstrained growth simulation globals [ growth-rate chance-move ] ; put red turtle at location (0, 0) to setup clear-all set-default-shape turtles "circle" crt 1 [ set color red ] set growth-rate 0.1 set chance-move 0.15 reset-ticks end ; master scheduler ; A bacterium moves with probability chance-move. ; A bacterium divides with a growth rate of growth-rate. ; Simulation stops after 100 ticks. to go ask turtles [ if random-float 1.0 < chance-move [ move-to one-of neighbors ] ] ask turtles [ if random-float 1.0 < growth-rate [ hatch 1 ] ] tick end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
