 This lecture is on simulation programming language and other software tools for simulation. Welcome to the lecture. We know from our other lectures what we need to have in simulation programs. So that gives us the idea, well, okay, we know what the specs are that we need to ask for from any software tool that we're going to be using for simulation, right? Specifically, if we're doing, like in this course, we're doing discrete event simulation, any software tool that's going to be used for discrete event system simulation has to be able to model random phenomena. It has to be able to generate random numbers. It has to be able to generate random variants by sampling from particular probability distributions. A software tool for discrete event system simulation has to be able to move time. These simulations run over time. They're not static simulations. There has to be a simulated clock. We have to be able to ask for statistics at particular moments in time. And assuming that we're using the next event approach to managing time, which we just about always are. We have the software tool has to be able to manage a list of event notices, determine the next event to occur, pass control to the routine that's going to execute whatever has to be done at the time of that event. Remember, these are events in a discrete event system. The system changes at discrete points in time. Finally, we're going to need to be able to output statistics, including time statistics. And that's why it's special. Any program is going to have to output data. And will we want to output reports graphs table? Sure, maybe lots of times we do. But just about any program can probably do that. A statistic software in particular has to be able to accumulate statistics that change over time, time dependent statistics. Any simulation software tool is going to have some way of dealing with lists. If we're just using a general purpose programming language, that's going to be part of the data structures facility. If we're using something that's specially written for the purpose of simulation, there's got to be some list management in there. We have events waiting to occur. Those are stored in a list. We have entities waiting for service. We have entities who are in the system or in some sort of activity. They may be kept on a list as well. And the software has to be able to appreciate the correct ordering. Usually the event notice has time attached to it, time to occur. There's one way of ordering one of the lists that is used to manage events and the discrete event system simulation. Finally, we also have a need of error detection. And since we're talking about something that's specific to simulation, error detection can be done for items that are values that are specific to simulation. We could be looking for things that you can't look for in a general purpose language. You want your program to be able to detect logical inconsistencies, error conditions, certain things that shouldn't be there, a negative number of customers. You should be able to have errors that generate alerts and then are reported to the user. We know we have specialized languages and tools for building simulation programs. Do we need them? Can we just use general purpose languages like C++ or Python? Sure, why not? It means that there's going to be more work for the simulationist. But of course, there are a lot of libraries that are available for, let's say, simulation and C++ or discrete event simulation and Python. And depending on the point of view that you take, the worldview, are you using an event orientation or process orientation, you may have more than one library to choose from for particular language. Take a look at that table. It kind of highlights the differences. The general purpose language, this may not be true anymore, but up until the explosion of data science and Python, you might say modelers typically already know how to program. But then again, due to the explosion of STEM, Python and data science, modelers are also interested. They're also interested in learning how to program now. So, yeah, that might still be true. If you write your simulation program in, let's say, C++, which is a general purpose language that is a very efficient language. It's closer to the level of the machine, as opposed to on the left-hand side, something being more natural to use for simulation modeling. If it's closer to the level of machine, it will be a more efficient program, assuming that the programmer is a good programmer. So it could be a more efficient program. So that it'll run faster. Is that a consideration? It's a consideration if your simulation is very large and very heavy. And if it needs, it needs to be goosed. What some people do is they translate. They might develop the model in a more specialized language and then have a person or a team of people who translate it into a general purpose language. In a general purpose language, there's more programming flexibility. You can take the same program, run the simulation, have several runs of the simulation, and do statistical analysis at the same time. On the other hand, you see that there are more features on the left-hand side for specialized simulation software. It's easier to communicate with other modelers and even with non-modelers, users, supervisors. Very often there are animations, images that can be shown to explain what the simulation looked like or what the simulation did. It's most likely easier to validate the simulation again because you can see what it would look like and you can more easily look at it, oversee it, supervise it, watch it while it's running. And of course, if you're going to have a system that checks for typical errors, sure, why not use it? That'll obviously be better than not to have one. As you can already see, there are a lot of different languages and tools to use for discrete event simulation. In this lecture and even in this course, we're not going to go into any one piece of software in depth. There are a lot of different ways of doing that. There were a lot of choices. But what I'd like to do over the next few slides is give an overview of some of the better known devices and tools and also a historical review of how these things developed over time. So the history of simulation mirrors the history of digital computers or let's say electronic computers. Back in the 20th century, between 1955 to around 1960, the mathematical programming language of choice was Fortran. Simulation researchers shared, people shared things in those days, shared subroutines with each other, pieces of code that could be used for simulation and be part of your Fortran program or your Fortran library. Actually much the same way that you can download a library in Python or C++ today. Then the next interval between let's say 1960, 61 to 1965, there was an explosion of different languages and packages for simulation. There was SimScript, which was based on Fortran. There was Simula, which was based on Algal. The Algal was what you might call the European version of Fortran. Fortran was very popular in the States and Algal was very popular in Europe. And then a GPSS was a popular example of a package or a pre-packaged software tool that wasn't a general purpose language like SimScript or Simula. Between 66 and 1970, the simulation programming approaches and languages matured. There were still a lot of development going on, but much of it had to do with adapting to changes in the hardware rather than creating new innovative pieces of software. Because there wasn't that much that needed to be innovated in that area, maybe more efficiency, certainly adapting in this case the IBM 360 to large mainframe type of computer. Same thing a few years later when the development companies adapted simulation programming to small computers, to desktops, mini computers, and so on. In 1980s, approximately, you had the explosion of what was then called microcomputers. And all the languages and software tools that were developed for mainframes were then redeveloped for the smaller computers. And as we know, as computers got smaller and smaller, their storage capacity actually got larger and larger, so it wasn't really much of a sacrifice. Then in the decades approximately between 1987 and 2008, that was the age of integrated environments in a lot of different areas. So it wasn't only a simulation tool or a simulation language, the language was embedded in part of a larger environment with a GUI desktop, web-based tools, visualization tools, graphics, and animation. And then we continue to this day with further development in large-scale simulation. I'm only going to take a couple of examples of it, but in some ways it's changed the course of simulation because many people use the term simulation to refer to different things nowadays. Agent-based simulation, a lot of simulation research that's going on now is on agent-based simulation and also the second item on micro simulation. Agent-based simulation is an individual-based modeling approach where we're looking at what does an individual entity do and what is the activity it takes part in? How does it interact with other individuals in the network? And these things all have an effect on the system as a whole. The micro simulation is a little bit similar, except that we don't look at interactions between individual entities. Micro simulation is very, very much used for policy. When there's a simulation regarding policy, it's most likely to be micro simulation. Simula was developed as a simulation language based off of ALGOL for the Univac computer, which was a very early commercially available electronic digital computer. Similar to the way that SimScript was developed by the RAND Corporation, based off of Fortran, and I'm pretty sure it was originally developed for the IBM 360. If not, it very, very quickly morphed into that. Simula was definitely not only the first real simulation package. I shouldn't say that because SimScript was also, but you'll see what I mean in a minute. Simula was composed of objects that could interact, classes and inheritance, much like any object-oriented language today. It had almost everything that an object-oriented programming language like C++ has, except it didn't have what we call methods. So the descriptions of the objects were static rather than also being dynamic. And still you can see where the object environment is an excellent environment for building simulations where you do have things that interact in some way. And it's nice to have objects, objects have attributes, they have data, and they can inherit from other objects just to make the coding easier. Why is all this interesting? It's interesting because of the effect that all of this had on what we do today. Simula was used to develop the language called Smalltalk, which was used for simulation. It was developed at Xerox PARC, their research center. And Smalltalk ultimately influenced the development of C++, which then is the granddaddy of all object-oriented programming, meaning just about every programming language we use today. That's the software side. On the other side, which is it's also software, but it feels more like hardware to us when we're looking at the way our desktops, our GUI desktops are configured. I guess we're looking at the environment. Smalltalk had everything we see that we think of as the desktop. It had icons. It used a pointing device. I don't remember if it was a mouse or a joystick. At one point, you could click. When you clicked, it opened up a routine. This was a routine that was waiting to be done until somebody clicked. It's almost like an event routine in a simulation. Why do I have 1979 Steve Jobs over there? Because the folks at Xerox PARC did this research. I developed this language, Smalltalk, that had both the GUI desktop and the object-oriented programming for simulation purposes. And they had a visit from Steve Jobs of Apple fame, innovative guy. And they made him wait. He wanted to see what they were doing. They were happy to show him, but they wanted to make sure they were allowed to because it was Xerox and it was proprietary. And one of the more interesting stories in the history of programming is how Xerox handed over the GUI desktop to Steve Jobs because they didn't feel it was worth anything. And at some point, you should look this up. I probably should put the source in this lecture or maybe I'll put it in the comments. There's an article that talks about this. But at some point, the folks at Xerox said, oh, okay, fine, let him in. You can show it to him. We don't care. We don't need it because we copy paper. We have copiers and if we can't figure out the revenue that something's going to give us because it doesn't translate to number of pennies per page, then it's not useful to us. That's their business model. They didn't want to hear anything else. So Steve Jobs came in and they showed him around. They were all very, very happy to show him their work. And he said, you know what? You can keep the small talk. I don't need that. All I want is the desktop. And that GUI desktop eventually was built into the Lisa after that, the 1984 Mac and then the rest is history because non-Apple devices had to have it too. And so the Windows desktop was developed because of that as well. Nobody uses desktops that are not GUI anymore, that are not graphical. If anybody wants to know an example of what the desktop was before, all you have to do is ask somebody about MS-DOS. No one was really very happy with it. You should have in your vocabulary and it should be on your radar some of the better known and widely known simulation languages and tools. One very powerful one is SimScript. SimScript can be used for anything. It's a regular general programming language and it also has specialized simulation tools. And as we talked about, it was developed from Fortran originally. And it was developed by the Rand Corporation under a fellow by the name of Harry Markowitz who you might know from his work on portfolio theory which earned him a Nobel Prize. And interestingly it was sponsored by the U.S. Air Force. And I mentioned that because a lot of the work on computers, on software systems and on simulation in particular and certainly on networks was sponsored by the military for their own needs and then eventually it became the domain of the world at large. There are, if you're a person who is actually going to be learning or working with SimScript, the way to learn it is by thinking of it in terms of levels, even though it has five levels but still levels one through three. What you might call general programming that you can use for any program you write. Level four has to do with data structures and if anybody here wants to learn data structures really well, pick up a little SimScript because it has the most free form and yet extensive data structures vocabulary ever. It's in terms of the data structures of coding is not difficult to see, it's not difficult to read, it's in terms of entities, attributes, lists, English, it's exactly the way you might describe data structures in conversation. And then finally, level five are the things that are specific to simulation, the timing routine, the clock, random variables, events and so on. Dynamo and languages based off of Dynamo is considered a language for systems dynamics modeling and it's deterministic, not stochastic generally. It looks at aggregates, it looks at its continuous simulation flow, it's used for population systems where you want to see a change in large population systems over time, economic systems, urban dynamics. And in fact, a lot of the micro simulations, I think have a debt to systems dynamics modeling they do it differently. But the end result very often looks a little bit the same arena is a very easy to learn graphical language software tool for simulation. It does some animations. The graphics show the model flow so it's easy to explain to people. And on the website of this course, there are some notes and pointers under the the software heading on arena, a little bit kind of quite extensive more than we have for other languages. There are very, very highly specialized software tools for simulation in particular application areas, like healthcare manufacturing communication networks. GPSS I list here mainly because I want this is the area where I want you to get used to the names of of well known simulation languages whether you're using them or not. GPSS doesn't seem to be used much anymore. It's hard to find. It may even be it may not be supported and in any of its configurations. But for a long, long time it was the go to simulation tool. And at some point IBM stopped offering it and I think IBM only supported it for a mainframe and other smaller companies arose to the to the challenge and developed it for smaller computers but it didn't then it it somehow petered out. It had a good it had a good show for a good long time. In this lecture, we have looked at simulation languages and software tools. We have looked at what should be in these tools what are the specs what do we desire what do we need in order to do simulation modeling. We have looked at the historical perspective, the important languages over a timeline. We looked at this very briefly, you will be able to find if you try more detailed and involved timelines, specifically at the winter simulation conference, which is the major conference in simulation. And finally, where we discussed what you might call the language the vocabulary of simulation in terms of the specialized simulation programs, and what you would be expected to know if you are a simulation model. Thank you for attending my lecture.