Stochastic System Simulation SE 405 Lab manual PART A- WORKING WITH AWESIM 2.0 The following is the Main menu of the Awesim 2.0 package. This is also the screen for the projects. Select the File button to view its option and select New option to create a new Project. Else select Open option to open an existing project. Once you have given a name to your project the gray shade in all the options of the screen will be accessible. The two major components that are required by Awesim are the Network and the Control. Both can be seen on the screen above. Select the Networks button to create a new Network. This option will open the following window. Write the name of the network in the Select Network option and click New if you are creating a new network. If you have some old networks already the list will be displayed in the Available Networks option. Therefore, if you like to open an existing options select the network from the Available network and press Open button. A new screen for the building the network is opened as follows. We can see another small window within the window for building the Network. This window has the list of all the nodes available in the Awesim 2.0 in alphabetical order. We select the node as required. For example if we need to select a CREATE node we scroll down the options and select the CREATE node. The selection will now clear this window and requests the user to select a position on the network builder to place it. Once a position is clicked on the screen the corresponding window as per the node selected is displayed. As per our example the following window is opened for the CREATE node. Fill all the details required by this menu and press OK to paste on the Network screen. The CREATE node details are filled and the network screen looks like the following. In this manner all the necessary nodes are selected and place on the network screen. Once you are finished with placing all the networks on the screen press the Cancel button to clear the node selection window. The following screen shows a small network where few networks are connected to each other. Its now time to save the network we have just developed. Select the file menu and select the save option within this menu. This will ask for the file name and once provided with the file name the Network screen title bar changes from Network Builder – (untitled) to Network Builder – (File name), For our example as Network Builder – LAB1. The following screen shows the change from the previous screen. This confirms that the network is saved. From the File menu now select Exit to close this screen. Now go to the main menu of Awesim and then select the Networks option again. This time the screen looks like the following. Now we have the network LAB1 in the Available Networks option. Select that file and press Add button to make it appear in the Current Networks. Select OK to close the window. The main menu now has LAB1 under the Networks button as we have just added the networks created into the Current Networks option. The main menu should look like the following. Now we will consider the Control option. Select the Control option form the main screen of Awesim. The following window will be displayed. As we had done for the Network option select the New button if a new control file is to be generated or Open form the available networks. Now let us create a new control file with name Lab1 (The name can be different form that of the Network File name). The following screen for the Control Builder opens with the Screen title bar as Control Builder – (untitled). Each of the statements listed requires certain input from the user except for the NET; and the FIN; options. For example if we double click the GEN; statement the following screen is displayed. The required details are to be filled by the user. The instructor in the Laboratory will discuss the details of each of the Control Statements. After the above details are typed press OK. Now from the File menu of the Control Builder select the save option to save the Control file created. It will ask for the file name and once given the title bar of the Control builder will now read Control Builder – LAB1 as shown in the following screen. We can now close this screen by selecting Exit from the file menu of the Control Builder. As we had added the Network file after creating and saving it into the main screen of Awesim, we also need to make the Control file we created appear as well. Go back to the main screen of Awesim and select the Control option. Now as we have already created a control file the window appears with the file name in the Available Control(s) option as shown. Now select the file from the Available Control(s) option and then press the SetCurrent button first and then OK, to make the Control file created appear on the main screen of the Awesim 2.0. Now the main screen will appear as shown below with both the Network and the Control Files (both named LAB1 in our case). Now as we have provided AWESIM with the basic required files (Network and Control) we can run the model we have just developed. To run the model and generate report we now select the Report option. Under the report menu we select the Output.. option. This will display a small window, which appears as follows. Now we select the Summary button to obtain the report for the model report. If there were any errors found there will be no report generated. Rather the user will be provided with the statements pointing out the type of errors found. The errors will be displayed either occurred in the Echo report or the Intermediate report. To read the error we have to select again the Report option and then select either the Echo or the Intermediate button accordingly. If errors were found in either of the files please contact the Lab instructor and he will guide you in debugging the errors. If no errors were found the Awesim will generate a report for the model. The report will appear as follows for the example developed. ** AweSim SUMMARY REPORT ** Fri Sep 14 20:57:19 2001 Simulation Project : Single Server Modeler : Lab1 Date : 15/09/2001. Scenario : BASECASE Run number 1 of 1 Current simulation time : 198.000000 Statistics cleared at time : 0.000000 ** FILE STATISTICS REPORT for scenario BASECASE ** File Label or Average Standard Maximum Current Average Number Input Location Length Deviation Length Length Wait Time 1 QUEUE QUEUE 0.000 0.000 0 Event Calendar 2.000 0.000 2 1 0 1 0.000 3.882 ** SERVICE ACTIVITY STATISTICS REPORT for scenario BASECASE ** Activity Label or Server Entity Average Standard Number Input Location Capacity Count Utilization Deviation 0 Line 4 1 0 0.000 0.000 Activity Current Average Maximum Maximum Number Utilization Blockage Idle Time Busy Time or Servers or Servers 0 0 0.000 2.000 0.000 Part B of this manual will provide with all the functions of all the main menus and the sub menus available in Awesim. PART B – Functions of Menu Items PROJECT MENU Commands File Menu Build Menu Simulate Menu Animate Menu Report Menu Graph Menu Options Menu Utilities Menu Help Menu FILE opens and saves project files. Help is available for the File Menu options: File New File Open File Save File Save As File Exit File About The FILE NEW option initializes a new project under the name specified. The FILE SAVE option preserves the current project under the name it was opened with. The FILE SAVE AS option preserves the current project under the new name specified. The FILE EXIT option leaves the AweSim! Executive Window and returns to the MSDOS Executive Window. The FILE ABOUT option provides information regarding the AweSim! version installed. Build Menu Help BUILD allows model components and scenarios to be constructed and modified. This option also may be used to specify which model components are currently selected for model execution and output analysis. Help is available for the Build Menu options: Build Network Build Control Build User Insert Build Note Build Animation Build User Data The BUILD NETWORK option is used to construct graphical networks with AweSim symbols. The dialog box which appears when this option is selected contains a number of choices. The ADD and REMOVE command buttons which appear in the dialog box when this option is selected are used to define the networks which are currently active when saving scenarios and creating customized executables. A network is added to the current list by selecting it from the available list and clicking on ADD. A network is removed from the current list by selecting it from the current list and clicking on REMOVE. NEW allows a network to be created from scratch. A network which already exists may be edited with OPEN. The BUILD CONTROL option is used to create the AweSim control statements that define the experimental conditions under which a run is made. A new control may be constructed from scratch if NEW is selected from the dialog box. OPEN allows a control set to be edited. The SET CURRENT option is available for defining the current control to be used when saving scenarios and translating and executing simulation models. The BUILD USER INSERT option is used to create user-written C functions with AweSim!'s text editor. The ADD and REMOVE command buttons which appear in the dialog box when this option is selected are used to define the user inserts which are currently active when saving scenarios and creating customized executables. A user insert is added to the current list by selecting it from the available list and clicking on ADD. A user insert is removed from the current list by selecting it from the current list and clicking on REMOVE. The BUILD NOTE option allows notes to be created with AweSim!'s text editor. Notes are written to document significant aspects about a particular model scenario. The BUILD ANIMATION option is used to create animations with AweSim!'s animation builder. The ADD and REMOVE command buttons which appear in the dialog box when this option is selected are used to define the animations which are currently active when saving scenarios. An animation is added to the current list by selecting it from the available list and clicking on ADD. An animation is removed from the current list by selecting it from the current list and clicking on REMOVE. The BUILD USER DATA option allows data files to be created with AweSim!'s text editor. Data files may be read from user-written subroutines and used as a source of model input. Simulate Menu Help SIMULATE is used to translate and execute models and to create customized executables. Help exists for the Simulate Menu Options: Simulate Run Simulate Translate Simulate Compile Simulate Link RUN executes a simulation of the current scenario. Before selecting RUN, the current network(s), control, and animation(s) should be translated with the SIMULATE TRANSLATE command and all user inserts presently selected should be compiled and linked with the SIMULATE COMPILE and SIMULATE LINK commands. The OPTIONS SIMULATE command is used to indicate whether a concurrent animation will be performed or a capture file will be used to collect animation data for future replay. TRANSLATE converts the network(s), control, and animation(s) displayed in the Current Scenario Box into the form required for analysis by the AweSim processor. Graphical networks are transformed first into statement form. If errors are detected during translation, a message appears instructing the user to check the echo report. This may be done by executing the REPORT OUTPUT ECHO command. COMPILE uses the options selected with the OPTIONS COMPILE command to compile the user inserts displayed in the Current Scenario Box. LINK creates an executable by combining the user inserts displayed in the Current Scenario Box with AweSim. These user inserts should have been compiled previously with the SIMULATE COMPILE command. The executable created is stored under the current scenario name. Animate Menu Help ANIMATE replays animations. Help is available for the Animate Menu Options: Animate Run The ANIMATE RUN option allows an animation to be replayed with animation data which was written to a capture file during a simulation run which was executed previously. Report Menu Help REPORT generates text reports of simulation output and model components. Help is available for the Report Menu Options: Report Network Report Control Report User Insert Report Note Report Animation Report User Data Report Output The REPORT NETWORK option is used to view AweSim networks in textual format with AweSim!'s text browser. The REPORT CONTROL option is used to view an AweSim control with AweSim!'s text browser. The REPORT USER INSERT option is used to view user-written C functions with AweSim!'s text browser. The REPORT NOTE option is used to view notes with AweSim!'s text browser. The REPORT ANIMATION option is used to view scripts with AweSim!'s text browser. The REPORT USER DATA option is used to view data files with AweSim!'s text browser. The REPORT OUTPUT option is used to view output from the current scenario with AweSim!'s text browser. Three types of output reports are possible. ECHO displays the network and control statements and messages about any errors which may have occurred during translation. It also provides a summary of the simulation model as interpreted by the AweSim processor. INTERMEDIATE contains output generated during the simulation run and may include an AweSim trace, user-written output, and any run-time error messages. SUMMARY displays the AweSim summary report along with optional tables and plots. Graph Menu Help GRAPH displays networks in graphical form and shows output in bar charts, histograms, pie charts, and plots. Help is available for the Graph Menu Options: Graph Output The GRAPH OUTPUT option displays output for the current scenario in the form of bar charts, histograms, pie charts, and plots. Histograms and pie charts may be generated from the histogram information collected as requested on COLCT nodes and TIMST statements. Plots may be shown for information collected with RECORD and VAR statements. Bar charts allow the viewing of values selected from the summary report. One statistic (such as resource utilization) may be displayed for multiple scenarios, or multiple statistics may be shown on the same bar chart for one scenario. Options Menu Help OPTIONS is used to set model building, compilation, and execution options. Help is available for the Options Menu Options: Options AweSim! Options Graphs Options Runs Options Simulate Options Compile The OPTIONS AweSim! option allows two parameters to be set. The sound check box indicates whether AweSim! errors are accompanied with a beep. The OPTIONS GRAPHS item is used to set the graph drawing options used when creating the output graphs. Once an output graph has been created, it can be redrawn using different options selected from the OPTIONS main menu bar item located on the output graph window. The 3 Dimensional check box indicates whether to display graphs in three-dimensional view. The default is two-dimensional view. The X Grid check box indicates whether to display grid lines for all X-axis tick marks. The Y Grid check box indicates whether to display grid lines for all Y-axis tick marks. The Data Points check box indicates whether to display data points on plots. The Graphic Frame check box indicates whether to display a frame around the graph only. The Frame check box indicates whether to display a frame around the window. The Discrete check box indicates whether to display plots in discrete or continuous view. The default is is continuous view. The Horizontal Scroll field is used to specify what percentage of the entire graph should be displayed within a single graph window. Cuts graph into multiple window-sized pages to facilitate viewing of large graphs. The Scroll Size allows the user to enter a scroll size less than 100% to enable multi-page, scrollable graphs and view graphs in greater detail. The OPTIONS RUNS option is used to specify the desired output runs to be displayed in summary reports and graphs. The Graphs current run entry field is used to specify the output run for which graphs will be displayed. The ADD and REMOVE command buttons which appear in the dialog box when this option is selected are used to define the output runs to be displayed in the summary report. A run is added to the current list by selecting it from the available list and clicking on ADD. A run is removed from the current list by selecting it from the current list and clicking on REMOVE. The OPTIONS SIMULATE item is used to request animation options (concurrent, postprocessing), Interactive Execution Environment, or neither. The OPTIONS COMPILE option sets compilation and linking options to be used when creating executables from user-written inserts. Detailed information about each of these choices may be found in your C Compiler User's Guide. The radio buttons in the Optimization group box tell the C compiler what kind of optimization to perform, if any. The check boxes in the Compiler & Linker Output group box tell whether or not the compiler produces a source listing and/or the linker produces a link map. Check the SOURCE LISTING item before compiling your usercode to produce an echo of your C code with an error message listing (filename.LST). Check LINK MAP before linking to create a link map file with global varible size, etc (filename.MAP). A box is include for specifing extra compiler specific link options. The INCLUDE PATH check box indicates that the subdirectory specified in the INCLUDE PATH entry field will be searched for include files in your C code. This path location will be searched after the current project directory and before the INCLUDE path specified in your AUTOEXEC.BAT file. Selecting the DEBUG check box compiles and links user inserts for use with the compiler's debugger. A box is include for specifing extra compiler specific compile options. Utilities Menu Help UTILITIES lists model components for the current project and allows them to be deleted and renamed. This option also permits model components from other project files to be imported into the current project. Help exists for the Utilities Menu Options: Utilities List Utilities Copy Utilities Import Utilities Export Utilities Rename Utilities Delete The UTILITIES LIST option displays all available scenarios and model components for the current project by component type. The UTILITIES COPY option allows a scenario or model component to be copied from another project into the current project. The UTILITIES IMPORT option allows a scenario or model component to be imported from an EXPORTed file or a previous version into the current project. The UTILITIES EXPORT option allows a scenario or model component to be exported from the current project into a file for printing or storage. The UTILITIES RENAME option allows a scenario or model component to be renamed. After indicating the type of component to be renamed, a list box displays all names for the current component type chosen. One of these existing components is selected and its new name entered into the text box. The UTILITIES DELETE option allows a scenario, model component, or output to be deleted. After indicating the type of component to be deleted, a list box displays all names for the current component type chosen. One of these existing components is selected before clicking the delete command button. Help Menu Help HELP provides information about the AweSim! main menu bar items and their associated pull-down menu options. NETWORK BUILDER HELP File Menu Help FILE allows network files to be opened, saved, and printed. Options New Open Save Save As Print Exit About The FILE NEW option allows a new network to be constructed from scratch. The FILE OPEN option allows modification of the network stored under the name indicated. The FILE SAVE option preserves the current network under the name it was opened with. The FILE SAVE AS option preserves the current network under the new name specified. The FILE PRINT option allows the network to be printed out. The FILE EXIT option leaves the Network Builder and returns to the AweSim executive window. The FILE ABOUT option provides information regarding the Network Builder version installed. Edit Menu Help EDIT allows new nodes to be added to a network, and existing nodes to be copied, removed, and selected. Options Undo Insert Change Cut Copy Paste Clear Select All The EDIT UNDO option removes the effects of the latest cut, copy, paste, clear, or undo operation. The ADD option inserts a AweSim network node into the network at the selected location. The node to insert is selected from the list of valid AweSim network nodes which appears when EDIT ADD is invoked. Nodes ACCUMULATE ACTIVITY ALTER ASSIGN AWAIT BATCH CALLVSN CLOSE COLCT CONNECTOR CREATE DETECT ENTER EVENT FINDAR FREE GATE GOON GROUP MATCH OPEN PREEMPT QUEUE READ RESOURCE SELECT TERMINATE TEXT UNBATCH WRITE View Menu Help VIEW is used to either view the network statements, or change the zoom factor of the network nodes. Options View Statements View Zoom In View Zoom Out Options Menu Help The OPTIONS menu is used to set options for display and defaults within the Network Builder. Options Option Grid Option Page Breaks Option AutoDefault Option AutoLayout Option Colors AweSim Expressions Help Expressions are made up of parenthesis, operators, intrinsic functions, global functions, random functions, writeable global variables, read-only global variables, and entity variables There are 5 basic types of expressions allowed in AweSim. Expression Any combination. Example: 20.0 * XX[(1+LL[2])] * EXPON(ATRIB[1]) Expression Any combination. Example: 20.0 * XX[(1+LL[2])] * EXPON(ATRIB[1]) Global Expression Any combination except entity variables Example: 20.0 * XX[(1+LL[2])] Constant Expression May not use any global functions or variables. Example: 1 + (37 % 3) Left-hand-side Expression Must be a writeable global variable or entity variable. Expressions in the subscript may be any Expression. Example: ATRIB[(1+LL[2]+LTRIB[3])] Global Left-hand-side Expression Must be a writeable global variable. Expressions in the subscript may be any Global Expression. Example: XX[(1+LL[2])] Network Nodes Help Nodes ACCUMULATE ACTIVITY ALTER ASSIGN AWAIT BATCH CALLVSN CLOSE COLCT CONNECTOR CREATE DETECT ENTER EVENT FINDAR FREE GATE GOON GROUP MATCH OPEN PREEMPT QUEUE READ RESOURCE SELECT TERMINATE TEXT UNBATCH WRITE Sub Network Builder Help Index Commands File Menu Edit Menu Search Menu View Menu Options Menu Glossary Expressions Network Nodes Control Statements Same as Network Builder Commands. Control Builder Help Index Commands File Menu Edit Menu Search Menu Glossary Expressions Control Statements File Menu Help FILE allows control files to be opened, saved, and printed. Options New Open Save Save As Print Exit About Edit Menu Help EDIT allows new statements to be added to a control list, and existing statements to be copied and removed. This menu item does not permit a statement to be modified. That may be accomplished by double clicking on the statement to be changed and altering the field values on the form which appears. Options Undo Insert Cut Copy Paste Clear Search Menu Help SEARCH locates strings of text in script sets. Options Find Find Next AweSim Expressions Help Expressions are made up of parenthesis, operators, intrinsic functions, global functions, random functions, writeable global variables, read-only global variables, and entity variables There are 5 basic types of expressions allowed in AweSim. Expression Any combination. Example: 20.0 * XX[(1+LL[2])] * EXPON(ATRIB[1]) Expression Any combination. Example: 20.0 * XX[(1+LL[2])] * EXPON(ATRIB[1]) Global Expression Any combination except entity variables Example: 20.0 * XX[(1+LL[2])] Constant Expression May not use any global functions or variables. Example: 1 + (37 % 3) Left-hand-side Expression Must be a writeable global variable or entity variable. Expressions in the subscript may be any Expression. Example: ATRIB[(1+LL[2]+LTRIB[3])] Global Left-hand-side Expression Must be a writeable global variable. Expressions in the subscript may be any Global Expression. Example: XX[(1+LL[2])] Control Statements Help Statements ARRAY COMMENT CONTINUOUS DOCOLCT ENTRY EQUIVALENCE FIN GEN INITIALIZE INTLC User Insert Editor Help Index Commands File Menu Edit Menu Search Menu Function Groups User Written User Callable LIMITS MONTR NETWORK PRIORITY RECORD REPORT SEEDS SEVNT SIMULATE TIMST File Menu Help FILE allows text files to be printed, the browser to be exited, and information about the version of the User Insert Editor installed to be obtained. Help is available for the File Menu Options: File New File Open File Save File Save As File Print File Exit File About Edit Menu Help EDIT allows text to be: -moved from a file onto the clipboard, -copied from a file onto the clipboard, or -pasted into a file from the clipboard. Help is available for the Edit Menu Options: Edit Undo Edit Cut Edit Copy Edit Paste Edit Clear Search Menu Help SEARCH locates a string of text in the file being edited. Help is available for the Search Menu Options: Search Find Search Find Next Search Find Line User Writeable Routines Help AweSim provides user-programmed interfaces to allow modeling using alternative and combined constructs. These interfaces are used to perform non-standard network processing, specialized output reporting, continuous variable definition, and discrete event scheduling. A dummy version of each of these functions is provided in the AweSim library, which allows the user to omit any of them from a model without encountering undefined external references. Routines ALLOC ASSEMBLE BATCHSAVE EVENT INTLC NQS NRS NSS ORDER OTPUT RAWEND RAWOPEN RAWSAVE STATE STATLOAD STATSAVE UERR UMONT USERF UUPATH UUPNT User Callable Routines Help AweSim includes many support functions to provide information on system status, to allow the modeler to change that status, and to support user-written reports. The functions described here may be called from any of the user-written interface points. Routines Types Random Sampling Functions Statistical Functions File Manipulations Network Status Subprograms Simulation Status Output Reports Auxiliary Attributes Table Data Entity Status Functions Memory Allocation Functions