11. ROBOTFMS.GPS

 

Simulation of a robot operated FMS.

 

Problem Statement

An experimental, robot operated, flexible manufacturing system has two computer numerical control machine tools, an arrival area, and a finished parts area. Components arrive every 150 seconds, exponentially distributed, and are machined on both machines in sequence. The robot takes 8Ī1 seconds to grip or release components, and 6 seconds to move components from the arrival area to the first machine. Processing time, on the first machine is normally distributed, with a mean of 60 seconds and a standard deviation of 10 seconds. The robot takes 7 seconds, to move from the first machine to the second machine. Machining time on the second machine is 100 seconds, exponentially distributed. Finally, the robot takes 5 seconds, to move components from the second machine, to the finished parts storage area.

Simulate the manufacturing cell operation, for 75 completed parts.

1. Find the distribution of transit times of jobs.

2. Find the utilization of the robot, and the machine tools.

3. Find the maximum storage areas required, in the cell.

 

Listing

; GPSS World Sample File - ROBOTFMS.GPS, by Gerard F. Cummings
*******************************************************************
* Experimental Manufacturing Cell 
* Two CNC machines and one Robot
* One arrival area and one finished parts area
*******************************************************************
RMULT 78863
Transit TABLE M1,100,100,20 ;Record lead time
*******************************************************************
        GENERATE (Exponential(1,0,150)) ;A job arrives
        QUEUE     One           ;Arrival queue
        SEIZE     Robot         ;Get the robot
        DEPART    One           ;Depart the queue
        ADVANCE   8,1           ;Robot grips the job
        ADVANCE   6             ;Robot moves to machine 1
        ADVANCE   8,1           ;Robot place the job
        RELEASE   Robot         ;Free the robot
        QUEUE     Two           ;Wait in next queue
        SEIZE     Machine1      ;Get first machine
        DEPART    Two           ;Depart the queue
        ADVANCE   (Normal(1,60,10)) ;Process time
        RELEASE   Machine1      ;Free machine 1
        QUEUE     Three         ;Join queue for machine 2
        SEIZE     Robot         ;Get the robot
        DEPART    Three         ;Depart the queue
        ADVANCE   8,1           ;Robot grips part
        ADVANCE   7             ;Robot moves to machine 2
        ADVANCE   8,1           ;Robot places the part
        RELEASE   Robot         ;Free the robot
        QUEUE     Four          ;Join queue machine 2
        SEIZE     Machine2      ;Get machine 2
        DEPART    Four          ;Depart the queue
        ADVANCE   (Exponential(1,0,100)) ;Process 2
        RELEASE   Machine2      ;Free machine 2
        QUEUE     Five          ;Queue for exit station
        SEIZE     Robot         ;Get the robot
        DEPART    Five          ;Depart the queue
        ADVANCE   8,1           ;Robot grips the part
        ADVANCE   5             ;Robot moves to exit
        ADVANCE   8,1           ;Robot places the part
        RELEASE   Robot         ;Free the robot
        TABULATE  Transit       ;Transit time
        TERMINATE 1             ;Job is completed
*******************************************************************

Transactions represent jobs, which pass serially through each step in the operation.

The Table Transit collects the distribution of job completion times.

 

Running the Simulation

To run a simulation and create a Standard Report,

CHOOSE     File / Open

and in the dialog box

SELECT      Robotfms

and then

SELECT      OK

Next, create the simulation.

CHOOSE      Command / Create Simulation

then

CHOOSE      Command / START

and in the dialog box, replace the 1.

TYPE      75

SELECT      OK

The simulation will end when 75 Transactions have entered the TERMINATE 1 Block. This represents the completion of 75 jobs.

When the simulation ends, GPSS World writes a report to the default report file, RobotFMS.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 the simulation has been created and run giving an extension of 1.1.

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

 

Discussion of Results

From the Standard Report, we see that the Robot, Machine1, and Machine2 Facilities had utilizations of 36%, 33% and 64%, respectively. The Queue Entity Four registered a notably long average waiting time of 179.7 seconds. This queue represents jobs waiting for Machine2.

The order completion times are represented in the Table Transit. The mean was 451.8 seconds, with a standard deviation of around 250.8.

The maximum storage requirements required for each Queue Entity totals 13 for this simulation. This is the total of all Queue Entity Maximum values. Maximum values can vary widely from run to run. Therefore, we would want to complete several more simulations before reporting a space requirement, in the form of a confidence interval. Confidence intervals are provided by the ANOVA Command, which is discussed in Lesson 13 of this manual and Chapter 6 of the GPSS World Reference Manual.

 

Inside the Simulation

Let's now explore the ending condition of the simulation, which generated the Standard Report above. If you are not at the end of the simulation, please Retranslate the model and run it again.

Now, letís open some graphics windows.

CHOOSE      Window / Simulation Window / Facilities Window

This is the Facilities Window. It gives information on machine usage. Machine2 has the highest utilization.

To view the histogram of job completion times,

CHOOSE      Window / Simulation Window / Table Window

and since the TRANSIT Table is the only one in this model

SELECT      OK

Close the Table and Facilities Windows once you have examined them.

CLICK ON      The X-Upper Right of Each Window

Occasionally, you may find it desirable to rerun simulations after adding Tables, Qtables, or other automatic data collection Entities. It is always possible to create and report your own statistics using Variable, Fvariable, Bvariable, Matrix, and Savevalue Entities. They, and other simulation related values could be viewed via the Expression Window as well. Also, the I/O Stream Blocks and String Commands can be used to create reports that are formatted as you wish with the selected information from your simulation.

Letís take a look at where Transactions are.

CHOOSE      Window / Simulation Window / Blocks Window

and look at the history of Transactions in the simulation. Look at the total Block entry counts. This model is rather simple with no TRANSFER Blocks or alternate destinations. Letís watch the dynamics. Often, a new Active Transaction is chosen when the current Transaction enters an ADVANCE Block. Open an Expression Window on the Active Transaction number.

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] to go from the first to the second box as GPSS World then assumes that all values have been entered. You can, instead, use [Tab] to move from box to box. Now, in the dialog box for the Label field

TYPE      Active Transaction Number

and in the Expression field

TYPE      XN1

CLICK ON      View

and

CLICK ON      Memorize

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

SELECT      OK

and

CHOOSE      Command / START

and in the dialog box, replace the 1.

TYPE      2000

SELECT      OK

If you want to slow things down, interrupt the simulation and use the Step Command. Feel free to interact with the simulation environment. When you are done, halt the simulation.

PRESS     [F4]

If you wish to go on to the next lesson, close all windows related to this model.

CLICK ON      The X-Upper Right of Each Window

Otherwise, to end the session

CLICK ON      The X-Upper Right of Main Window.

 

12. BICYCLE.GPS

 

Simulation of a bicycle factory.

 

Problem Statement

A factory assembles bicycles, employing the following staff, 2 clerks, 3 framers, 1 saddler, 1 handler, 1 wheeler, 1 pedaler, 4 assemblers, and 3 packers. The company commences to assemble a bicycle, every 50Ī10 minutes. The clerical department prepares the delivery documents, instructions, tool kit and invoice.

Each department withdraws the component required for a particular order from stock, inspects (3Ī1 minutes) and prepares it for assembly. The frame is manufactured and takes 65 minutes, exponentially distributed. When the components are available, they are assembled. This takes on average 90 minutes, with a standard deviation of 10 minutes. When the delivery documents, tool kit, and the assembled bicycle, are ready, they are packed (40Ī5 minutes), in preparation for delivery.

1. Find the utilization of the staff in each department.

2. Determine the transit times of customersí orders.

3. Should the number of staff be changed in any department?

4. Simulate the bicycle factory assembly operation, for 5 days.

 

Listing

; GPSS World Sample File - BICYCLE.GPS by Gerard F. Cummings
*********************************************************************
*
* Bicycle Assembly Model 
*
*********************************************************************
*********************************************************************
Orders FUNCTION P$Department,L6
1,Order/2,Frame/3,Saddle/4,Handlebars/5,Wheels/6,Pedals
*********************************************************************
Transit TABLE M1,100,100,20
*********************************************************************
Clerks STORAGE 2
Framers STORAGE 3
Saddlers STORAGE 1
Handlers STORAGE 1
Wheelers STORAGE 1
Pedalers STORAGE 1
Builders STORAGE 4
Packers STORAGE 3
*********************************************************************
        GENERATE  50,10         ;Order arrives for bicycle
        SPLIT     5,Factory,Department ;Make 5 copies of order
Order   ENTER     Clerks
        ADVANCE   80,10         ;Prepare invoice
        LEAVE     Clerks
Invoice MATCH     Bicycle       ;Synchronize with bicycle
        TERMINATE               ;Transaction finished
*********************************************************************
Factory TRANSFER  FN,Orders     ;Route to correct dept.
*********************************************************************
Frame   ENTER     Framers
        ADVANCE   (Exponential(1,0,65)) ;Make frame
        ADVANCE   12,2          ;Inspect frame
        LEAVE     Framers
        TRANSFER  ,Build        ;Send for assembly
*********************************************************************
Saddle  ENTER     Saddlers
        ADVANCE   6,3           ;Get a saddle
        ADVANCE   3,1           ;Inspect the saddle
        LEAVE     Saddlers
        TRANSFER  ,Build        ;Send for assembly
*********************************************************************
Handlebars ENTER Handlers
        ADVANCE   4,2           ;Get handlebars
        ADVANCE   3,1           ;Inspect handlebars
        LEAVE     Handlers
        TRANSFER  ,Build        ;Send for assembly
*********************************************************************
Wheels  ENTER     Wheelers
        ADVANCE   3,1           ;Get wheels
        ADVANCE   3,1           ;Inspect wheels
        LEAVE     Wheelers
        TRANSFER  ,Build        ;Send for assembly
*********************************************************************
Pedals  ENTER     Pedalers
        ADVANCE   5,1           ;Get pedals
        ADVANCE   3,1           ;Inspect pedals
        LEAVE     Pedalers
        TRANSFER  ,Build        ;Send for assembly
*********************************************************************
Build   ASSEMBLE  5             ;Assemble
        ENTER     Builders
        ADVANCE   (Normal(1,90,10)) ;Time for assembling
        ADVANCE   35,5          ;Inspect
        LEAVE     Builders
Bicycle MATCH     Invoice       ;Wait for paperwork
        ENTER     Packers
        ADVANCE   40,5          ;Pack for dispatch
        LEAVE     Packers
        TABULATE  Transit
        TERMINATE               ;Transaction finished
*********************************************************************
        GENERATE  480           ;Timer every day
        TERMINATE 1             ;Timer xact finished
*********************************************************************

Transactions represent orders. When an order is received, a SPLIT Block creates a work order for each of five departments. Coordinated use of the FN mode TRANSFER Block labeled Factory, the Order Function Entity, and the serializing SPLIT Block automatically deliver department orders. Notice that the C operand of SPLIT first increments the parent Transactionís parameter to 1 and the newly created Transactions then have 2, 3, 4, 5, and 6 placed in the department parameter.

When all 5 suborders have been completed, they are combined at the ASSEMBLE Block labeled Build, a simulated delay represents the final assembly and pack steps, and the overall order completion time is tabulated.

The bottom model segment decrements the Termination Count once a day.

 

Running the Simulation

To run the simulation and create a Standard Report,

CHOOSE    File / Open

and in the dialog box

SELECT     Bicycle

and then

SELECT     Open

Next, create the simulation.

CHOOSE     Command / Create Simulation

then

CHOOSE    Command / START

and in the dialog box, replace the 1.

TYPE     5

SELECT    OK

The simulation will end when 5 Transactions have entered the TERMINATE 1 Block. This represents 5 days of operation.

When the simulation ends, GPSS World writes a report to the default report file, Bicycle.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 the simulation has been created and run giving an extension of 1.1.

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

 

Discussion of Results

The utilization of the staff in each department is given under the Util. column of the Storages subreport. The Clerks are busiest with a utilization of 78%. To determine the most desirable staff levels, we need to experiment with the Storage definitions.

The distribution of order transit times is given by the Table Transit. The average was about 235.5 minutes with a standard deviation of 51.2 minutes.

 

Inside the Simulation

Let us now explore the ending condition of the simulation, which generated the Standard Report above. If you are not at the end of the simulation, please translate the model and run it again.

First, letís open the Storages Window.

CHOOSE     Window / Simulation Window / Storages Window

This shows the utilization and current state of the 8 Storage Entities. Letís use the SHOW Command to look at some System Numeric Attributes. First, the time delay for clerical operations. In the Main Window menu

CHOOSE     Command / SHOW

and in the dialog box

TYPE     ST$Clerks

This is the average holding time per unit of the Storage Entity Clerks.

Next, use the SHOW Command to look at the time delays associated with each department. In all cases, there appears to be no significant queuing. In other words, the need for additional personnel in any department is not suggested by the results. Perhaps we could get by with fewer personnel.

It would be easy to insert QUEUE, DEPART, and QTABLE Blocks to collect more detailed statistics. The final word on the predicted effects of personnel changes would, of course, be based on full simulations of the proposed changes using multiple replications and statistical analysis before final conclusions are drawn.

Please feel free to modify the parameters and Blocks of this simulation. If you wish to go on to the next lesson, close all windows related to this model.

CLICK ON     The X-Upper Right of Each Window

Otherwise, to end the session

CLICK ON     The X-Upper Right of Main Window.

 

 

13. STOCKCTL.GPS

 

Simulation of a warehouse and branch inventories.

 

Problem Statement

A manufacturing company makes waste disposal units, which it sells for $200 each. Total annual demand is for 20,000 units. Distribution is through three branches, from a factory warehouse. The lead-time for delivery of an order, from the manufacturing plant to the factory warehouse, is 4 weeks. The lead-time for delivery of an order, from the factory warehouse to the branches is 1 week.

The proposed inventory control method is by an economic order quantity and order point system. The initial stocks, order points, economic order quantities, weekly demand and standard deviation, are shown in the table below, for the factory warehouse and each of the branches.

 

Inventory Control Parameters

Location   Initial    Order  Economic   Weekly   Weekly
            Stock     Point  Quantity   Demand   Std Dev

Warehouse    3400     2100     2300
Branch 1      430      240      115       64       24
Branch 2      600      430      165      128       32
Branch 3     1000      630      200      192       48

Simulate the inventory control system for 75 weeks.

1. Determine the distribution of inventories at the three branches and the factory warehouse.

2. Tabulate the distribution of actual monthly sales.

3. Calculate the average value of the inventories at the branches, and at the factory warehouse.

4. Does the system meet the companyís service policy of one stockout, in eight years?

 

Listing

; GPSS World Sample File - STOCKCTL.GPS, by Gerard F. Cummings
****************************************************************
* Factory Warehouse and Distributors Inventory 
* Time unit is one week 
****************************************************************
INITIAL X1,3400 ;Fact warehouse inventory
INITIAL X2,2100 ;Fact warehouse order pnt
INITIAL X3,2300 ;Fact warehouse order qty
INITIAL X$Stock1,430 ;Dist 1 stock initial
INITIAL X$Stock2,600 ;Dist 2 stock initial
INITIAL X$Stock3,1000 ;Dist 3 stock initial
INITIAL X$EOQ1,115 ;Economic order qty 1
INITIAL X$EOQ2,165 ;Economic order qty 2
INITIAL X$EOQ3,200 ;Economic order qty 3
INITIAL X$Point1,240 ;Order point 1
INITIAL X$Point2,430 ;Order point 2
INITIAL X$Point3,630 ;Order point 3
Demand1 VARIABLE (Normal(2,64,24))
Demand2 VARIABLE (Normal(3,128,32))
Demand3 VARIABLE (Normal(4,192,48))
Total VARIABLE P1+P2+P3
Sales TABLE X5,200,200,20
Region_1 TABLE X$Stock1,0,40,20
Region_2 TABLE X$Stock2,0,40,20
Region_3 TABLE X$Stock3,0,40,20
Factory TABLE X1,0,200,20
****************************************************************
* Reordering by Factory Warehouse
        GENERATE  ,,,1,2      ;Order point xact
Backhere TEST LE  X1,X2       ;Factory order point?
        ADVANCE   4           ;Lead time is 4 weeks
        SAVEVALUE 1+,X3       ;Inv increase by order qty
        TRANSFER  ,Backhere   ;Cycle xact around
****************************************************************
* Reordering at Each of the Distributors
        GENERATE  1,,,1       ;First distributor
Distr1  TEST L    X$Stock1,X$Point1 ;Order point reached?
        ADVANCE   1           ;Lead time = 1 week
        SAVEVALUE 1-,X$EOQ1   ;Warehouse supplies
        SAVEVALUE Stock1+,X$EOQ1 ;Distr invent increased
        TRANSFER  ,Distr1     ;Xact finished
        GENERATE  1,,,1       ;Second distributor
Distr2  TEST L    X$Stock2,X$Point2 ;Order point reached
        ADVANCE   1           ;Lead time = 1 week
        SAVEVALUE 1-,X$EOQ2   ;Warehouse supplies
        SAVEVALUE Stock2+,X$EOQ2 ;Inventory increased
        TRANSFER  ,Distr2     ;Cycle xact around
        GENERATE  1,,,1       ;Third distributor
Distr3  TEST L    X$Stock3,X$Point3 ;Order point reached?
        ADVANCE   1           ;Lead time = 1 week
        SAVEVALUE 1-,X$EOQ3   ;Warehouse supplies EOQ
        SAVEVALUE Stock3+,X$EOQ3 ;Distr invent increased
        TRANSFER  ,Distr3     ;Cycle xact around
****************************************************************
* Weekly Demand at Each Distributor
        GENERATE  1,,,,3      ;Priority weekly demand
        ASSIGN    1,V$Demand1 ;P1 = Demand distr one
        ASSIGN    2,V$Demand2 ;P2 = Demand distr two
        ASSIGN    3,V$Demand3 ;P3 = Demand distr three
        SAVEVALUE Stock1-,P1  ;Distr 1 Weekly demand
        SAVEVALUE Stock2-,P2  ;Distr 2 Weekly demand
        SAVEVALUE Stock3-,P3  ;Distr 3 Weekly demand
        SAVEVALUE 5+,V$Total  ;Accumulate total demand
        TABULATE  Region_1    ;Record invent distr 1
        TABULATE  Region_2    ;Record invent distr 2
        TABULATE  Region_3    ;Record invent distr 3
        TABULATE  Factory     ;Factory warehouse invent
        TERMINATE 1
****************************************************************
* Monthly Recording of Sales
        GENERATE  4,,,,1      ;Low priority xact monthly
        TABULATE  Sales
        SAVEVALUE 5,0         ;Reset sales=0 each month
        TERMINATE             ;Xact finished
****************************************************************

The model is organized into several segments. After non-Block Entities are defined, there are 7 more model segments. Transactions created in the top segment represent orders by the factory warehouse. Transactions in the next three segments represent orders from each of the three regional warehouses. Each Transaction in the next segment, represents customer orders in all three regions. Each regional demand is placed in a different Transaction parameter. This segment also times the simulation (in weeks) by decrementing the Termination Count. Transactions in the last segment record monthly sales.

Notice that nothing prevents inventories from becoming negative. The model is intended to test for stockouts, but not to simulate the delays involved with them. To incorporate these features into the simulation we could add TEST Blocks to test for orders which cannot be filled, or perhaps use Storage Entities to represent the inventories, as was done in the PERIODIC.GPS example.

 

Running the Simulation

To run the simulation and create a Standard Report,

CHOOSE     File / Open

and in the dialog box

SELECT     Stockctl

and then

SELECT     Open

Next, create the simulation.

CHOOSE     Command / Create Simulation

then

CHOOSE     Command / START

and in the dialog box, replace the 1.

TYPE     76

SELECT     OK

The simulation will end when 76 Transactions have entered the TERMINATE 1 Block. This represents 76 weeks of operation.

When the simulation ends, GPSS World writes a report to the default report file, Stockctl.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 the simulation has been created and run giving an extension of 1.1.

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

 

Discussion of Results

In the Standard Report, the inventory distributions are given by the Tables Region_1, Region_2, Region_3, and Factory. The average stock levels for these inventories were about 172, 269, 183, and 1831, respectively.

Monthly sales were tabulated in the Table Sales. The monthly average was about 1542.

The simulation did experience some stockouts at Distributor 3 (look at Table Region_3) during the 76 simulated weeks. You'll see that there were 7 entries in the 0 or less bucket. We would certainly want to do additional replications to determine if this result is due to random variation. To quantify the probability of no stockouts in 8 years, we could replicate an 8 year simulation several times, and use the Chi-square distribution to calculate an interval estimate.

 

Inside the Simulation

Letís now explore the ending condition of the simulation, which generated the Standard Report above. If you are not at the end of the simulation, please Retranslate the model and run it again.

Now, letís open a Table Window.

CHOOSE    Window / Simulation Window / Table Window

and in the drop-down box in the dialog box

CLICK ON     The Down Arrow at the end of the Table Name Box

and

CLICK ON     SALES

SELECT     OK

Here, we see the distribution of monthly sales. Now, letís look at Region_3 where the stockouts occurred.

CHOOSE     Window / Simulation Window / Table Window

and in the drop-down box in the dialog box

CLICK ON     The Down Arrow at the end of the Table Name Box

and

CLICK ON     REGION_3

SELECT     OK

It appears that stockouts occurred 7 times. We definitely need to pursue this further before we make any determinations on established inventory levels.

To view the inventory histograms, repeat the action you just completed substituting the name of each of the regions and then Factory for the last Table when asked for Table name in the dialog box.

The current scheme appears that it might need to be examined further. You might also want to look at the system under different customer demand load to see if changes may need to be made. You may want to simulate the effects of stockouts by adding your own Blocks to the simulation. You could easily collect statistics on order completion times by adding QUEUE, DEPART, and QTABLE Blocks.

Please feel free to modify the parameters and Blocks of this simulation.

If you wish to go on to the next lesson, close all windows related to this model.

CLICK ON     The X-Upper Right of Each Window

Otherwise, to end the session

CLICK ON     The X-Upper Right of Main Window.

 

 

14. LOCKSIMN.GPS

 

Lock and Canal Simulation.

 

Problem Statement

A single lock and narrow canal system joins two navigable waterways. The barge traffic is heavy between the two waterways, and the canal system can take only one barge at a time. The first barge in a particular direction takes 58 minutes, and subsequent barges in the same direction take 46 minutes.

The lock operator has a policy of one-up barge followed by one-down barge.

It has been suggested that a policy of up to six up, followed by up to six down might be more efficient.

Simulate the operation of the lock and canal with the new policy.

 

Listing

; GPSS World Sample File - LOCKSIMN.GPS, by Gerard F. Cummings
**********************************************************************
* Lock Simulation *
* Time in Hours *
**********************************************************************
* X$Uplimit = Number of barges to go up
* X$Downlimit = Number of barges to go down
* X$Upcount = Number of barges which have passed up
* X$Downcount = Number of barges which have passed down
*
RMULT 94521
Upbarge FUNCTION X$Upcount,D6
1,.967/2,.767/3,.767/4,.767/5,.767/6,.767
Downbarge FUNCTION X$Downcount,D6
1,.967/2,.767/3,.767/4,.767/5,.767/6,.767
Upq QTABLE Upq,.25,.25,20
Downq QTABLE Dnq,.25,.25,20
Upcount TABLE X$Upcount,2,2,20
Dncount TABLE X$Downcount,2,2,20
INITIAL X$Uplimit,6 ;No. of barges to go up
INITIAL X$Downlimit,6 ;No. of barges to go down
**********************************************************************
        GENERATE  1.67,.5,.67     ;Up barge arrives
        QUEUE     Upq             ;Join queue
        GATE LR   Lock            ;Gate for the lock
        SEIZE     Lock            ;Get the lock
        SAVEVALUE Upcount+,1      ;Accumulate up number
        DEPART    Upq             ;Depart the queue
        ADVANCE   FN$Upbarge      ;Time to service barge
        TEST GE   X$Uplimit,X$Upcount,Swh1 ;Have enough passed?
        TEST NE   Q$Upq,0,Swh1    ;Check if Upq is zero
        RELEASE   Lock            ;Free the lock
        TERMINATE
**********************************************************************
Swh1    LOGIC S   Lock            ;Set lock the other way
        RELEASE   Lock            ;Free the lock
        TABULATE  Upcount         ;Record no. passed up
        SAVEVALUE Upcount,0       ;Set count to zero
        TERMINATE
**********************************************************************
        GENERATE  1.67,.5,1       ;Arrival of down barge
        QUEUE     Dnq             ;Enter queue
        GATE LS   Lock            ;Is lock set?
        SEIZE     Lock            ;Get the lock
        SAVEVALUE Downcount+,1    ;Accumulate down count
        DEPART    Dnq             ;Depart the queue
        ADVANCE   FN$Downbarge    ;Time for down barge
        TEST GE   X$Downlimit,X$Downcount,Swh2 ;Down count reached?
        TEST NE   Q$Dnq,0,Swh2    ;Any down barges left?
        RELEASE   Lock            ;Free the lock
        TERMINATE
**********************************************************************
Swh2    LOGIC R   Lock           ;Set lock for other way
        RELEASE   Lock           ;Free the lock
        TABULATE  Dncount        ;Record down count

 

The model is organized into several segments. After the Tables are defined and Savevalues initialized, there are three more model segments. Transactions in the top segment represent barges moving in the upward direction, Transactions in the second segment represent barges moving in the downward direction, and bottom segment times the simulation by decrementing the Termination Count once per simulated day.

The direction of movement is controlled by the GPSS Logicswitch Lock. When it is reset (off), the direction of movement is upward. When it is set (on), the movement is downward. Each Transaction representing a barge tests to see if the direction should be changed. If the barge count limit has been reached, or if there are no more barges, the Transaction changes the Logicswitch Lock so that traffic may begin in the other direction. This model shows a scheduling policy allowing a maximum of 6 barges to pass in either direction. The Savevalues Uplimit and Downlimit are therefore set to 6. These can be altered interactively.

 

Running the Simulation

To run the simulation and create a Standard Report,

CHOOSE     File / Open

and in the dialog box

SELECT     Locksimn

and then

SELECT     Open

Next, create the simulation.

CHOOSE     Command / Create Simulation

then

CHOOSE     Command / START

and in the dialog box, replace the 1.

TYPE     7

SELECT     OK

The simulation will end when 7 Transactions have entered the TERMINATE 1 Block. This represents 7 days of operation.

When the simulation ends, GPSS World writes a report to the default report file, Locksimn.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 the simulation has been created and run giving an extension of 1.1.

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

 

Discussion of Results

The distributions of barge delays for each direction are given in the GPSS Tables Upq and Downq. In both cases, the average delay was about 1.3 hours.

The utilization of the lock was nearly 100%. This is evident from the statistics associated with the Facility Lock.

The actual number of barges which pass in each direction is tabulated in the Tables Upcount and Downcount.

 

Inside the Simulation

Letís now explore the ending condition of the simulation, which generated the Standard Report above. If you are not at the end of the simulation, please Retranslate the model and run it again.

Now, letís open some graphics windows.

CHOOSE     Window / Simulation Window / Table Window

and in the drop-down box in the dialog box

CLICK ON     The Down Arrow at the end of the Table Name Box

and

CLICK ON     UPCOUNT

SELECT     OK

This is the Tables Window for the Table UPCOUNT. This table shows the distribution of counts of consecutive barges passing in the upward direction. Now look at the Table UPQ.

CHOOSE     Window / Simulation Window / Table Window

and in the drop-down box in the dialog box

CLICK ON     The Down Arrow at the end of the Table Name Box

and

CLICK ON     UPQ

SELECT     OK

This Table shows the distribution of delay times of barges moving in the upward direction.

CHOOSE     Window / Simulation Window / Table Window

and in the drop-down box in the dialog box

CLICK ON     The Down Arrow at the end of the Table Name Box

and

CLICK ON     DOWNQ

SELECT     OK

This Table shows the distribution of delay times of barges moving in the downward direction.

CHOOSE     Window / Simulation Window / Table Window

and in the drop-down box you will see that DNCOUNT is already selected.

SELECT     OK

This Table shows the distribution of counts of consecutive barges passing in the downward direction.

Please feel free to modify the parameters and Blocks of this simulation. To change the maximum barge counts,

CHOOSE     Command / Clear

SELECT     OK

and then use INITIAL Commands in the Command / Custom menu option to set X$Uplimit and X$Downlimit to the upward and downward limits, respectively. Donít forget that the CLEAR Command zeroes all Savevalues and Matrices unless you use Off as the A operand of CLEAR.

You can then observe the effects of alternate traffic policies.

When you are done, if you wish to go on to the next lesson, close all windows except the Model Window.

CLICK ON     The X-Upper Right of Each Window

Otherwise,

CLICK ON     The X-Upper Right of Model Window.

 

 

 

15. FOUNDRY.GPS

 

Foundry Simulation

 

Problem Statement

A foundry employs 18 molders to process incoming orders which arrive on average every hour, exponentially distributed. The foundry runs on an eight hour day, five day week schedule. Thirty percent of incoming orders are new and seventy percent are repeat orders. New orders require a pattern, which is made in the pattern shop taking 72Ī24 hours, uniformly distributed. Patterns for repeat orders must be located and cleaned and take 5Ī3 hours.

Orders vary in size from 6 to 24 components, uniformly distributed. The weight of the individual components varies according to the following table.

Weight Distribution

Frequency       .05  .08  .12  .25  .20  .15  .10  .05

Weight of Part    3    6   11   20   28   35   42   50

Molding time is 2 minutes per kilogram weight of component. The due date for orders is determined by the total molding time plus a variable flowtime which typically ranges from 40 to 160 hours, uniformly distributed.

The foreman waits until the pattern is available for an order. Then he releases one job at a time according to due-date. One individual molder completes the entire order.

Casting takes place once a day, one hour before finishing time. When casting commences all molders cease molding and assist in the casting process.

1. Write a GPSS World model to simulate the operation of the foundry.

2. Run the simulation for 10 days.

3. Find the distribution of transit times of all jobs.

4. Tabulate the total weight cast each day.

Listing

; GPSS World Sample File - FOUNDRY.GPS, by Gerard F. Cummings
***********************************************************************
*
* Foundry Simulation Model
* Time Unit Is One Minute 
*
***********************************************************************
* P1 = Type of Job
* P2 = Number in the Order
* P3 = Weight of a Component
* P4 = Molding Time per Component
* P5 = Due Date
* P6 = Total Weight per Order
* P7 = Index for Looping
Weight FUNCTION RN1,C8 ;Weight per component in Kgs
0.0,3/.13,6/.25,11/.50,20/.70,28/.85,35/.95,42/1.0,50
Ordertype FUNCTION RN1,D2 ;New order P1=1: Repeat P1=2
0.3,1/1.0,2
Size VARIABLE RN1@19+6 ;Size of order
Ddate VARIABLE V$Mtime#P2+RN1@121+40+C1 ;Due date
Mtime VARIABLE (P3#2) ;Mold time per component
Day VARIABLE (C1/480) ;Day indicator
Total VARIABLE P3#P2 ;Weight per order
Times TABLE M1,400,400,20 ;Transit time
Cast TABLE X$Wtmold,400,400,20 ;Weight cast
Molders STORAGE 18 ;Molders employed
***********************************************************************
        GENERATE  (Exponential(1,0,60)) ;Jobs arrive every hour
        ASSIGN    1,FN$Ordertype ;Type of job
        TEST E    P1,2,Newjob   ;Is it a repeat order?
        ADVANCE   300,180       ;Locate pattern
Commence ASSIGN   2,V$Size      ;Size of order
        ASSIGN    3,FN$Weight   ;Weight of component
        ASSIGN    4,V$Mtime     ;Molding time per component
        ASSIGN    5,V$Ddate     ;Due date
        ASSIGN    6,V$Total     ;Total weight of order
        GATE SNF  Molders,Wait  ;Any molders free?
Beg     ENTER     Molders       ;Molder begins order
        ASSIGN    7,P2          ;P7=Number in order
Next    ADVANCE   P4            ;Molding time per component
        LOOP      7,Next        ;Loop for every component
        LEAVE     Molders       ;Free molder, order complete
        SAVEVALUE Wtmold+,P6    ;Sum weight molded each order
        UNLINK    1,Beg,1       ;Release next order
        TABULATE  Times         ;Tabulate transit time
        TERMINATE               ;Destroy xact
*
Newjob  ADVANCE   4320,1440     ;Time to make new pattern
        TRANSFER  ,Commence     ;Transfer to commence order
*
Wait    LINK      1,P5          ;Link waiting orders in chain 1
*
***********************************************************************
        GENERATE  420,,,1,2     ;Start casting operation cycle
Again   SUNAVAIL  Molders       ;Marks start of casting cycle
        ADVANCE   60            ;Casting cycle lasts 60 mins
        SAVAIL    Molders       ;Molders free for molding
        ADVANCE   420           ;420 mins elapse before casting
        TABULATE  Cast          ;Record total weight cast
        SAVEVALUE Totcast+,X$Wtmold ;Accumulate total cast so far
        SAVEVALUE Wtmold,0      ;Reset to zero each day
        TRANSFER  ,Again        ;Return xact to start again
**************Timer****************************************************
        GENERATE  4800,,,,4     ;Xact every ten days
        SAVEVALUE V$Day,X$Totcast ;Records total weight cast
        TERMINATE 1             ;Destroy xact
***********************************************************************

The model is organized into several segments. After the non-Block Entities are defined, there are three more model segments. Transactions in the top segment represent orders, those in the middle segment, the casting process, and those in the bottom segment time the simulation by decrementing the Termination Count every 10 simulated days. Also, Transactions in the bottom segment record the total weight cast.

Transactions representing orders in the top segment first determine if the order is a repeat order. If not, the Transaction jumps to encounter a longer preparation time. After the attributes of the order are assigned to Transaction parameters, the Transaction is caused to wait on Userchain 1 if there are no molders available. Otherwise, the order is processed by using a LOOP Block to cause a delay for every component. When the process is finished, the Transaction attempts to remove any waiting order from the Userchain before it is destroyed by a TERMINATE Block.

 

Running the Simulation

To run the simulation and create a Standard Report,

CHOOSE     File / Open

and in the dialog box

SELECT      Foundry

and then

SELECT      Open

Next, create the simulation.

CHOOSE     Command / Create Simulation

then

CHOOSE      Command / START

and in the dialog box, since 1 is what we want for a Termination Count

SELECT     OK

The simulation will end when a Transaction has entered the TERMINATE 1 Block. This represents 10 days of operation.

When the simulation ends, GPSS World writes a report to the default report file, Foundry.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 the simulation has been created and run giving an extension of 1.1.

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

 

Discussion of Results

The distribution of order completion times is given in the Table Times. The average completion time was about 779.4 minutes, with a standard deviation of 611.3.

The distribution of daily weight cast is given in the Table Cast. The average daily weight was 862.0 kilograms. The standard deviation was about 362.5 kilograms.

 

Inside the Simulation

Let 's now explore the ending condition of the simulation, which generated the Standard Report above. If you are not at the end of the simulation, please Retranslate the model and run it again.

Now, letís open some graphics windows.

CHOOSE      Window / Simulation Window / Storages Window

This is the Storages Window. It gives utilization and queuing information on the molders. They encountered a 22% utilization.

The histogram for order completion times can be seen in the Table TIMES and the Table CAST will tell us the daily weight cast.

CHOOSE     Window / Simulation Window / Table Window

and in the drop-down box in the dialog box

CLICK ON      The Down Arrow at the end of the Table Name Box

and

CLICK ON      TIMES

SELECT      OK

Notice that a few jobs had very long completion times. These may be worth further investigation. Perhaps they represent the new orders. It would be easy to tabulate new jobs and reorders separately. Multiple QUEUE/DEPART pairs could be used, as well.

To see the histogram of daily weight cast

CHOOSE     Window / Simulation Window / Table Window

and in the drop-down box in the dialog box, CAST is already showing.

SELECT      OK

Now, close the two Table Windows and the Storages Window. Then, letís watch the dynamics of the simulation.

CLICK ON      The X-Upper Right of Each Window

Now, open the Blocks Window.

CHOOSE      Window / Simulation Window / Blocks Window

Next, increase the size of the Blocks Window so you can see as much as possible of the total model.

CHOOSE      Command / START

and in the dialog box, replace the 1.

TYPE      10

SELECT      OK

When you get the feel for the flow of Transactions, interrupt the simulation and proceed to use the STEP Command to view the movement of Transactions through the model.

PRESS     [F4]

to halt the simulation

PRESS     [F5]

as many times as you wish to watch the Transactions move a Block at the time through the simulation. Make sure one of the visible windows has the focus when you are trying to Step. At the same time, watch the messages in the Journal that tell you about Transaction movement.

Your trace messages will accumulate in the Journal and when you are done you can save the contents to a file or print the contents directly to your printer. You could also minimize the Journal Window while you are concentrating on the Blocks Window and then retrieve it once you are done to print . If you save the Journal / Simulation Window, the simulation is saved in its current state.

Please feel free to modify the parameters and Blocks of this simulation.

When you are done, if you wish to go on to the next lesson, close all windows related to this model.

CLICK ON      The X-Upper Right of Each Window

Otherwise, to end the session

CLICK ON      The X-Upper Right of Main Window.

 

[Table of Contents]