Hello!
So, soon we are going to get into really understanding the need of why you want to use agent-based modeling and what it is good for, what it can help you understand.
But before we get to that conversation, I think it is really important to try and have some insight into other users of agent-based modeling and places it has been used in the past.
Over the next couple of talks, I am going to be talking about some simple [trajectory?] models where it has been very powerfully used.
And also some more complex models where there are things that might be interesting to take a look at.
So, let us start with a couple of my favorite models. I chose these models primarily because of the fact that they are easy to understand, but also because of the fact that they have some powerful points to discuss.
So, the first, I am going to discuss is called the fire model.
So you want to open up NetLogo and go to Files > Models Library and then underneath Earth Sciences, it is usually closed up like this, you will find the Fire model.
And once you load that up you will see something that is just a black screen, very simple to use.
This, by the way is the interface tab of NetLogo. It allows you to run models and interact with models.
The first thing you are going to want to do, is hit the 'setup' button. And when you hit the setup button you see a layer of the model.
Now, this model is very, very simple. The basic idea is that every place you see a green dot is a tree and every place you see [a white dot, oh sorry] a black dot is a place without a tree.
And on the left side of the screen you will notice that there is a red line of fire, right? Or in fact, that is we call it fire, essentially.
The rules of the model are very simple:
If the fire agent in these cases touches a green dot, in other words a tree, it turns that green dot red, in other words the fire spreads from the red dots to the green dots.
Once the fire has spread it leaves behind a later shade of gray dot. And the idea is that the fire cannot respread to that same area, once you burned the tree it is burned for good.
So, right now, the way this model is set up involves that there is a slider up here. That is what we call it in NetLogo. Sliders controls on the input variables for a NetLogo model.
And right now it is set at 57%. And what that slider is controlling is how many trees there are in this world, in fact you can look to see [: so, it is set to 57%].
If you hit the 'settings' button, you can actually see how big he world is. So, in this particular world it is about 251 by 251 pixels or squares patches in this particular case.
And so 57% of 251^2 is the number of trees that are in this world.
And these trees, by the way, are placed randomly. It is just a random roll of a die weather a tree gets placed on a particular patch in this case.
So, what are we going to do is: we are going to hit the setup button, we already hit. That creates the world.
And now we hit the 'go' button. And the question I want to ask you is: with 57% of the world covered and knowing the rules about the fire we do, which is: the fire can only burn the green patches; will the fire get from the left side to the right side of the world?
And this is a simple question, and of course there are reasons why you may expect it to do it, right?
57% is more than enough. In fact, if you were to set up the patches, right, you could set up the patches in a straight line, such that only 1 over 251would be necessary to actually go from the left side to the right side of the model. Right?
Because you just need a straight line of trees all the way long.
So, here is the question: [will the patches, sorry] will the fire get from the left side of the world to the right side of the world?
Don't try it! I just want you to write down your guess first, you know. Kind of think it though your head.
And we will run it a couple of times and see what happens.
So, if we hit setup again, you know, it just restarts the world, same conditions.
Then we let the model run.
It spreads.
But slowly starts to die out.
And, in fact, it stops. Right?
So, let us try it again, maybe there is a fluke.
And we run it one more time.
Then the fire spreads and it spreads.
But then, again, you see the different chanis[?] and they start to dye out. Right?
And let us run it one last time.
And it spreads and spreads, and, by the way, down here, you are seeing the % burned. That is telling you what percentage of the number of trees actually burned. Right?
In this case 7.2% of them burned. Which is kind of small when you think about it, because this whole side of the setup is set to be much bigger than that. Right?
So, now I am going to move this slider, this little density slider. I am going to move it up, just five little increments, to 62%.
Again hit setup and I am going to hit go again in a second.
So, now slightly more of the world is covered. Right? 5% more of the world has trees in it. Right?
And the question I ask you again is: will the fire make it from the left side to the right side?
So, give you a second before I start it up and run, to write down your answer to commit to it.
So, I am going ahead and hit run now.
And, as you can see, the fire already is hitting numbers percent burned in % much higher than they were in the 57% space.
And, sure enough, it has hit the right side of the world.
It is still going, in fact, it has not burned out yet.
And we can run it again.
And, as you can see, it has only[?] transitioned.
But you can clearly see that it is just spreading much farther, it is spreading to much deeper places than it was before.
And, you know, it is hitting numbers in the 88-89% total range in terms of the % burned.
And let us run it a last time.
And while it is running, let me describe to you a little bit what is going on.
We have actually detected what is sometimes known as the phase transition in these model's dynamics.
And a phase transition occurs, traditionally we think of this as a transition from something like [a solid to gaseous form. Right? Or from, sorry, sorry, usually it is ] solid to liquid into gaseous form, sometimes you can get straight through, but you know, along those lines. Or gas back to liquid back to solid. Right?
And those are what we notoriously[?] think of as phase transitions.
What that hist[?] come to me is a model dynamics in which a small change in an input parameter, in this case the density slider, could[?] a dramatic change of the outputs of the system, in this case the fire goes all way across the world and a lot higher percentage of the world is actually burned.
In fact, because we have studied this model and this model actually, in some respects, has some closed form solutions to it. When that slider is at 57%, we know that there is almost a 0% probability or zero probability that [the forest, eh] the fire will actually go from the left side to the right side of the screen. Right?
Now, it is not completely 0, so I explain: you could just randomly roll the die such that trees align perfectly across the shape[?]. But it close to zero. Right?
On the other hand, when it is up at 62%, at the other end, right?
The we know there is almost 100% probability that the fire will go from the left side to the right side of the screen. Right?
And at values in the middle, like around 59, 60 for instance, there is a moderate probability that[?] all[?] chances[?]. Right?
But this is clearly what we would describe as a phase transition: any small change in the density parameter leads to a dramatic change in the output of the model.