Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Gpss tutorial.pdf
Скачиваний:
323
Добавлен:
15.04.2015
Размер:
1.4 Mб
Скачать

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

6

11

20

28

35

42

50

 

Part

3

 

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.3 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 861.9 kilograms. The standard deviation was about 362.4 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 21% 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

Then position the Model Window so that you can see the menu and move it to the top of the screen. 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 OK to use the STEP Command to view the movement of Transactions through the model.

PRESS o

to halt the simulation

PRESS p

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.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]