'  2' '75ư> %,2HELPNA\NhNN:l|CONTINUE n((pxEXIT&%p=lHALTމPl|dSTEP 1r4߉lg STOP߉X^F%EFSTOP ,,OFFg^w@߉U T߉W O9gp߉.Od9?g|߉CONDUCT BestLines(1,4,1)g9?ModelsAnova.gpsLFeCFEOgLggE(((((((((({\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fmodern Courier New;}{\f3\fswiss\fprq2 System;}} {\colortbl\red0\green0\blue0;} \deflang1033\pard\tx1200\tx2400\tx4440\tx5280\tx6000\plain\f2\fs20 ; GPSS World Sample File - ONEWAY.GPS \par *********************************************************************** \par * * \par * Balanced Telephone System Experiment with * \par * One-Way Analysis of Variance. * \par * * \par * To Determine the Optimal Number of Telephone Lines.\tab * \par * * \par * Discussed in Lesson 19 of the Tutorial Manual * \par * * \par * * \par * BestLines() places results in a Global MATRIX MainResult, * \par * and in a Results File named RESULT.TXT and then performs * \par * a One Way Analysis of Variance. * \par * * \par * To Create an EXPERIMENT that can be HALTed, saved, * \par * and resumed, you would need to use Global SAVEVALUE * \par * and/or MATRIX Entities to control the Runs. Also, * \par * when you use the CLEAR Command, you must use the OFF * \par * option to preserve control variables and results. * \par * * \par *********************************************************************** \par \par *********************************************************************** \par * Define the Global Experimental Result Matrix and Residuals Table * \par *********************************************************************** \par * Max of 4 Treatment Levels of Factor 1, Max of 3 Replicates per cell * \par MainResult MATRIX ,4,3 \par \par * Initialize Result Matrix to show missing Data \par INITIAL MainResult,UNSPECIFIED \par \par * Create Table to receive the ANOVA residuals \par MainResult_Residuals TABLE ,-5,1,10 \par * Chapter 13 of the Reference Manual discusses residuals. \par *********************************************************************** \par \par \par EXPERIMENT BestLines(LeastLinesToRun, MostLinesToRun, Increment) BEGIN \par \par \tab /* Each Result Matrix has the following dimensions: \par \par \tab 1. Each of up to 5 Factors requires a dimension, where \par \tab each dimension indicates the number of levels used \par \tab for that factor. Each Factor is represented by a \par User Variable. \par \par \tab 2. The last dimension indicates the maximum number of \par \tab replicates to be run within a treatment combination \par (i.e. within a cell of the experiment). \par \par There may be up to a total of 6 dimensions. */ \par \par \par /* Put a Header into the Journal */ \par DoCommand("SHOW """" "); \par DoCommand("SHOW (""**** Balanced Telephone-System Experiment with One-way ANOVA ****"")"); \par DoCommand("SHOW """" "); \par \par \par /* Optionally, save data to a Result file for later processing. */ \par Open(2,"RESULT.TXT"); /* Open Stream 2 For Statistical data */ \par Seek(10000,2); /* Append the Results */ \par Write(2,"**** EXPERIMENT BestLines() ****"); /* Header for this Experiment */ \par \par LevelOfFactor1 = 1; /* Levels are 1-4, incl.*/ \par \par CurrentLines = LeastLinesToRun; /* Set the number of telephone lines to use */ \par \par WHILE ((CurrentLines <= MostLinesToRun) 'AND' (LevelOfFactor1<=4)) DO BEGIN\tab \par \par Replicate = 1; \par WHILE (Replicate <= 3) DO BEGIN \par \tab \par /* Run the Simulation by calling a PROCEDURE (defined below) */ \par DoTheRun(CurrentLines,Replicate); \par \par /* Store the first (and only) result of this run. \par \tab \tab This will be used by the ONEWAY DoCommand, below. \par \tab \tab Multiple results would require additional Results Matrices. */ \par \tab MainResult[LevelOfFactor1,Replicate] = TB$Transit; \par \par \tab /* Log Result in the Journal, too. This is optional. */ \par \tab RunDescription = Polycatenate(PolyCatenate("Main Result: ",LevelOfFactor1," ",Replicate)," - TB$Transit=",TB$Transit,""); \par \tab DoCommand("SHOW (RunDescription)"); \par \tab DoCommand("SHOW """" "); /* Space after Result */ \par \tab \par /* Optional Example of writing to a Results File for 3rd party Statistics */ \par \tab Write(2,RunDescription); \par \par \tab \par \tab /* Set up the next Replication */ \par \tab Replicate = Replicate + 1; \par \par \tab END; \par \par /* Move to the next cell of the experiment. */ \par LevelOfFactor1 = LevelOfFactor1 + 1; \par CurrentLines = CurrentLines + Increment; \par \par END; \par \par \par /* Put the Statistical Analysis into the Journal */ \par DoCommand("SHOW """" ");/* Space down a line */ \par \par ANOVA(MainResult,2,1); /* Perform the One-Way ANOVA */ \par \tab /* Replicates in Dimension 2; No interactions (level 1) */ \par \par DoCommand("SHOW """" ");/* Space down a line */ \par \par \par \par Close(2); /* Close the Optional Results File */ \par \par \par /* All outcomes can now be viewed in the MATRIX Window, or \par the RESULTS.TXT Text Object. The ANOVA table is in the Journal. */ \par \par \par \par END; \par \par \par PROCEDURE DoTheRun(NumberOfLines, ReplicateNumber) BEGIN \par \par /* A PROCEDURE can issue DoCommand() only if it is called by an EXPERIMENT */ \par \par TEMPORARY RandomSeed1; \par \par /* Use a seed distinct from those of other replicates */ \par RandomSeed1 = 11 # ReplicateNumber; \par \par \par DoCommand("CLEAR OFF"); /* Must use OFF to preserve results. */ \par \par DoCommand(Catenate("RMULT ",RandomSeed1)); /* Here we only use one RN stream */ \par \par DoCommand(Catenate("Sets STORAGE ",NumberOfLines)); \par \par DoCommand("START 100,NP"); /* Get past the Startup Period */ \par \par DoCommand("RESET"); /* Begin the Measurement Period */ \par \par DoCommand("START 1000,NP"); /* Run the Simulation */ \par \par END; \par \par \par ; From GPSS World Sample File - TELEPHON.GPS, by Gerard F. Cummings \par ************************************************************** \par * * \par * * \par * Telephone System Model * \par * * \par * * \par * Discussed in Section 2.2 of the Tutorial Manual * \par * * \par ************************************************************** \par * Simple Telephone Simulation * \par * Time Unit is one minute * \par Sets STORAGE 2 \par Transit TABLE M1,.5,1,20 ;Transit times \par GENERATE 1.667,1 ;Calls arrive \par Again GATE SNF Sets,Occupied ;Try for a line \par ENTER Sets ;Connect call \par \tab ADVANCE 3,1 ;Speak for 3+/-1 min \par LEAVE Sets ;Free a line \par TABULATE Transit ;Tabulate transit time \par TERMINATE 1 ;Remove a transaction \par Occupied ADVANCE 5,1 ;Wait 5 minutes \par TRANSFER ,Again ;Try again \par ************************************************************** \par \par \par }