[MUSIC] Do you know this man? It's Carl Adam Petri. He is a very famous computer scientist. He was 30 years old, only, when he invented Petri nets. And that's the first time that circles and squares and arrows were used to model processes. When he invented them, he was thinking about chemical processes. I guess he was in high school and he learned about solutions in which there were different chemicals that when you combine them, produce different other chemicals. And then he thought of these actors that could combine and produce different kinds of tokens in the buffers, and the buffers would be different chemicals. Later in his PhD thesis, he started to using it for computer science purposes. And that's how most computer scientists know these pictures. Whenever you draw boxes and circles like this, I think 99% of the computer scientists will immediately interpret it as a Petri net, even if you tell them otherwise. But okay. So the crucial definition of a Petri net, what makes it a Petri net and not just a consumption production system is that the actor consumes exactly one token along every incoming arrow. And along every outgoing arrow, it produces one token. This is the animation that comes with that. Two tokens come in one along every arrow and three tokens go out, one along every arrow. So now you know that. Let's have a look at the five different systems that we use as examples so far. Which of these five systems is a petri net? Well, I hope you've got it right, I hope you got C the wireless LAN system. In that one along every arrow exactly one token is consumed and produced every time. Maybe, you've been thinking about B and E as well. But if you look at B then you would see that there is in the upper corner here, the call nurse, and the send nurse home. That one does not adhere to the Petri net law because there is only one arrow, but there are four tokens produced every time. And there are also four tokens consumed every time a nurse is sent home. And in the robot, in the refined example of the robot, the mixer and the centrifuge, they consume and produce, well the mixer consumes two tokens at a time and produces one, and the centrifuge consumes one token at a time, and produces two. So those are not Petri nets, technically speaking. And then if you look at the printer and at the rogue and the other model of the robot, you can look at these two actors. They also do not behave according to Petri's Law. Because the pick paper actor consumes one token, but it only consumes one token from one of the three buffers and not from every buffer. And the same, the robot, the move part actor consumes one token from one of the places and puts it in one of the other places. But not from each of the places. So, those are not Petri nets, either. There is a special remark to be made. Because if you look at this system, then you see that there is actually three arrows going from one place to the actor. And that means that there are three tokens consumed from that place. And, from the other place, there are two tokens consumed if it would fire. It cannot fire now because there's only one token there. And the same for the outgoing arrows. There's three arrows going out to one buffer, so that means that three tokens will be placed in that buffer. So, you can model the idea of multiple tokens being consumed from the same buffer. If you would invent a shorthand for that, then you would get what is now called a multirate Petri net, with numbers along the arrows telling how many tokens are consumed and produced. So it's still just as expressive as an ordinary Petri net. You just write down having multiple arrows in a more concise way. Now if you look at it like that, then the example of the nurse becomes a Petri net. A multirate Petri net, because the force they are now allowed to be there. And the same holds for the second row of the example. You can now just write I want two productions and two consumptions at one go. So now you know what the definition of a Petri net is. And this is where I could stop the lecture. But I still want to point out two special kinds of Petri nets to you. And these are the following. If you have a Petri net in which the actors only have one incoming and one outgoing arrow, then the token will always follow a certain path which is then dictated by which actor fires. In this system especially if there's only one initial token, that initial token can for example, model in which state the system is, and the actors model how the state changes when something happens. These are called automata, or state machines, and usually they are drawn in a slightly different way because the actors actually are a bit redundant in this picture, so you can leave them out. Now dually you can do the same trick if you have a Petri net in which the buffers only have one incoming and one outgoing arrow. Then you get a system that is actually more like a streaming system. There's still synchronization happening because actors can still synchronize the incoming tokens from different other actors in that case because, well, the buffers are redundant. Such a system is called a dataflow graph and if you would consider multi-rate Petri net and you would treat them this way, then you would get a mult-rate dataflow graph. In which actually have numbers here and there as well to model the amount of consumption and production by each of the actors along this arrow. These dataflow graphs, especially single rate dataflow graphs for this lecture series, are important for performance analysis. Petri nets are not all powerful. You cannot model everything using a Petri net. There are examples of systems that you cannot capture in this way. So what I would like you to do is first of all, think of your own examples, your own favorite examples of production consumption systems. And think about whether you could refine them until they give a Petri net as a behavioral description. And if you cannot do this, why not? What is it that limits you to define a system as if it is a Petri net? If you can, very nice because that means that you're open for more analysis. And also I would like you to dive into literature and to see what things more you can find that you cannot model using Petri net because finding out what you cannot do with it actually also gives you a good feeling for what you can do with it. Good luck. [MUSIC]