Good morning everyone, my name is Dr. Igor Nikolic, an assistant professor at Delft University
of Technology and a senior visiting research associate at the environmental change institute
of the University of Oxford, and this where I'm speaking to you from.
This is the next installment of the NGI MOOC and today, we will be talking about Agent
Based Modeling, but before we start let's consider something that you'll do tonight.
Tonight, when you go home, you will perform a seemingly insignificant and simple action.
You will arrive at home and notice that it's dark and you will go click, turn on the light.
And suddenly because at the same time you are doing this, millions of others are doing
the same thing an overall pattern, overall over the world, overall emergent presence
of humanity becomes visible on the face of the earth.
Now nobody has told us, collectively, when to turn on the light and how to make sure
that we become visible through space, now this is a consequence of individual actions,
of individual choices all happening at the same time.
And how do you see things come to be?
Where do the systems come from?
How come that we are collectively able to do that?
Well, just think about it: The world that you are part of is a large complex adaptive system.
There is a myriad of technical things, wires, transformers, switches, machines there's lots
of people, large transport systems, energy production, laws, regulations, habits, all
sorts of things going on at the same time, all over the place, acting and interacting
with each other to create this beautiful blue marble with lights on them that we see.
So how does one even go about trying to understand all these interconnected systems, that adapt
grow and evolve?
Well, this is the lecture on Agent Based Modeling, so this is obviously how we are going to approach this.
So, Agent Based Modeling, what is it?
And why should you care?
So what we will discuss today is the following: We will talk about what an agent is, what
agent based modeling is, I will show you a number of examples to help you understand
when and how to use agent based modeling and I will try to give you some pointers to help
you explore Agent Based Modeling on your own.
So, without further a due, let's start.
Well, Agent Based Modeling is a technique that comes from the Complex Adaptive Systems toolkit.
It is something that has been around for quite a while, but it's only recently that computers
have become powerful enough to really use it to its full potential.
And one of the great thinkers in the field, Joshua Epstein, has once said: "If you did
not grow it, you did not explain it." Now this approach is called Generative Science
and this is what is the heart of Agent Based Modeling.
So it is all about understanding the world phenomena of the world from the bottom up.
It is a very multi-disciplinary approach used for understanding complex systems and it is
really about understanding how things develop, rather than how things are.
So it is all about the process of interaction and action and reacting individuals giving
rise to a pattern that we observe.
So, how this is done, well we will start by situating an autonomous heterogeneous agent,
or entities or things, in some kind of relevant environment in space a network or whatever.
We will let them act and react and interact following relatively simple individual rules,
then these interactions will generate, or grow, this observed macroscopic pattern that
we're interested in.
For example if you're interested in how the stock market behaves, and why it is going
up or down, one way to understand it is to look at many individual investors and decision
makers, see how they act and react, looking at what others are doing, looking at what
the environment is doing and understanding how the pattern comes to be.
Alternatively, what we also can do, is if we have a collection of individuals that we
understand very well, so we know how this firm behaves, we know how this government
behaves, we can then explore and simulate what kind of behaviors are they capable of
in the long run.
So, how does this work?
Well, we sometimes say that an Agent is a thing that does things to other things.
So, why is this important?
Well, just look at the image.
You see that at the middle there is an agent, an entity or thing that knows things and does things.
Now this thing is situated in a model in some kind of environment, where there are other agents,
which sits inside a model that we as a modeler have chosen and drawn boundaries around.
We have said this belongs to the system, and this does not.
Now, looking at these agents, following inputs from others, from the environment and from
their own behaviors, they will make decisions and they will perform actions.
Now these actions can affect themselves, they can affect the environment around, they can
affect other agents.
Now there even might be many other agents that are acting, and interacting on their own,
without having direct interaction with you, the agent.
But because they change the environment that they are in they might indirectly affect you.
So it is literally the thing that does things to other things that gives rise to a pattern of interaction.
Now, what are the components of such an Agent based model?
Well, first, clearly it is the agents, the entities, the things themselves.
Then there are states, then there are decision rules, the actions they perform, the environment
they are in and the time in which they exist.
So let we discuss these in a little bit more detail and give you an insight in how it works.
The agents themselves, as I said, they are things that do things to other things.
This agent can be anything, really anything that you care about and you think is worth exploring.
For example: individual people, firms, organizations, ideas, countries, technologies, bacteria,
whatever you really care about.
They key however is to identify a relevant entity that has a boundary, that has a clear
inside and an outside, that has an internal state, has decision making processes and is
capable of actions.
So, the states then.
The states are things that the agents knows or has.
They could be public or private, such as my location, my color, my assets, you know, what
is the content of my wallet for example.
And I can tell you, being an academic, it's not a lot, but the things that I have, that
allow me to reason on and make actions based upon it.
So it is the things I know or have.
Now, the decision rules, as you can see here, are the decision and transformation rules
that take inputs and my states and convert them into some kind of actions and overall behaviors.
These things can be static or dynamic, and for example, as you can see on the slide,
here is a simple reasoning logic for setting a price of a product you're selling based
on a cost plus margin mechanism.
Now this can be very elaborate, people have done very crazy adaptive things, like genetic
algorithms, genetic programming, all sorts of things, or they can be very simple as IF THEN statements.
If it rains, and if I do not have an umbrella, I will have to buy an umbrella in order not to get wet.
And then the action becomes the buying and the state is being wet, yes or no.
Now the actions, the consequences of the decision making processes, the result of those and
Agent will perform or not perform some action.
Now this is important to realize, that agents are autonomous, they can choose not to act.
Whereas you are dealing with for example object oriented programming an object will always
do what you ask it to do.
With agents you'll say it's your turn to act, the agent will then consider its environment,
consider its state, make the computation that it needs to do, and then decides whether to
act, and how to act.
Now, this action can be based on some input of another agent, on some state, or some kind
of internal decision rule.
These actions can also affect other agents, they can affect their own rules, their own
states, they can affect the environment, and it is often through this indirect interaction
throughout the environment that the true complexity of the system arises.
Now, the environment.
Now the environment is a thing the agent is in, and everything that is not the agent but
is relevant.
Now this environment provides the agent with structure and information.
For example if I'm an investor agent trying to decide whether to build a power plant,
I might consider the cost of capital, the interest rate.
This is not something I control, it's not something that is part of me, but it is something
that the external world sets.
So the environment affects the agent and in some cases the agent may affect it as well.
It also provides structure, it provides space through which we interact.
For example, an agent can be on a grid so I can have eight neighbours around me and
I only know of those eight, or I could be in a physical space, for example on a GIS
map so I can say well this agent is three kilometers away from me or two meters.
I could be in a network, so I could have a network environment where I could see my first
degree neighbours, my second degree neighbours, and so forth.
Now finally the aspect I want to discuss is time.
Now time is a very peculiar thing, excuse me, in Agent Based Modeling, as time takes
place in discrete steps, in ticks and between two ticks we assume that everything happens at once.
Now, why do we do this?
Well, if you remember from the opening, the complexity is all about things happening at
the same time across the space, acting and interacting all over the time.
Now it is this parallelism of the real world that we are trying to capture when we build
Agent based models.
Now given that computers are sequential processing machines, we have to allow things to happen
at the same time even if they happening one after the other.
So we assume that between two steps, between two ticks, everything happens at once.
So the order, or the sequence of agent interaction, is very important, because like you can probably
imagine if a certain agent always goes first, for example is always allowed to buy first,
it will buy the cheapest resources for example and always have an advantage.
So we shuffle the agents every time step, and allow them to take turns to form interactions
by this we simulate parallel action that we observe in the real word.
Now let me give you a very simple example of how this works.
Now as I opened with this wonderful blue marble image of our planet, what has happened there
is individuals arriving at home experiencing the environmental change, they see dark, they
see other agents, choosing to turn on the light or not, and based on inputs of others,
on their own individual preferences, they decide to turn on the lights.
Now, nobody coordinates when to turn on the lights, but because we are very similar in
many ways as humans we will roughly do that at the same time and we will see the lights
of the world come up.
Now let me give you a slightly more complicated example and one that is at the so called operational
scale, something with a short time scale, where it is all about how actions are actually performed.
Now, what you see here is a simulation of the airbus a 380 evacuation plan.
Now, as you might be aware, before an airplane is put into production before use it has to
pass certain requirements in terms of how quickly it can be evacuated.
Now, normally you would do this with many, many, many individuals, many participants,
you will put them into the plane, tell them, fire!
And then they have to run out as quickly as possible.
Now this is expensive and takes a lot of time, because as you decide they are not moving
fast enough you will have to adapt the lay-out of the seats, move the exits, things like that.
Now, what airbus has done in this case, it has simulated human behavior, individual behavior,
in a computer as agents.
Now this agents follow rules that are observed when humans are in panic and try to run away
and they can simulate time and time over to see how quickly people can evacuate the plane.
And the emergent pattern from this interaction of bumping into each other, trying to squeeze
through a tight spot, is the movement patterns and the evacuation time that results.
Sorry about that.
So, this is a very operational, short time-scale example where we try to understand the emergent
pattern at a short scale.
Now at the medium time-scale, at the more tactical time-scale, there is this other example
of for example a refinery.
This is work done by a colleague of mine, Dr. van Dam, who has looked at the purchasing
strategy and the effect it has on the performance of refineries when the refinery is facing
delays and disruptions in its crude oil supply.
Now in this case the agents are multiple departments, they all have their own internal logic,
their internal goals they are trying to achieve and they are trying to cooperate and make
money at the same time and they are experiencing these delays as for example when there are
disrupted shipments.
Now the individual share again are the departments and the overall pattern is the overall performance
and efficiency and profitability of the entire plant.
Now, at the long-term, at the strategic level example.
There is wonderful work done by my colleague
Dr. Chappin who has looked at the effects of carbon tax on carbon trading and power generation
in the Netherlands.
So here we have the agents that are energy companies, own multiple facilities that experience
changes in prices and changes in electricity demand, and they have to make decisions whether
to invest, whether to divest, whether to buy one kind of fuel, or another kind of fuel,
interact with each other and the overall emergent pattern will be various levels of CO2 emissions
and CO2 reductions and various electricity prices.
So this is something that happens over decades compared to the airbus example that happens in minutes.
But you can still use an agent based model in a very useful fashion to explore how individual
interactions, individual decision-making processes affect an overall pattern.
And here at this final slide you can see an example of a running simulation.
This is power plants making decisions, investing into new facilities, you see that the generation
profile is changing, there is more electricity produced from one source than from the other,
you'll see that the CO2 market is changing, you can see all sorts of dynamics happening
over time as agents act and react.
Now, with this I would like to thank you for your attention and I hope I have given you
a basic understanding of what an agent based model is and how you can use it.
Now, to wrap up I would like to point at several resources that might be useful for you to
continue studying this topic.
Ohh yes, and of course please post any questions you might have on our discussion forum.
So, further reading: First, I encourage you to download Netlogo.
Netlogo is a free and open source Agent Based Modeling platform that is very well suited
for teaching and studying agent based models.
There is the link where you can get it.
Secondly, the book by Joshua M. Epstein,
Generative Social Science, that talks about how does one explore social phenomena
from the bottom up.
I have already mentioned Joshua Epstein, but I do strongly suggest reading that book.
Furthermore, there are two open courseware courses that I offer online.
The first one, SPM4530, deals with complex systems and a short introduction into agent
based modeling and the other course, SPM9555, deals with advanced agent based modeling and
it takes you in great detail in how to build complex models.
Finally, when you're ready to dive even deeper there is a book called Agent Based Modeling
of Socio-Technical Systems, edited by me, my colleagues Dr. van Dam and Dr. Lukszo and
there it is online, you can check it out to dive into this topic much deeper.
Now, I wish you a lot of fun and enjoyment studying Agent Based Modelings and good luck.