An open API service indexing awesome lists of open source software.

https://github.com/crispengari/netlogo101

🥅 Hello world! From netlogo 101.
https://github.com/crispengari/netlogo101

netlogo netlogo-model simulation

Last synced: 4 months ago
JSON representation

🥅 Hello world! From netlogo 101.

Awesome Lists containing this project

README

          

### NetLogo for Agent Based Modelling(ABM)

In these series of tutorials we are going to learn practically how we can use agent based modelling to develop models using NetLogo. Here are the list of topics that will be covered in these tutorials.

1. **Introduction to Agent-Based Modeling (ABM) and NetLogo**
2. **Understanding Agents in NetLogo**
3. **NetLogo Programming Fundamentals**
4. **Building Simple Models**
5. **Introduction to Epidemiological Modeling**
6. **Developing a Basic Disease Spread Model**
7. **Enhancing the Model with Real-World Data**
8. **Introducing Advanced Features**
9. **Validating and Testing the Model**
10. **Final Project: Simulating COVID-19 Spread**
- Topics Covered: Students apply learned concepts to develop and present their own COVID-19 spread simulations.

### Installing NetLogo

1. To install NetLogo first you need to visit the following link:

- https://ccl.northwestern.edu/netlogo/download.shtml

2. Fill the name and email address from the form
3. Download the one for your operating system.
4. And then follow the installation steps.

### Hello World

In the following example we are going to create a program that print's `"Hello world!"` message using `NetLogo`.

1. Open NetLogo
2. Go to the `Code` tab
3. Declare a procedure it can be any name mine is going to be called `setup` and copy and paste the following code.

```shell
to setup
print "Hello World!"
end
```

4. Go to the interface and add a button that says when you click it it will run the following command.

### Class Example:

```shell
to hello
;; this is a simple hello world message to the console
print "Hello World!!"
end

TO BYE
;;
PrinT("Good Bye")
END

to setup
;; clearing the env
clear-all
;; let's create our very first title
create-turtles 1
end
```

### ABM (Agent Base Modeling)

You can load the models right straight from NetLogo.

1. Open NetLogo
2. Click on `File > Models Library` or `Ctrl + M`
3. Select the model that you want to simulate
4. For example we are going to show the simulation using the `"Wolf Sheep Predation"` click that and the model will be loaded.
5. Click the `Setup` button
6. Then the `Agents` will then appear in the environment.
7. If you click the `Go` button then the simulation will start happening where the wolfs will be eating sheeps and sheeps will be eating grass, and the visualization will be shown with time.

> Note that if you want to see the code behind the simulation you will have to click the `code` tab.

### Why ABM?

- They makes the invisible to become visible.
- It makes things falsifiable. Meaning that it can be used to prove something wrong by an experiment or observation
- Makes us review opinions and actions from different angles using different parameters.
- They make you allows you to make simulation of the society.

### Main types of entities in NetLogo.

- turtles (agents) - moving agent
- Patches - cell grid in the environment
- Links - distance between turtles

> Ref: https://wisc.pb.unizin.org/agent-based-evolutionary-game-dynamics/chapter/i-5/

- Interacting with the turtles.
- Using the command center to change turtles.

```shell
set size 2
set color red # ask turtles [ set color red]
ask wolf 45 [set size 3]
ask wolf 45 [die]
```