 So, I'm Christophe. You can find me on Twitter, ETA, whatever. I'm from a country which is probably the most lighted in the world, which is Belgium. So, yeah, I like beers. I like waffles. I like chocolate. And I have a little gift for you. So, if you like chocolate, come to talk to me after. And I will give you one. Get a bite. So, I'm a member of the Ruby-Belgium Association. I run several events there, like Wales Girls, also the conference, our camp. And if you can come in January in Belgium, there's the FOSDEM. There's a Ruby Dev Room gathering all the implementers of rubies, like JRuby, MRI and so on. Very interesting. So, come see us. I'm the founder of full review and automated code review service for Ruby in Wales. You should try. And aside, I'm still doing freelancing in order to develop simulations of disease for pharmaceutical companies. And I would like to share a little bit about that today. So, at first, a few cases of rare disease were reported in a local newspaper. A kind of rubies pushing people biting others. It sounded like sensational news to feed the conspiratorists. Two weeks later, the disease was obviously very serious, contagious, mortal. The army has been taken actions, curfews were applied as quarantines. Some zones were totally condemned. The World Health Organization sent experts in order to help CDC and army. The epidemic must be contained. In this situation, your life will be at stake. You need to survive. But you're just a software developer. You can do. It's not like writing code will help you to survive. Or could you? Yes, I think you can prepare yourself against zombie epidemic with code. So, there are several techniques in order to simulate complex dynamics such as propagation of disease. When you want to get insights at the level of individuals, some base models are the right techniques to do that. But the application goes beyond disease. Of course, it is used to study the propagation of disease, especially outbreaks over the world. Like here, how the flu can propagate through flight airlines. It's also used to study their traffic and see what's the best configuration of flights and signalization to reduce it. It is used to understand the consumption of electricity and its impact on the grid and prevent outage and finding solutions to resolve them. To study the robustness of the backbone of the internet and find out where are the signal port of failures. To predict behavior of a group such as how people will buy on the stock market or how they will behave during a catastrophe. So, as you have probably noticed, it's really suited to the dynamic resulting of the interaction of same components. For instance, persons in a given environment. So, in order to simulate zombie, how they could spread. I need, for an agent-based model, I need agents. There are humans. I need an environment where they live and interact. And I need some rules of interactions. How they evolve and behave according to the environment. The other agents and themselves. So, let's start with the map, with the environment. So, zombies, they are really, they need to buy another person. So, they need to be in contact with them. And their move capabilities are reduced. So, the physical presence is very important. So, we will consider a very simple map where we can put the agents and locate them. And that will help us to consider different things like hiding inside and other situations and so on. So, let's keep it simple. Just a 2D grid sounds very simple for me. It's good enough. And then, we can structure it to define the neighborhood around the agents. So, when two agents are neighbors, they can interact, such as bite each other. We need to also define how the agents behave and its capabilities. So, the agent state is defined by its age, position and health state. During the simulation, the agent can do the following. It can perceive the surroundings. Is there someone just beside the agent? So, if it's a zombie, we'll need to find who are the same people so they can buy them. It can accomplish an action. In our case, we will consider only staying, walking or fighting. Walking will move the agent in a given direction. Staying will do nothing. And fighting is more a state where the agent is ready to fight or bite in the case of a zombie. So, you see here, just an agent walking around. I will do it again, sorry. So, it's just a 2 times 2 map and a walking life. It's the green square. So, an agent can age, become older. So, finally, the simulation consists in calculating the next new states of an agent based on its environment, the other agents and itself. The updates of the state can be done in different ways. We'll do a synchronous update. It's easier to understand and manipulate. So, basically, you will consider all the previous states of all the agents. And you will calculate the next one. And when every new states are calculated, you can commit them and replace the previous one. So, the agent states will necessarily include the health states. This part will determine how sick the person is. So, for instance, we have the state susceptible. It's when the agent is not immune to a disease and could be infected. For each state, we can define which action an agent can do. In our case, it can walk, it can fight, it can stay or it can fight. So, for a zombie, for instance, we will consider that it can just walk and fight. Thanks to that, the panel of possible action depends on the health state of the agent. We can also define a condition of transition from a state to another. In this case, the susceptible will be always infected without any reason. So, that's the transition. And when we'll trigger him, we'll go to a new state, which is the infected one. So, here you have four agents, two zombies, and two same agents. As you can guess, the zombie will bite them. So, in yellow, you have the infected. So, all of these will help us to define a state transition machine. This is basically what defines and handles all the possible transition between the different states. So, how does it work? It's a very simple graph. You have four different states, the susceptible here, infected, zombies, and really dead. So, susceptible are just same agents. Infected are the agents that have been bitten by a zombie. And then after a certain time, they transform, they become a zombie. And when they sometimes, when a zombie bites too much, they can kill a susceptible or infected agent. So, we go to the willy-dead. Or the susceptible or infected can fight back and so can kill the zombie and make it dead. So, the simulation is very simple. It's a whole loop. So, let's say we simulate for 100 days. We create all the agents. We put them on the map. And then each step, we do the following. Each agent acts and ages. Then each agent is updated to its new state. And then the deaths are removed. So, on a little grid of 10 times 10. So, you have different squares. The green are the same agents. The yellow are the infected ones. The red are the zombies. And the black are the death. So, I will show you quickly. So, that was the end of the world. Not very bright. I don't want to be in that case. Especially in that case is because the people are not really good at fighting back. But then you can have the weak steam. It's kind of a better situation. So, this one is better. The people are well trained to kill the zombie. And at the end, the last one. So, when the simulator is implemented, you still need to validate it and calibrate it. I will go quickly on that. It's really about kind of functional tests. You know some outcomes in certain cases. Like a very simple one. You know that you have only susceptibles. So, you know that they will be seen forever. So, when you run it on several simulations, you need to be sure that the proportion is always one. Or more complex cases that are covered by a theory. And you know the trends. And you run several simulations. And you check that the average, in average, you obtain the proportion that are expected. Then you have also calibration. It's in the case where you have some assumption over certain input. You don't know everyone's. And you know that you want a certain output. So, you will vary the input in order to obtain that output, which is called calibration. But it's a big part of the job. And so, for instance, to repair the torque, I did several calibrations according to some zombie models to obtain them. We'll see in the next. So, I will show you now live the simulator. So, what you have on the left side. So, this is the map. In blue, you have some obstacles. In red, you have zombies. In green, you have susceptibles. So, what I will do is activate different transitions live. So, you will see the change. So, for instance, here you have a transition that we want to define from susceptible to infected. What we do is that we check the position. If there's an agent on it. If it's a zombie. And if it's biting, fighting in that case. And in the half of the case, it will bite successfully the susceptible and infect them. As you see now, we have some infected agents. Then I will apply another rule, which is after a certain time, infected become zombies. So now when I will save, they will all become red. And we can continue like that. And define other rules. So, that one is, and the next one is about when zombie bite too much, they kill the agents. But I will run the simulation. So, you see sometimes you have some black squares. That correspond when the zombie goes too far. And maybe eat totally the person. And then maybe we can give a chance to the agents and help them to fight back. So, what we say is that when there's a zombie, if there's susceptible and infected person in the neighbors. And he's fighting. We have a 100 person chance to kill. And in that case, we can see some better outcome. As you see, some zombies are killed and so on. Bright future. So, let's check another example. So, I did a model for the walking dead disease. If you are interested, there are a lot of literatures about that. The best theory is that it's not when the zombie bites the person that infects them. In fact, it's probably an airborne disease. And everybody has it. And when he got a disease or serious damage, his immunity will be weakened. And because of that, the disease, the zombie disease will take over and the person becomes a zombie. So, the rules are really simple. We consider that we have everybody is infected. So, let's see that. So, as you see, everybody is infected by default. So, what we'll do first, we'll consider that it has invoked that they're really well trained to kill other zombies. So, that's that rule. Now, that's probably the beginning of the TV show. In half of the case, they can fight back. But for now, we don't have zombies. So, that's not really interesting. So, first, what we'll do, it's just very simple. One person of the case when the person gets a disease or an accident or just gets sick or gets bitten by a zombie and because the zombie bite is very problematic, it gets gangrenious. So, you see that spontaneously, you have some zombies appearing for different reasons. And we can also activate other rules, like when zombies will bite infected people or when the infected can be killed because it's too serious. So, that's probably the beginning of the TV show. As you see, like in Atlanta, everybody dies. But if we go to the end of the TV show with the rig teams, we have three people who will survive too late. But if there are more, maybe it's easier. So, that's it. I will just show you one last thing. So, that's another case where you put obstacles to try some strategy like quarantine. You see that the zombies are only on one side and the same one, the LC one on the other side. So, that's safe. So, it works. Poor guy. So, yeah, I think I'll show you how you can build yourself your own simulator of zombies and maybe prepare yourself to fight back to see what's best, probably run away. So, you can find the code on GitHub. Don't forget the chocolate. I don't bite. Thanks.