[MUSIC] Hello everybody, my name is Rahmatollah Beheshti and I'm from John Hopkins University, Global Obesity Prevention Center. Today, we are going to talk about agent-based modeling and as I like to call it, simpler way to understand complexity. So in today's lecture, we are going to have two different sections. In the first section, we are going to talk about basic concepts and later we are going to talk why agent-based modeling is interesting for us. And what makes it very valuable for our purposes in public health or different simulation needs. So let's just start with the basic concepts and first by the definition of agent-based modeling. So basically agent-based modeling is a technique that refers to a set of agents that you as a designer design. And then you have those agents that are economists. And then those agents can interact with each other and they can have autonomous decision making. And then the complexity that you are trying to simulate then arise or emerge from the interaction between these agents. So as you probably noticed in my definition of agent-based modeling, we have two major elements. The first one is agents and the second one is just interactions. So for agents, in order to define what make an agent an agent. We need to come up with a setup attributes, properties and features for them. And also in order to determine, but govern their behavior in the system we need to have a set of rules. So in today lecture, I'm going to refer to an example of school children and you can think of a model that you want to create and simulate school children who go to school and your purpose is just simulate their energy intake and physical activity. So if you think for a moment, what would be the agents in your system? So probably the first set of agents that come to your mind are schoolchildren, it could be other agents as well. And it depends on the purpose of your study. It could be like school teachers, parents, food store owners, those kind of people, but for now you're going to stick to school children. And for this purpose, what are the attributes that are relevant to your model? Probably some attributes like weight, height, gender, age those are relevant and probably we don't need other attributes like blood type or blood pressure. And going forward the rules, what are the rules that you probably need to have for your simulation to be working. So one example could be when each agent or each school kid wakes up in the morning, or how often does the kid eat a snack during a weekday when she or he goes to the school. So let's just spend more time on this two major elements, and we're going to start with agents. So agents are practically software entities. They have properties as we referred to them as attributes, they follow rules that determine how they should be performing their actions and they are autonomous decision makers. They have a state that are determined by the value of the attributes and also that environment that they are located. And for example, in our case in the school kids scenario, the environment could be being at the school or at home or in a gym. So an agent are usually interactive, and they can interact to other agents for instance, other school children to a school kids and a school bus driver. Anything that you could imagine. The important thing is that ages are usually interactive. And as you've probably noticed so far by definition agents are heterogeneous. And each agent that we define in our model has its own objective, and they are adaptive and may learn. And learning could be in different ways it could be something complex as motion learning algorithm or it could be something different like social learning type of activity. For example and or scenario, it could be that when an agent observed that a certain number of its own friends are going to a specific food store in a neighborhood, that agent might also decide to go to that specific food store and purchase food from there. Next, we have rules. So rules are in different types. It could be simple or adaptive pre-defined rules. For example, a rule might be saying that wake at 7 AM in the morning during week day, but if it's a weekend time then wake up at 9 AM or it could be rational or optimizing type of rule. For example, find the closest food store to my current location or find the store that has the cheapest type of food. Those are all rules that could be defined in an agent-based model. They could also be behavioral or social. I already had an example of social learning and it could be even like more fancy way of doing that. Like assimilating the role of online social media and how that affect agent's behavior. So in the language of agent-based modeling we usually tend to refer to rules as procedures. And agents of given part usually executes that same procedure. For instance in our case, it could be that a procedure is going to the school with the school bus. But it's only school children that can perform that procedure and school teachers are not able to do that. And what each agent actually does can differ and vary over time, meaning that for example in our case, if an agent is within let's say, two miles away from the school that agent can walk to the school. But if the home location of that agent is further away, then walking and using the walking procedure to go to the school is not an option any more. For developing agent-based models, similar to major elements that we identified so far. We need to first of all, think about two major elements when we want to develop and agent-based model. The first one is agents, and the second one is what is governing, what are governing their behaviors or identifying rules? And for those two questions to be answered, we need to have a very good understanding of our system and we need to identify irrelevant things and to think of what to include and what to exclude. What is a driver in our model, and what is a passenger? We probably don't need every single aspect of the whole system. We only need those elements that are very important for us. And we also want to make sure to make implicit assumption explicit. For example, just say that you want to build a simulation of how dogs of a certain place grow and gain fat. But you also should note that when it comes to adult, we usually assume that their height is fixed, and it's just not going to change. And that is just very important assumption that you need to aware of. And usually what happens in agent-based modeling, probably similar to any other modeling technique is that it's just a recursive process that starts with a very tiny, simple understandable model. And then through a recursive process, the designer adds more and more to the model to make it complex enough. So viewing the developing phrase and after that, we use data, real data, and how we do that usually and during the developing phase for parameterizing and calibrating our model. For instance, in our example of school children, it could be looking at different servers for example, at your survey or enhance. And looking at them to determine what the frequency of having snacks during a day for a school children of that specific age that we are interested. And also, we can use data to validate, to make sure that our model is just simulating the same trend that we are looking for. So when you have our model then it's time to use our agent-based model. And the way that a typical agent-based model work is just, first of all you set up your whole word as we tend to call it in agent-based model. The word refers to agents and their environment. So we set up those elements. It could refer to attributes of agents, including age, gender, and their location. It could be referring to environment, including the map of the neighborhood. These are all examples of the setup phase. And for example, when we say that we want to initialize age, that means that our whole population is showing the same distribution of age as the real population that we are trying to simulate. And then when the whole population is ready, there is time for running. And basically, it's just a continuous loop that goes on and on, and during that simulation we have updating of different status of the agents, they have different activities. For example in our case, it's cool kids or agents might grow in size, they might move around, purchase food, go to party. And those are all examples of different activities that might be happening during the simulation phase. And while this is happening, we record what converter is interesting for us and when the simulation is paused or finished then we have a summary, a result we have results that we can use it for any statistical reasoning or a statistical analysis that we want.