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

16. TAPEPREP.GPS

Simulation of NC tape preparation.

Problem Statement

A computer services company prepares computer numerical control part program tapes for metal-cutting manufacturing industries. Drawings of components are supplied by the manufacturers. A part programmer studies the drawings, and writes a part program manuscript to control the machine tool in cutting the workpiece. The programming takes 90 minutes, exponentially distributed. The manuscript is then typed onto a computer file, processed, and a tape is punched for the computer numerical control machine tool. This process takes 60 minutes on average, exponentially distributed. The tape is then loaded onto an appropriate machine tool for testing and editing. This process takes 70 minutes, exponentially distributed.

The computer services company’s policy is to provide a fast, reliable service to industry. The company wishes to test several queuing disciplines for the processing of orders for the best overall service to customers.

Three possible disciplines of processing waiting jobs have been proposed.

1.First, process those jobs which have the shortest overall processing time.

2.First, process those jobs which have the longest overall processing time.

3.First, process the jobs which have the shortest due-date i.e. those jobs which are required soonest.

The flowtime for jobs is the total processing times (P4=P1+P2+P3), plus 3±1 days. The due-date is the relative clock time when the job arrives plus the allowed flow-time. Lateness is defined as the relative clock time when the job is completed, minus the due-date.

Simulate the processing of 100 orders by the computer services company.

1.Investigate the shortest processing time queue discipline.

2.Find the utilization of the facilities of manuscript writing, tape preparation, and editing.

3.Tabulate the lateness of orders and their transit times.

Listing

; GPSS World Sample File - TAPEPREP.GPS, by Gerard F. Cummings

*********************************************************************

**

*Computer Numerical Control *

*Tape Programming, Loading and Editing *

**

*********************************************************************

*Queue Discipline — Shortest Processing Time (SPT)

*********************************************************************

*P1 = Process Time for Programming

*P2 = " " " Punching

*P3 = " " " Editing

*P4 = Shortest Processing Time

*P5 = Due Date

* P6 = Longest Processing Time

*********************************************************************

RMULT 66753

Schedparm EQU 4 ;Start with short time ; process first

Var1 VARIABLE P1+P2+P3

Var2 VARIABLE P4+AC1+RN1@160+80 Var3 VARIABLE 10000-P4 Lateness VARIABLE AC1-P5

Transit TABLE M1,100,100,20 ;Tabulate flow times Late TABLE V$Lateness,-1000,200,20 ;Lateness

*********************************************************************

GENERATE (Exponential(2,0,120)) ;Create new arrivals ASSIGN 1,(Exponential(3,0,90) ;Programming time ASSIGN 2,(Exponential(4,0,60)) ;Tape punching time

ASSIGN 3,(Exponential(5,0,70)) ;Tape load and edit time ASSIGN 4,V$Var1 ;Total processing time

ASSIGN 5,V$Var2 ;Due date time in P5 ASSIGN 6,V$Var3 ;Longest processing time

LINK Program,P$Schedparm,Wrte ;Overall Shortest Wrte SEIZE Manuscript

ADVANCE P1 ;Part program time RELEASE Manuscript

UNLINK Program,Wrte,1 ;Unlink one xact

LINK Tape,P$Schedparm,Punch ;Link into chain Punch SEIZE Tapepunch

ADVANCE P2 ;Punching time RELEASE Tapepunch

UNLINK Tape,Punch,1 ;Unlink one xact

LINK Edit,P$Schedparm,Loadedit ;Link into chain Loadedit SEIZE Edit

ADVANCE P3 ;Load and edit time RELEASE Edit

UNLINK Edit,Loadedit,1 ;Unlink one xact

**********************************************************************

TABULATE Late TABULATE Transit

TERMINATE 1 ;Job leaves the shop

**********************************************************************

After the Functions, Tables, and Variables are defined, the model is composed of a single segment. Transactions represent jobs, in various stages of completion. Each Transaction tabulates its own completion time, then decrements the Termination Count.

The Table Transit is used to tabulate a histogram of job completion times, and the

Table Late tabulates the completion time minus the scheduled time. A late job, completed after its scheduled time, will register a positive value in the Late Table. An early job will register a negative value.

The named value Schedparm is used to specify which parameter, and therefore which scheduling policy, is to be used.

Running the Simulation

To run the simulation and create a Standard Report,

CHOOSE File / Open

and in the dialog box

SELECT TAPEPREP

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 100

SELECT OK

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

When the simulation ends, GPSS World writes a report to the default report file, Tapeprep.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 shortest time first policy led to a mean completion time of 393.38 minutes. However, 50% of the jobs were late. Perhaps the method of assigning due times should be investigated.

The utilizations of the Facilities of manuscript writing, tape preparation, and editing were 64.6%, 47.5%, and 49.6%, respectively.

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.

First, look at the average lateness.

CHOOSE Command / SHOW

and in the dialog box

TYPE TB$Late

Next, the standard deviation of lateness.

CHOOSE Command / SHOW

and in the dialog box

TYPE TD$Late

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 Right End of the Box

CLICK ON TRANSIT

SELECT OK

This is the Table Window for the Transit Table which shows the distribution of job completion times.

CHOOSE Window / Simulation Window / Table Window and in the dialog box you will see that Late is the selected Table

SELECT OK

Now we see the histogram of late times.

Let’s open the Expressions Window on some simulation values.

CHOOSE Window / Simulation Window / Expressions Window

The Edit Expressions 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 e to go from the first to the second box as GPSS World then assumes that all values have been entered. Now, in the dialog box for the Label field

TYPE Clock

and in the Expression field

TYPE AC1

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 Expressions Window 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.

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

TYPE # Left

and in the Expression field, replace the current value

TYPE TG1

CLICK ON View

CLICK ON Memorize

Finally, let’s keep track of the transactions on the Userchains.

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

TYPE # on Chain

and in the Expression field, replace the current value

TYPE CH$Tape

CLICK ON View

CLICK ON Memorize

SELECT OK

Let’s run a short simulation, observing the Facilities and the values in the Expressions Window. First, close all the other graphics windows that we are not going to observe. Make sure to leave open the Journal / Simulation Window.

CLICK ON The X-Upper Right of Each Window

CHOOSE Window / Simulation Window / Facilities Window

Open the Window to a comfortable viewing size and place it and the Expressions Window so each can be seen.

Figure 16—1. Facilities and Expressions Windows

Then,

CHOOSE Command / START

and in the dialog box, replace the 1.

TYPE 25,NP

SELECT OK

When the simulation completes, close both windows.

CLICK ON The X-Upper Right of Each Window

It is a simple matter to shift the simulation to an earliest due date first policy. Notice that there are ASSIGN Blocks after the first GENERATE Block that put the various processing times into parameters. The named value Schedparm has been set equal to 4 which indicated the parameter to be looked at in order to know which scheduling policy to use. Let’s use the due date policy this time.

CHOOSE Command / Custom

and in the dialog box

TYPE Schedparm EQU 5

SELECT OK

Then, use RESET to zero the statistics, but leave Transactions in the simulation. This will allow us to eliminate startup effects from the simulation. You should be sure when you do statistical comparisons with other runs that you have either eliminated startup effects or not consistently from one scenario to the next. From the Main Window menu,

CHOOSE Command / Reset

and

SELECT OK

CHOOSE Command / START

and in the dialog box, replace the 1.

TYPE 100

SELECT OK

Now the average completion time for the new policy is given by

CHOOSE Command / SHOW

and in the dialog box

TYPE TB$Late

SELECT OK

Similarly, we can change to a longest process time first policy by changing Schedparm to equal 6 and resetting the statistics with a RESET, as we did above.

Before we report the results of these simulations, we must show that the observed effects are not due to random variation. The RESET and ANOVA Commands are provided for that purpose. They are discussed in Chapter 6 of the GPSS World Reference Manual.

Please feel free to modify the scheduling policy of the company, and simulate the effects. You may want to review the use of the LINK and UNLINK Blocks before you proceed.

Let's take a look at one final graphics window before we conclude this lesson. We'll view the Userchains. These are available to view in a Snapshot Window. When you first ran the model, at the end of the run, there were no transactions on the Userchains. At this point, we'll see some. We will expand the Chains only one level. You can expand them all the way if you wish by clicking on the additinal plus signs. Remember that the Student Version does not support access to Snapshot Windows except the User Stops Window. The information about the Userchains can be obtained in the Standard Report.

CHOOSE Window / Simulation Snapshot / Userchains Window

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