mns report

Upload: abhishek-goel

Post on 02-Jun-2018

261 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 Mns Report

    1/21

    Modeling and Simulation

    (CSL 403)

    Mini Project

    Submitted by:

    Anurag Aggarwal 10-CSU-030

    Aprajita Gupta 10-CSU-031

  • 8/11/2019 Mns Report

    2/21

    Acknowledgement

    We render a deep sense of gratitude to our guide Mr SandeepSingh. She has been an esteemed source of constant support andguidance.

    We would also like to thank our Institution and our facultymembers without whom this report would have been a distant reality. Ithas been a great learning experience.

    Anurag

    Aprajita

  • 8/11/2019 Mns Report

    3/21

    Table of Contents

    Index Contents Page No.1. Introduction 12. Problem Statement 23. Listing 34. Description of the model function 45. Running the Simulation 66. References 15

  • 8/11/2019 Mns Report

    4/21

    IntroductionGeneral Purpose Simulation System (GPSS) (originally Gordon's ProgrammableSimulation System after creator Geoffrey Gordon; the name was changed when it was decided

    to release it as a product) is a discrete time simulation general-purpose programming language,where a simulation clock advances in discrete steps.

    A system is modeled as transactions enter the system and are passed from one service(represented by blocks) to another.

    This is particularly well-suited for problems such as a factory.

    GPSS is less flexible than simulation languages such as Simula and SIMSCRIPT II.5 but it iseasier to use and more popular.

    The GPSS World View

    The world is rather simulated with entities moving through the model. These entities,called Transactions , are envisioned as moving from Block to Block , where a Block is a line ofcode and represents unit actions that affect the Transaction itself or other entities.

    These other entities can be broadly classified in Resources, Computational entities and Statisticalentities.

    Resources , like Facilities and Storages represent limited capacity resources.

    Computational entities, like Ampervariables (variables), Functions and random generators areused to represent the state of Transactions or elements of their environment.

    Statistical entities, like Queues or Tables (histograms) collect statistical information of interest.

    1

  • 8/11/2019 Mns Report

    5/21

    Problem Statement

    Simulation of a Simple Telephone system

    A simple telephone system has two external lines. Calls, which originate externally, arrive every10060 seconds. When the line is occupied, the caller redials after 51 minutes have elapsed.Call duration is 31 minutes. A tabulation of the distribution of the time each caller takes tomake a successful call is required.-Simulate 50 calls.-How long will it take for 50 calls to be completed?

    2

  • 8/11/2019 Mns Report

    6/21

    LISTING

    GPSS World - TELEPHON.GPS**************************************************************** Telephone System Model**************************************************************** Simple Telephone Simulation* Time Unit is one minuteSets STORAGE 2Transit TABLE M1,.5,1,20 ;Transit timesGENERATE 1.667,1 ;Calls arriveAgain GATE SNF Sets, Occupied ;Try for a lineENTER Sets ;Connect callADVANCE 3,1 ;Speak for 3+/-1 minLEAVE Sets ;Free a lineTABULATE Transit ;Tabulate transit timeTERMINATE 1 ;Remove a TransactionOccupied ADVANCE 5,1 ;Wait 5 minutesTRANSFER ,Again ;Try again**************************************************************

  • 8/11/2019 Mns Report

    7/21

    GPSS World Simulation Report - Untitled Model 1.1.1

    Wednesday, November 20, 2013 12:51:36

    START TIME END TIME BLOCKS FACILITIES STORAGES0.000 359.156 9 0 1

    NAME VALUEAGAIN 2.000OCCUPIED 8.000SETS 10000.000TRANSIT 10001.000

    LABEL LOC BLOCK TYPE ENTRY COUNT CURRENT COUNT RETRY1 GENERATE 216 0 0

    AGAIN 2 GATE 762 0 03 ENTER 201 0 04 ADVANCE 201 1 05 LEAVE 200 0 06 TABULATE 200 0 07 TERMINATE 200 0 0

    OCCUPIED 8 ADVANCE 561 15 09 TRANSFER 546 0 0

    STORAGE CAP. REM. MIN. MAX. ENTRIES AVL. AVE.C. UTIL. RETRYDELAY

    SETS 2 1 0 2 201 1 1.677 0.839 0 0

    TABLE MEAN STD.DEV. RANGE RETRY FREQUENCYCUM.%

    TRANSIT 14.268 17.274 01.500 - 2.500 20

    10.002.500 - 3.500 41

    30.503.500 - 4.500 24

    42.504.500 - 5.500 0

    42.505.500 - 6.500 2

    43.506.500 - 7.500 9

    48.007.500 - 8.500 14

    55.008.500 - 9.500 12

    61.009.500 - 10.500 1

    61.5010.500 - 11.500 0

    61.50

  • 8/11/2019 Mns Report

    8/21

    11.500 - 12.500 262.50

    12.500 - 13.500 967.00

    13.500 - 14.500 368.50

    14.500 - 15.500 169.00

    15.500 - 16.500 270.00

    16.500 - 17.500 472.00

    17.500 - 18.500 775.50

    18.500 - _ 49100.00

    FEC XN PRI BDT ASSEM CURRENT NEXT PARAMETER VALUE179 0 359.251 179 8 9

    196 0 359.367 196 8 9217 0 359.676 217 0 1161 0 359.972 161 8 9215 0 360.201 215 8 9167 0 360.580 167 8 9195 0 360.656 195 4 5197 0 360.826 197 8 9187 0 362.292 187 8 9210 0 362.403 210 8 9216 0 362.513 216 8 9205 0 363.396 205 8 9203 0 363.487 203 8 9211 0 363.852 211 8 9208 0 364.028 208 8 9207 0 364.827 207 8 9214 0 364.883 214 8 9

  • 8/11/2019 Mns Report

    9/21

    3

    Description of Model Function

    STORAGE - The Storage Entity Sets, with total capacity of 2, is set up to represent 2 externaltelephone lines.

    TABLE - The Table Transit is defined, so that an on-line histogram of call times can bemaintained. Just before a Transaction is Terminated, the "time in simulation" SNA, M1, istabulated. This represents the duration from when the caller first dialed, until he/she finishedtalking.

    GENERATE - A Transaction that represents a call is created every 10060 seconds.

    GATE - A GATE Block sends a Transaction to the Block Occupied when all lines are busy. Thisoccurs when the Storage Entity Sets is full, and represents a caller who must begin waiting

    before redialing.

    ENTER - If either 0 or 1 unit of storage is in use, a Transaction passes through the GATE Block,and into the ENTER Block, thereby using another storage unit. If all storage units are then in use,no more Transactions will be admitted by the GATE Block. Each Transaction passing into theENTER Block represents a call which has been successfully connected.

    ADVANCE - The Transaction then enters an ADVANCE Block, which simulates the callduration of 18060 seconds. It will remain in this Block until the simulated time has passed.

    LEAVE - When a Transaction enters the LEAVE Block, it makes one unit of the Storage Setsavailable to other Transactions. This represents a newly available external line.

    TABULATE - The TABULATE Block adds the call duration to the histogram of call timescollected in Table Transit.

    TERMINATE - The TERMINATE Block removes the Transaction from the simulation, afterthe call has been completed.

    ADVANCE - A Transaction comes to the ADVANCE Block labeled Occupied when it tried,and failed, to acquire a unit of storage from the Storage Entity Sets. This represents a caller whomust wait before redialing.

  • 8/11/2019 Mns Report

    10/21

    TRANSFER - The TRANSFER Block sends each Transaction to the GATE Block labeledAgain. There, the Transaction will try again to acquire a storage unit from the Storage EntitySets. In other words, the caller will redial.

    4

    Transactions represent calls begun but not completed. If a new caller finds both lines busy, theGATE Block labeled Again sends it to wait in the ADVANCE Block labeled Occupied for 5minutes, or so. After the delay, the Transaction jumps back up to the GATE Block to try again.

    Successful callers pass through the GATE Block, encounter a delay which represents the call,and then leave the simulation.

    Notice that the number of phone lines is modeled as a Storage Entity with a capacity of 2. Later,it will be very easy to experiment with the effects of adding more lines.

    If a call cannot be completed, the corresponding Transaction waits for 5 simulated minutes in theADVANCE Block labeled Occupied. The number of Transactions here represents the number ofcallers waiting to redial.

    The TABLE statement will produce detailed information on the duration of call attempts. Bytabulating the M1 SNA just before each Transaction is terminated, we will build a histogram ofhow long callers took to complete their calls.

  • 8/11/2019 Mns Report

    11/21

    5

    Running the Simulation

    To run the simulation and create a Standard Report,

    CHOOSE File / Open

    and in the dialog box,

    SELECT Telephone

    and then

    SELECT Open

    Next, the simulation must be created.

    CHOOSE Command / Create Simulation

    then

    CHOOSE Command / START

    and in the dialog box replace the 1

    TYPE 50

    SELECT OK

    The simulation will end when 50 Transactions have entered the TERMINATE Block. Thisrepresents 50 call completions.

    When the simulation ends, GPSS World writes a report to the default report file, Telephon.1.1.As discussed in Chapter 1, the Report extension will vary depending on saved simulations and

    previously existing reports. For our purposes, we will assume that this is the first time thesimulation has been created and run giving an extension of 1.1.

  • 8/11/2019 Mns Report

    12/21

    This report will be automatically displayed in a window. If you close the window, you canreopen it by using the GPSS World File / Open in the Main Menu. Then you should chooseReport in the "Files of type" drop down box at the bottom of the window. GPSS World reportsare written in a special format. If you wish to edit the report, you will have to copy its contents tothe clipboard and from there into a word processor. You will not be able to open the file directly

    in a word processor.

    6

    Discussion of Results

    From the End Time value in the Standard Report, we see that 359.16 minutes had elapsed whenthe 50th call had been completed. Replications of the simulation will yield slightly differentvalues due to random variation.

    The Table named Transit gives detailed information on how long it took callers to complete their

    calls. Although most calls were completed in less than 9.5 minutes, many took much longer.Perhaps this would be a source of customer dissatisfaction.

    Inside the Simulation

    Let us now explore the ending condition of the simulation, which generated the Standard Reportabove. If you are not at the end of the simulation, please Retranslate the model and run it again.If you have a Report Window open, please close it now.

    Lets use the Expression Window to look at some System Numeric Attributes. First, confirm thesimulation end time.

    CHOOSE Window / Simulation Window / Expression Window

    The Edit Expression Window opens. When you enter the value in the second box in this dialog box, you should place the mouse pointer in the small box and click once. Do not press [Enter] togo from the first to the second box as GPSS World then assumes that all values have beenentered. You can, instead, use [Tab] to move from box to box. Now, in the dialog box for theLabel field

    TYPE Time

    and in the Expression fieldTYPE AC1

    This will let us view the current time.

    CLICK ON View

    and

  • 8/11/2019 Mns Report

    13/21

    CLICK ON Memorize

    If we memorize all the expressions, we'll be able to close the window and open it again later witheasy retrieval of all the values. Also if you save the simulation the values in the ExpressionWindow will be saved with the simulation if they have been memorized. We're going to close

    this window and reopen it later so please memorize this expression and the ones that follow.

    7

    Now, let's look at the utilization (fractional busy time) of the phone lines, in parts per thousand.

    In the dialog box for the Label field replace the current value

    TYPE Util

    and in the Expression field, replace the current value

    TYPE SR$Sets

    CLICK ON View

    CLICK ON Memorize

    Finally, lets add the average time a phone line is held.

    In the dialog box for the Label field, replace the current value

    TYPE Avg. Call Time

    and in the Expression field, replace the current value

    TYPE ST$Sets

    CLICK ON View

    CLICK ON Memorize

    SELECT OK

    The utilization is expressed in parts per thousand. The lines are utilized at 84% of capacity.Although there is some unused time, the queuing delays may not be acceptable.

    Now, close the Expression Window

    CLICK ON The X-Upper Right of the Window

    Now, lets open some graphics windows.

  • 8/11/2019 Mns Report

    14/21

    CHOOSE Window / Simulation Window / Storages Window

    This is the Storages Window Detail View. Notice that we can also see the 84% utilization here.From the low and high water marks (Min and Max values) of the storage in use, we see thatsome time in the simulation, 0, 1, or 2 lines were busy. Use the slide bar in the bottom of the

    window to move to the values we are discussing. The Storages Window is discussed in Chapter5 of the GPSS World Reference Manual .

    8

    If we open the Table Window, we can see the histogram of call completion times.

    CHOOSE Window / Simulation Window / Table Window

    and since there is only one Table in this model you will see TRANSIT in the drop-down box

    SELECT OK

    Make sure that you size the Table Window so that it is large enough to display the Tablecorrectly. This gives the same information as the Table in the Standard Report. The averagetalking time is 3 minutes as shown by the ST SNA in the Expression Window, but the averagetime including redials is 14.27 minutes as seen in the Table Window. Callers are spending anenormous amount of time redialing.

    Lets take a look at where Transactions are.

    CHOOSE Window / Simulation Window / Blocks Window

    This is the Blocks Window. Notice that 15 customers are waiting to redial.

    Look at the history of Block entries in the Entry Count column.

  • 8/11/2019 Mns Report

    15/21

    Blocks Window Detailed View Showing TRANSFER Block.

    9

    Whats going on here? Look at how many Transactions have entered the ADVANCE Blockmeaning that they are waiting to redial! 561! But there have only been 50 calls. Watch theBlocks Window, and using the Function Key [F5] . Step through the simulation. Do this 15 or 20times. Do you see what is happening? Many callers who redial are finding the lines busy, and

    must wait yet another time to redial.

    Now we will rerun the simulation, viewing it through some graphics windows. Begin by closingall of the open windows except the Blocks, Journal and Model Windows.

    CLICK ON The X-Upper Right of Each Window

    Let's reopen the Expression Window with the values that we memorized before and add the callnumber which is also the Active Transaction number.

    CHOOSE Window / Simulation Window / Expression Window

    in the Edit Expression dialog box for the Label field

    TYPE Call no.

    and in the Expression field

    TYPE XN1

    CLICK ON View

  • 8/11/2019 Mns Report

    16/21

    CLICK ON Memorize

    Before we open the Window, we need to bring back the memorized Expressions that we enteredthe first time we opened the Window. For each expression that was memorized in the memorized

    box

    CLICK ON The Expression

    then

    CLICK ON View

    Finally, when all expressions show in the view box

    SELECT OK

    Now, lets get rid of Transactions and reset the statistics accumulators. From the Main Menu

    CHOOSE Command / Clear

    10

    CHOOSE Command / Custom

    TYPE RMULT 1

    We are resetting Random Number Generator 1 since CLEAR does not do so. This is necessary if

    you want to ensure the starting point of the stream. In this way, if you've used other commands,not listed in the Tutorial, before the CLEAR, we'll all be seeing the same results during this run.RMULT is discussed in more detail in the ANOVA lesson in Chapter 1.

    SELECT OK

    In the Blocks Window move the mouse pointer over the last Block in the model which is theTRANSFER Block.

    CLICK ON The TRANSFER Block

    and

    CLICK ON The Place Icon in the Debug Toolbar

    Next, size and position the Blocks, Journal and Expression Windows, so you can see each ofthem.

    CHOOSE Command / START

    and in the dialog box replace the 1

  • 8/11/2019 Mns Report

    17/21

    TYPE 1000,NP

    and

    SELECT OK

    The simulation stops on the first attempt to enter the TRANSFER Block. This indicates that thiscaller couldnt get through. Continue the running of the simulation.

    PRESS [F2]

    Do this same operation four more times after each time the simulation is Halted by the StopCondition.

    The simulation will continue to stop every time a caller has to wait. You will see the tracemessages in the Journal Window that indicate the Transaction number of the Stopped

    Transaction. Since there is only one GENERATE Block in this model, you can see byTransaction number how often a caller is having to wait and if there are callers waiting for asecond time.

    11

    Now, remove the Stop Condition. In the Blocks Window

    CLICK ON The Transfer Block

    CLICK ON The Remove Icon in the Debug Toolbar

    Then, close the Blocks, and Expression Windows.

    CLICK ON The X-Upper Right of Each Window

    Now, well watch the simulation run in the Storages Window non -detailed view.

    CHOOSE Window / Simulation Window / Storages Window

    and from the Main Menu

    CHOOSE View / Entity Details

    to toggle to the non-detailed view of the window.

    Now lets also watch the call delay histogram as it is being built!

    CHOOSE Window / Simulation Window / Table Window

    and since there is only one table and its name is already in the drop-down box

  • 8/11/2019 Mns Report

    18/21

    SELECT OK

    Continue the running of the simulation.

    PRESS [F2]

    The Table named Transit is, in fact, a dynamic histogram which can be viewed at any time. Itshows that many customers are not receiving service right away. Clearly, the customers finding

    busy lines wont be too happy. When you have finished watching, close both the Table andStorages Windows and let the simulation run to completion.

    What if we added more lines? Lets simulate 4 lines instead of two.

    Its a good idea use the CLEAR Command before you redefine an entity.

    CHOOSE Command / CLEAR

    then

    CHOOSE Command /Custom

    12

    and in the dialog box

    TYPE Sets Storage 4

    PRESS [Enter]

    and on the next line

    TYPE RMULT 1

    SELECT OK

    That redefines the number of phone lines. You can do this with any window open. This actionwill be recorded in your Journal for later review if you chose to leave it open.

    Now, lets see what happens.

    CHOOSE Command / START

    and in the dialog box replace the 1

    TYPE 1000,NP

    and

  • 8/11/2019 Mns Report

    19/21

    SELECT OK

    The utilization of the phone lines is much smaller as seen in the Storages section of the report. Now observe the histogram of call durations.

    CHOOSE Window / Simulation Window / Table Window

    and since there is only one table and its name is already in the drop-down box

    SELECT OK

    Thats much better. In fact, if youd like to look in the detailed view of the Blocks Window,youll see that the TRANSFER Block was not entered meaning that no calle rs had to redial. Fourlines appear to be much better than two. This would have to be established statistically, possiblyusing the ANOVA Command.

    We now appear to have a solution to the problem, but it may be unnecessarily expensive. Three phone lines wou ld be less expensive than four, and might suffice. Lets try it.

    CHOOSE Command / CLEAR

    13

    then

    CHOOSE Command / Custom

    and in the dialog box

    TYPE Sets Storage 3

    to change the number of lines to 3

    PRESS [Enter]

    and on the next line

    TYPE RMULT 1

    SELECT OK

    Now, lets see what happens.

    CHOOSE Command / START

    and in the dialog box replace the 1

  • 8/11/2019 Mns Report

    20/21

    TYPE 1000

    and

    SELECT OK

    You may want to open the Blocks Window. When you have observed the open graphicswindows as long as you want, close them and let the simulation run to completion. It looks likethree phone lines is effective. A quick look at the Report reveals that only 57 callers had toredial. In the Report Window's Table statistics, average transit time is only 3.28 minutes. If theload of calls is not expected to increase, this may be satisfactory.

    Before reporting these results, we must prove that they are not due to random noise. Also, wemay want to exclude starting conditions from the final statistics using the RESET Command. Wecould plan a set of experiments, and do an analysis of variance on the average transit times basedon the different phone line configurations. Treatment 2 would be the 2 phone line configuration,

    treatment 3 would have 3 lines, and treatment 4 would have 4 lines. Each simulation shouldcover several thousand calls, and each treatment level should have several replications usingdifferent random number seeds.

    14

    References

    www.wikipedia.org www.minutemansoftware.com

    http://www.minutemansoftware.com/http://www.minutemansoftware.com/http://www.minutemansoftware.com/
  • 8/11/2019 Mns Report

    21/21