\documentclass[compress,red]{beamer}

% This file is a solution template for:

% - Talk at a conference/colloquium.
% - Talk length is about 20min.
% - Style is ornate.



% Copyright 2004 by Till Tantau <tantau@users.sourceforge.net>.
%
% In principle, this file can be redistributed and/or modified under
% the terms of the GNU Public License, version 2.
%
% However, this file is supposed to be a template to be modified
% for your own needs. For this reason, if you use this file as a
% template and not specifically distribute it as part of a another
% package/program, I grant the extra permission to freely copy and
% modify this file as you see fit and even to delete this copyright
% notice. 

\hypersetup{pdfpagemode=FullScreen} % makes your presentation go automatically to full screen

\mode<presentation>
{
  %\usetheme{Madrid}
  \usetheme{Warsaw}
  % or ...
  %\usetheme{Berkeley}   % left bar
  %\usetheme{Antibes} % tree header
  %\usetheme{Boadilla}  % very plain
  %\usetheme{Warsaw}
  %\usetheme{Rochester} % I like
  %\usetheme{Goettingen}  % right bar
  %\usetheme{Ilmenau}

\usecolortheme{lily}

  %\usepackage{beamerouterthemeshadow}
  %\usepackage{beamerouterthemesmoothtree}
  \usepackage{beamercolorthemeorchid}
  %\usepackage{beamerinnerthemerounded}
  \usepackage{beamerthemeshadow}
  \setbeamercovered{transparent}
  % comment out to completely hide covered material



  %\setbeamercovered{transparent}
  % or whatever (possibly just delete it)
}

\usepackage{wmff}

\usepackage[english]{babel}
% or whatever

\usepackage[latin1]{inputenc}
% or whatever

\usepackage{times}
\usepackage[T1]{fontenc}
% Or whatever. Note that the encoding and the font should match. If T1
% does not look nice, try deleting the line with the fontenc.


\title % (optional, use only with long paper titles)
{Object Oriented Modeling and Simulation}

\subtitle
{The OOSimL Language}

\author%[Author, Another] % (optional, use only with lots of authors)
{Dr. Jos\'e M. Garrido C.}
% \inst{1} 
% \and S.~Another\inst{2}}
% - Give the names in the same order as the appear in the paper.
% - Use the \inst{?} command only if the authors have different
%   affiliation.

\institute[Kennesaw State University] % (optional, but mostly needed)
{
  %\inst{1}%
  Department of Computer Science\\College of Computing and Software Engineering\\
  Kennesaw State University
%  \and
%  \inst{2}%
%  Department of Theoretical Philosophy\\
%  University of Elsewhere
}
% - Use the \inst command only if there are several affiliations.
% - Keep it simple, no one is interested in your street address.

\date % (optional, should be abbreviation of conference name)
{Fall, 2017}
% - Either use conference name or its abbreviation.
% - Not really informative to the audience, more for people (including
%   yourself) who are reading the slides online

\subject{Applied Computer Science, Simulation}
% This is only inserted into the PDF information catalog. Can be left
% out. 



% If you have a file called "university-logo-filename.xxx", where xxx
% is a graphic format that can be processed by latex or pdflatex,
% resp., then you can add a logo as follows:

\pgfdeclareimage[height=0.17in]{university-logo}{ksu-1.png}
\logo{\pgfuseimage{university-logo}}



% Delete this, if you do not want the table of contents to pop up at
% the beginning of each subsection:
%\AtBeginSubsection[]
%{
%  \begin{frame}<beamer>{Outline}
%    \tableofcontents[currentsection,currentsubsection]
%  \end{frame}
%}


% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command: 

%\beamerdefaultoverlayspecification{<+->}


\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%\begin{frame}{Outline}
%  \tableofcontents
  % You might wish to add the option [pausesections]
%\end{frame}


% Structuring a talk is a difficult task and the following structure
% may not be suitable. Here are some rules that apply for this
% solution: 

% - Exactly two or three sections (other than the summary).
% - At *most* three subsections per section.
% - Talk about 30s to 2min per frame. So there should be between about
%   15 and 30 frames, all told.

% - A conference audience is likely to know very little of what you
%   are going to talk about. So *simplify*!
% - In a 20min talk, getting the main ideas across is hard
%   enough. Leave out details, even if it means being less precise than
%   you think necessary.
% - If you omit details that are vital to the proof/implementation,
%   just say so once. Everybody will be happy with that.

%\section{Implementing A Simulation Model}

\begin{frame}{Simulation Software (Review)}

Implementation of a simulation model can be accomplished with a general-purpose high-level programming language, however, it is much easier and convenient to use some type of simulation software. The various levels of simulation support software are: 

\begin{enumerate}
\item
A general-purpose (object-oriented) programming language, such as C++ and Java
\item
A simulation package or library, such as PsimJ2, Silk, and Simjava, Psim3. These are used with a general-purpose programming language 
\item
An object-oriented simulation language, such as OOSimL and Simscript III
\item
An integrated simulation environment, such as Arena, FlexSim, Simul8, and ProModel.
\end{enumerate}
\end{frame}

\begin{frame}[fragile]{The OOPsim Project}
  \begin{block}{Goals}
\begin{itemize}
 \item 
 Investigate and develop new simulation \textcolor{red}{tools and approaches} for education
 \item
 Promote  construction and use of \textcolor{blue}{simulation models} in various areas of computing (including {\em Information Security})
 \item
 Provide \textcolor{red}{free access} to the simulation software and several of the simulation models: 
\vspace{.2in}
{\small
%\begin{verbatim}
\url{ksuweb.kennesaw.edu/~jgarrido/psim.html} 
%\end{verbatim}
}
\end{itemize} 
\end{block}
\vspace{.15in}
The project has received support from Epscor, CSIS department, Yamacraw, and recently from NSF.
\end{frame}

\begin{frame}{OOPsim Tools Developed}
\begin{itemize}
 \item 
Started in 1996 with the object-oriented Psim simulation package in C++
\item
Enhanced in 1999 and evolved to \textcolor{blue}{Psim2}
\item
Re-implemented in Java in 2000 and named \textcolor{blue}{PsimJ}
\item
A new version of Psim2 (C++) was redesigned using POSIX Pthreads in 2003, named \textcolor{blue}{Psim3}
\item
\textcolor{blue}{PsimJ2} was developed in 2004, an extended version of PsimJ
\item
The {\bf\textcolor{red}{OOSimL}} simulation language was developed in 2009 with support of an NSF CPATH grant
\end{itemize}
\end{frame}

\begin{frame}{OOSimL Logo}
%\vspace{.1in}
\begin{figure}[h]
%\vspace{.1in}
\includegraphics[width=4.6in]{figs/oosiml.png}
%\caption{First phase of compilation of an OOSimL program}
%\label{fig:oostran}
%\vspace{0.1in}
\end{figure}

\end{frame}


\begin{frame}{Brief History of Object Oriented Simulation}
 \begin{block}{Simula}
\begin{itemize}
\item
The \textcolor{red}{SIMULA} language was developed by Ole-Johan Dahl and Kristen Nygaard at the Norwegian Computing Center (NCC) in Oslo around 1962. 
\item
Simula was the first language to introduce the concepts of \textcolor{blue}{classes} and \textcolor{blue}{objects}. The language also introduced the idea of prefixing and subclasses.
\item
The key concepts have evolved since then and have been implemented in most modern OO programming languages.
\end{itemize}
\end{block}
\end{frame}

\begin{frame}{Simula and Demos}
\begin{itemize}
\item
\textcolor{blue}{Demos} was developed by Graham Birtwistle in 1979 and extends Simula
\item
The Demos package added more powerful simulation facilities to the Simula language. 
\item
Simula and Demos have not become widely used, despite the significant contribution to object orientation and simulation.
\end{itemize}
\end{frame}


\begin{frame}{Smalltalk}
\begin{itemize}
\item
In the early 1970, Alan Kay and his group at Xerox PARC used Simula as a platform for their development of \textcolor{blue}{Smalltalk}.
\item
Their development extended object-oriented programming importantly by the integration of \textcolor{blue}{graphical user interfaces} (GUI) and interactive program execution.
\end{itemize}
\end{frame}

\begin{frame}{C++ and Other Languages}
  \begin{block}{C++}
In the mid 1980's, Bjarne Stroustrup started his development of \textcolor{blue}{C++} by bringing the key concepts of Simula into the C programming language. 
\end{block}

 \begin{block}{Other OO Languages}
Other object-oriented programming languages such as \textcolor{blue}{Eiffel}, CLOS, Java, and others, were also influenced by Simula.
\end{block}
\end{frame}




\begin{frame}{Motivation for Language Development}
\begin{block}{The Language}
OOSimL is an experimental simulation language for \textcolor{blue}{research and education} in discrete-event simulation modeling using the object-oriented and process oriented approaches. 

\vspace{0.15in} 

Its general goal is to reduce the difficulty and complexity of implementing object-oriented simulation models
\end{block}
\begin{block}{Target Audience}
The language was developed mainly for \textcolor{blue}{students} of computer science, software engineering, and related disciplines.
\end{block}
\vspace{0.45in}  
\end{frame}

\begin{frame}{The OOSimL Language}
\begin{block}{Goal}
The language emphasizes object oriented modeling and programming, multi-threading, and promotes an early introduction to simulation in the curricula. 
\end{block}
\begin{block}{Influences}
The language design was influenced by Simula, Eiffel, Ada, Java, C++, and the Demos simulation package.
\end{block}
\end{frame}


%\vspace{0.45in}  


\begin{frame}{General Method for Model Development}
\centering
\includegraphics[width=3.0in]{validmod.png}
\end{frame}

\begin{frame}{OOSimL Language Features}
\begin{itemize}   
\item
 Supports object orientation
\item Supports the \textcolor{blue}{process style} of discrete-event simulation that facilitates the teaching and learning of modeling and simulation of large and complex systems. 
\item
Helps promote and support \textcolor{blue}{{\em early introduction to simulation\/}} in the computing curricula.
\item
 Promotes the application of object-oriented simulation in \textcolor{blue}{{\bf industry}}; it provides a viable and short transition to current commercial simulation (programming) languages such as Simscript III.
\end{itemize}	 
\end{frame}

\begin{frame}{General Language Statements}
The language includes the following general types of language statements:
\begin{itemize}
\item 
Definition of classes for passive objects needed by processes.
\item 
Definition of classes for processes.
\item 
Starting of a simulation run for a predetermined simulation period.
\item 
 Definition of queues.
\item
 Definition of resource pools and other passive objects.
\item
 Generation of random numbers, each with its probability distribution.
\end{itemize}
\end{frame}

\begin{frame}{The Output of a Simulation Run}
 \begin{block}{ Text Files}
\begin{itemize}   
\item
 The complete simulation trace
\item
 The summary statistics and performance metrics. 
\end{itemize}
\end{block}
 \begin{block}{Other Output}
The other types of output will usually be the various GUI boxes and graphical animations that the model implementation include.
\end{block}
\end{frame}

\begin{frame}{Downloading OOSimL Files}
The OOSimL simulation translator, libraries, documents, and sample models can be dowloaded from the Web site:
  \vspace{.3in}
{\small
%\begin{verbatim}
\url{ksuweb.kennesaw.edu/~jgarrido/oosiml.html} 
%\end{verbatim}
}
 %\vspace{.1in}
\begin{itemize}
\item For generating Java code:
download the archive file: {\bf\textcolor{red}{{\tt oosiml.zip}}}

\item For generating C++ code:
 download the archive file: {\bf\textcolor{red}{{\tt oosimlc.zip}}}
 \item Additional document files are also available in the web page.
\end{itemize}
\end{frame}

\begin{frame}{The OOSimL Software}
 The simulation software consists of two sets of components: 
\begin{enumerate}
\item For generating Java code:
\begin{enumerate}
\item the compiler, which is an executable program named \textcolor{red}{{\tt oosiml.exe}}
\item the run-time library, {\bf\textcolor{red}{{\tt oosimlib.jar}}}. 
\end{enumerate}

\item For generating C++ code:
\begin{enumerate}
\item the compiler, which is an executable program named {\bf\textcolor{red}{{\tt oosimlc.exe}}}
\item the run-time library named {\bf\textcolor{red}{{\tt oosmlibc.a}}} and the header files.
\end{enumerate}
\end{enumerate}
\end{frame}




\begin{frame}{The OOSimL Compiler}
The OOSimL compiler has the following functions:

\begin{enumerate}

\item
Syntax checking of a source program in OOSimL; a list of errors is displayed and written to an error file with the same name as the source program

\item
Generation of an equivalent program in Java or in C++

\end{enumerate}
\end{frame}

\begin{frame}{Developing OOSimL Models}
Currently, there are three general procedures used for developing programs and simulation models with the OOSimL compiler:

\begin{enumerate}

\item
Developing the simulation model with the \textcolor{blue}{Eclipse} integrated development environment.
\item
Working with the \textcolor{blue}{jGRASP} integrated development environment (IDE). 
\item
Working in a \textcolor{blue}{Command} window.
\end{enumerate}
\end{frame}

\begin{frame}{The First Phase of OOSimL Compilation}
 The first phase involves a translation into an equivalent Java or C++  program.


%\vspace{.1in}
\begin{figure}[h]
%\vspace{.1in}
\includegraphics[width=4.5in]{figs/oostranc.png}
%\caption{First phase of compilation of an OOSimL program}
%\label{fig:oostran}
%\vspace{0.1in}
\end{figure}
\end{frame}


\begin{frame}{The Second Phase of OOSimL Compilation}
 When Java code is generated, the second phase involves the corresponding Java compilation to Java byte-code. 
 
\vspace{.1in}
\begin{figure}[h]
%\vspace{.1in}
\includegraphics[width=4.25in]{figs/javam.png}
%\caption{Compiling a Java source program}
%\label{report}
%\vspace{0.1in}
\end{figure}
\end{frame}

\begin{frame}{The Second Phase of OOSimL Compilation}
 When C++ code is generated, the second phase involves the corresponding C++ compilation and linking with the {\em oosimlc} and  the {\em pthread} libraries. 
 
\vspace{.1in}
\begin{figure}[h]
%\vspace{.1in}
\includegraphics[width=4.0in]{figs/cpplink.png}
%\caption{Compiling and linking a C++ program}
%\label{fig:javac}
%\vspace{0.1in}
\end{figure}
\end{frame}

\begin{frame}{Running the OOSimL/Java Program}
 The Java virtual machine (JVM), which is another software tool from Oracle,  carries out the interpretation of the program in bytecode.
 
\vspace{.1in}
\begin{figure}[h]
\includegraphics[width=4.0in]{figs/jvm.png}
%\caption{Executing a Java program}
%\label{fig:jvm}
\end{figure}
%\vspace{0.1in}
\end{frame}

\begin{frame}{OOSimL and Java}
\begin{block}{}
\begin{itemize}   
\item
Programs written with OOSimL can be easily integrated with Java programs.
\item
Any Java library can directly be accessed by a model written in OOSimL. 
\item
The OOSimL language supports the reuse of Java components. 
\item
The run-time library of this language is a collection of Java classes.  
\end{itemize}
 \end{block}
\end{frame}

\begin{frame}{OOSimL and C++}
\begin{block}{}
\begin{itemize}   
\item
Programs written with OOSimL can be easily integrated with C++ programs.
\item
A C++ library can directly be accessed by a model written in OOSimL. 

\item
The run-time library of this language is a collection of C++ classes.  
\end{itemize}
 \end{block}
\end{frame}



\begin{frame}{Conceptual Model}
\begin{figure}
%\centereps{3.5in}{2.86in}{tconceptm.png}
\centering
\includegraphics[width=3.35in]{figs/tconceptm.png}
%\caption{Conceptual Model}
%\label{fig:tconceptm}
\end{figure}
\end{frame}

\begin{frame}{About OOSimL}
\begin{itemize}
\item
The OOSimL language supports not only object orientation but also the conceptual frame-work of the process style of discrete-event simulation. This facilitates modeling and simulation of large and complex systems. 
\item
OOSimL helps reinforce the ability to carry out object oriented modeling and apply software development principles learned previously.
\item
The following sections include an overview of the main features of the OOSimL language, a brief description of the language translator, and an example of a OOSimL program developed in Eclise. 
\end{itemize}
\end{frame}

\begin{frame}{The OOSIML Translator}
\begin{itemize}
\item
The OOSimL language translator is an executable program that is implemented as a one-pass language processor that generates Java or C++ source code. 
\item
The translator is actually a C++ program that has been compiled (and linked) on Linux and Windows. 
\item
The generated code can be integrated conveniently with any Java or C++ library. The general block diagram of the OOSimL translator is shown in the next figure.
\end{itemize}
\end{frame}



\begin{frame}{More on Translation}
\begin{itemize}
\item
After the OOSimL translation, the next steps in program development are the standard Java and C++ steps of compiling, linking, execution, debugging, and so on. 
\item
Eclise is one of the  freely available and most widely known IDEs for program development. 
\item
Kevin Sealy has developed a plugin for Eclipse to improve the editing and manipulation of OOSimL source code and to integrate the editing and translation of OOSimL programs with the rest of the program development stages. 
\end{itemize}
\end{frame}

\begin{frame}{General Program Structure in OOSimL}
The general structure of a class definition in OOSimL is: 

{\tt \footnotesize
\begin{algorithm}
{\bf description} 
\ \ \ . . . \\
{\bf class} $\langle${\em class\_name} $\rangle$ {\bf is} \\
\ {\bf private} \\
\ \ \ data declarations (attributes) \\
\ \ \ object reference declarations \\
\ \ \ function definitions \\
\ {\bf public} \\
\ \ \ data declarations (attributes) \\
\ \ \ object reference declarations \\
\ \ \ function definitions \\
{\bf endclass} $\langle${\em class\_name} $\rangle$ 
\end{algorithm}
}
\end{frame}

\begin{frame}{General Program Structure of a Function}
The general structure of a function (or method) definition is:

%\vspace{0.1in}
{\tt  \footnotesize %\small
\begin{algorithm}
{\bf description} 
\ \ \ \ . . . \\
{\bf function} $\langle${\em function\_name} $\rangle$ {\bf is} \\
\ \ {\bf constants} 
\ \ \ \ . . . \\
\ \ {\bf variables} 
\ \ \ \ . . . \\
\ \ {\bf object references} 
\ \ \ \ . . . \\
\ \ {\bf begin} 
\ \ \ \ . . . \\
{\bf endfun} $\langle${\em function\_name} $\rangle$  
\end{algorithm}
}
\end{frame}

\begin{frame}{Generating C++ Programs}
For generating C++ programs, the general structure of a OOSimL program includes the following sequence of steps:
\begin{enumerate}
 \item Import the necessary header files
 \item Forward references: function prototypes and class list
 \item Global declarations: constants, variables, and object references
 \item Class specifications
 \item Implementations: classes and non-member functions
 \end{enumerate}
\end{frame}

\begin{frame}[fragile]{Examples of OOSimL Programs}
Complete examples of OOSimL programs for generating Java and C++ code, the complete software, which includes the compiler, runtime libraries and several examples, can be downloaded from the Psim Web page:
{\tt \small
\begin{verbatim}
http//ksuweb.kennesaw.edu/~jgarrido/psim.html 
\end{verbatim}
}
\end{frame}

\begin{frame}[fragile]{OOSimL Class Specification Example}

{\tt \footnotesize %\small 
\begin{verbatim}
description
   This class computes the area and perimeter 
   of a triangle, given its three sides.
   */
class Triangle inherits Genfig is
  private
  variables
      define x of type double   // first side 
      define y of type double   // second side
      define z of type double   // third side
  public
  description
      This function sets values for the three
      sides of the triangle.      */
  function initializer parameters a of type double, 
                  b of type double, c of type double
\end{verbatim}
}
\end{frame}

\begin{frame}[fragile]{OOSimL Class Specification Example}

{\tt \small 
\begin{verbatim} 
  description
    This function computes the perimeter of a 
    triangle. */
  function perimeter return type double 
  description
     This function computes the area of a 
     triangle.     */
  function area return type double
endclass Triangle
\end{verbatim}
}
\end{frame}

\begin{frame}[fragile]{OOSimL Class Implementation Example}

{\tt \small 
\begin{verbatim} 
class body Triangle inherits Genfig is
  description
      This function sets values for the three
      sides of the triangle.      */
  function initializer parameters a of type double, 
                  b of type double, c of type double 
				  super using a
				  is
  variables
      define j of type integer
  begin
      set j = 3
      set x = a
      set y = b
      set z = c+j
  endfun initializer
\end{verbatim}
}
\end{frame}  
  
\begin{frame}[fragile]{OOSimL Class Implementation Example}

{\tt \small 
\begin{verbatim} 
  description
    This function computes the perimeter of a 
    triangle. */
  function perimeter return type double is
  variables     
       define lperim of type double
  begin                          
       set lperim = x + y + z
       return lperim
 endfun perimeter
\end{verbatim}
}
\end{frame}   

\begin{frame}[fragile]{OOSimL Class Implementation Example}

{\tt \small 
\begin{verbatim} 
  description
     This function computes the area of a 
     triangle.     */
  function area return type double is
  variables
       define s of type double    
       define r of type double
       define larea of type double
  begin
       set s = 0.5 * (x + y + z)
       set r = s * (s - x)*(s - y)*(s - z)
       set larea = call sqrt using r
       return larea
  endfun area
endclass Triangle
\end{verbatim}
}
\end{frame}

\end{document}