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

SELECT OK

To see the utilizations and queuing statistics for the machine tools press

CHOOSE Window / Simulation Window / Facilities Window

The numbered Facilities represent AGV track segments. If you use the scroll bar to move to the bottom of the window, you will be able to display statistics for the machine tools.

Now let’s repeat the simulation using a single AGV, but first close up all graphics windows except the Table Window.

CLICK ON The X-Upper Right of Each Window

Next, we’ll redefine the Storage size.

CHOOSE Command / Custom

and in the dialog box

TYPE AGV Storage 1

SELECT OK

Then, we have to clear out the old statistics.

CHOOSE Command / CLEAR

and

SELECT OK

Now, start the simulation, making sure you can observe the Table "Transit" in the Table Window.

CHOOSE Command / START

and in the dialog box, replace the 1.

TYPE 15

SELECT OK

This result is a bit surprising! The average completion time went up only slightly when we removed an AGV!

We must be careful—we are certainly not yet justified in reporting that 1 AGV performs close to the way that 2 do. Perhaps we are only observing an effect due to random variation. The GPSS World ANOVA Command is provided to test the significance of results such as these. It is discussed in Lesson 13 of this manual and Chapter 6 of the GPSS World Reference Manual. If this result is sustained, it would appear that the use of 2 AGVs under these circumstances may be an unnecessary luxury.

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.

24. ETHERNET.GPS

Ethernet Model

A 10 Mbps Ethernet network is currently running satisfactorily with 100 workstations online. It has been determined that network traffic is composed of two classes of messages that are generated with the same proportion at all nodes.

The global message arrival pattern in the peak hour can be modeled as a Poisson process, with individual workstations chosen randomly.

We are to determine the effect on performance of adding an additional 100 workstations to the network.

; GPSS World Sample File - ETHERNET.GPS

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

*

*10 Mbps Ethernet Model

*(c) Copyright 1993, Minuteman Software.

*All Rights Reserved.

*

*

*

*Messages arrive exponentially, as one of two types: short

*or long. A Node is selected and held for the duration of

*message transmission and any collision backoffs.

*

*Each Node on the Ethernet is busy with a single message

*until it is sent, or after some number of collisions (with

*transmission attempts from other nodes) a permanent error

*is declared and the node is released.

*

*Time is in units of milliseconds. Nodes are presumed

*to be 2.5 m. apart. The node ID numbers are used to

*determine the separation distance when calculating

*the collision window. The propagation delay to an adjacent

*node is 0.01 microsecond. Each bit is transmitted in 0.1

*microsecond. The interframe gap is modelled by having the

*sender hold the Ethernet for an additional delay after it

*has sent its message.

*

*Messages are represented by GPSS Transactions. Nodes

*and the Ethernet are represented by GPSS Facilities. An

*additional Facility is used during jamming to prevent the

*startup of any new messages.

*

*A collision results from multiple transmission attempts

*at two or more nodes. The signal propagation delay

*prevents nodes from having simultaneous knowledge of

*each other, thereby leading to this possibility. The time

*interval until the signal from the other node can be

*detected is called the node’s "Collision Window".

*

*Collisions are represented by removing the transmitting

*Transaction from ownership of the Ethernet and sending it

*to a backoff routine. The new owner jams the Ethernet

*briefly and then goes through the backoff, itself. When a

*Transaction’s message is being sent, the transaction has

*ownership of the Ethernet Facility at priority 0, and can

*be PREEMPTed by Transactions which are at priority 1.

*When a Transaction is jamming, it has ownership of the

*Ethernet Facility at priority 1, and is never itself

*PREEMPTed.

*

*

*Arguments:

*1. Node_Count Number of Nodes 2.5 m. apart

*2. Min_Msg Bits

*3. Max_Msg Bits

*4. Fraction_Short_Msgs Parts per thousand

*5. Intermessage_Time Global Interarrivals

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

Node_Count EQU 100 ;Total Ethernet Nodes Intermessage_Time EQU 1.0 ;Avg. Global Arrival every msec.

Min_Msg EQU 512 ;The Shortest Message in bits

Max_Msg EQU 12144 ;The Longest Message in bits Fraction_Short_Msgs EQU 600 ;Short Msgs in parts per thousand Slot_Time EQU 0.0512 ;512 bit times

Jam_Time EQU 0.0032 ;32 bit times Backoff_Limit EQU 10 ;No more than 10 backoffs Interframe_Time EQU 0.0096 ;96 bit times

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

*

*Definitions of GPSS Functions and Variables.

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

Backoff_Delay VARIABLE Slot_Time#V$Backrandom ;Calc the Backoff Delay Backrandom VARIABLE 1+(RN4@((2^V$Backmin)-1))

Backmin VARIABLE (10#(10’L’P$Retries))+(P$Retries#(10’GE’P$Retries)) Node_Select VARIABLE 1+(RN3@Node_Count)

Collide VARIABLE ABS((X$Xmit_Node-P$Node_ID)/100000)’GE’(AC1-X$Xmit_Begin) Msgtime VARIABLE (0.0001)#V$Msgrand

Msgrand VARIABLE Min_Msg+(RN1’G’Fraction_Short_Msgs)#(Max_Msg-Min_Msg)

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

*The Message Delay Histogram

*

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

Msg_Delays QTABLE Global_Delays,1,1,20

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

*

*Main Body of Model

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

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

*Message Generation

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

GENERATE (Exponential(1,0,Intermessage_Time)) ;Single msg ; generator

ASSIGN Node_ID,V$Node_Select ;Acquire a Node ID. ASSIGN Message_Time,V$Msgtime ;Calc and Save XMIT Time.

ASSIGN Retries,0 ;No Collisions at start.

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

*Wait for the Node to finish any previous work.

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

QUEUE Global_Delays ;Start timing

SEIZE P$Node_ID ;Wait for, occupy, the Node. Try_To_Send PRIORITY 1 ;Don’t Lose Control

SEIZE Jam ;Wait for any RELEASE Jam ;Jam to end.

TEST E F$Ethernet,1,Start_Xmit ;If Ethernet Free, jump.

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

*The Ethernet is busy. We check to see if we are in the

*Sender’s "Collision Window". If so, this node would

*start transmitting anyway, since the carrier would not

*yet be sensed. In that case, we must initiate a Collision.

*

* If Prop Delay to Sender is >= Xmit Time up till now,

*collide.

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

TEST E V$Collide,1,Start_Xmit ;No Collision. Go ;Wait for it.

************************** Collision **********************************

Collision PREEMPT Ethernet,PR,Backoff,,RE ;Remove the old owner. SEIZE Jam ;Jam the Ethernet.

ADVANCE Jam_Time ;Wait the Jam Time. RELEASE Jam ;End the Jam.

RELEASE Ethernet ;Give up the Ethernet. PRIORITY 0 ;Back to Normal priority.

Backoff ASSIGN Retries+,1 ;Increment the Backoff Ct. TEST LE P$Retries,Backoff_Limit,Xmit_Error ;Limit

;retries.

ADVANCE V$Backoff_Delay ;Wait to initiate retry. TRANSFER ,Try_To_Send ;Go try again.

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

*Get the Ethernet, and start sending.

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

Start_Xmit SEIZE Ethernet ;Get Ethernet, wait if ; necessary

SAVEVALUE Xmit_Node,P$Node_ID ;Identify the sender. SAVEVALUE Xmit_Begin,AC1 ;Mark the start xmit time.

PRIORITY 0 ;Ensure we can be PREEMPTed.

ADVANCE P$Message_Time ;Wait until Msg. is sent. ADVANCE Interframe_Time ;Hold the Ethernet for gap.

RELEASE Ethernet ;Give up the Ethernet. Free_Node RELEASE P$Node_ID ;Give up the node

DEPART Global_Delays ; to the next msg. TERMINATE ;Destroy the Message.

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

Xmit_Error SAVEVALUE Error_Count+,1 ;Count the Error. TRANSFER ,Free_Node ; and get out of the way.

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

*Timer Segment

*

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

GENERATE 1000 ;Each Start Unit is 1 Second. TERMINATE 1

*

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

To run the simulation and create a Standard Report, in the Model Window

CHOOSE File / Open

and in the dialog box

SELECT ETHERNET

and then

SELECT Open

Next, create the simulation

CHOOSE Command / Create Simulation

Now, we open a histogram of message delays,

CHOOSE Window / Simulation Window / Table Window and in the drop-down box in the dialog box, MSG_DELAYS is already selected.

SELECT OK

Adjust the window so the histogram will be visible. O.K. Now, lets do some simulating.

CHOOSE Command / START and in the dialog box since 1 is the Termination Count we want,

SELECT OK

As the messages pass through the Ethernet, their durations are registered in the Qtable Msg_Delays, and we observe their accumulation in the histogram. The simulation will end when a second of activity has been simulated. From the Table Window we can see that the average message delay time was a little less than 1 millisecond.

When the simulation ends, GPSS World writes a report to the default report file, Ethernet.1.1. If you wish look at the report in the window now.

Discussion of Results

Let’s take a look at it. Move down to the utilization of the Facility Entity used to represent the Ethernet. Its utilization was a moderate 48%. Now, look at the entry count for the Block labeled Collisions. Apparently, there were only 3 collisions during the simulation. This comes out to 0.003 collisions per message.

It appears that the network is performing satisfactorily. Now let’s predict the effect of adding 100 more workstations.

CHOOSE Command / CLEAR

and

SELECT OK

Now we change the experimental parameters. We’ll do them both in a single Custom Command. First, the count of workstations.

CHOOSE Command / Custom

TYPE Node_Count EQU 200

PRESS e

Next, in the second line, the global message interarrival time.

TYPE Intermessage_Time EQU 1.0#(100/200)

SELECT OK

Now, we will simulate the new conditions.

CHOOSE Command / START and in the dialog box since 1 is the Termination Count we want,

SELECT OK

As you can see in the Table Window, a large proportion of the messages is experiencing delays due to collision backoffs. The average message delay has skyrocketed to over 14 milliseconds.

In a real study, of course, we would simulate much longer, and we would run an Analysis of Variance to establish statistical significance.

Although there is still another step to take from average message delay to performance as perceived by the end user, we would have to conclude that there appear to be serious performance problems in store for this network, if the projected 100 workstations were brought online.

The next step would be to consider, and simulate, the effects of various remedial actions. Let’s look at the report produced after we altered the model.

When the simulation ends, GPSS World writes a report to the default report file, Ethernet.1.1. As discussed in Chapter 1, the Report extension will vary depending on saved simulations and previously existing reports. Since this is the second report, the extension produced by this simulation should be 1.2.

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.

Your formatted Standard Report from the second run should look like this:

GPSS World Simulation Report - ETHERNET.1.2

Tuesday, June 6, 2000 10:23:06

START TIME END TIME BLOCKS FACILITIES STORAGES 0.000 1000.000 35 202 0

NAME VALUE BACKMIN 10011.000 BACKOFF 18.000

BACKOFF_DELAY 10009.000 BACKOFF_LIMIT 10.000 BACKRANDOM 10010.000 COLLIDE 10014.000 COLLISION 12.000 ERROR_COUNT 10031.000 ETHERNET 10025.000 FRACTION_SHORT_MSGS 600.000 FREE_NODE 29.000 GLOBAL_DELAYS 10021.000 INTERFRAME_TIME 0.010 INTERMESSAGE_TIME 0.500 JAM 10024.000

JAM_TIME 0.003 MAX_MSG 12144.000 MESSAGE_TIME 10022.000 MIN_MSG 512.000 MSGRAND 10019.000 MSGTIME 10018.000 MSG_DELAYS 10020.000 NODE_COUNT 200.000 NODE_ID 10016.000 NODE_SELECT 10013.000 RETRIES 10012.000 SLOT_TIME 0.051 START_XMIT 22.000 TRY_TO_SEND 7.000 XMIT_BEGIN 10017.000 XMIT_ERROR 32.000 XMIT_NODE 10015.000

LABEL LOC BLOCK TYPE ENTRY COUNT CURRENT COUNT RETRY 1 GENERATE 1941 0 0

2 ASSIGN 1941 0 0

3 ASSIGN 1941 0 0

4 ASSIGN 1941 0 0

5 QUEUE 1941 24 0

6 SEIZE 1917 0 0

TRY_TO_SEND 7 PRIORITY 2345 0 0 8 SEIZE 2345 0 0

9 RELEASE 2345 0 0

10 TEST 2345 0 0

11 TEST 2300 76 0

COLLISION 12 PREEMPT 214 0 0 13 SEIZE 214 0 0

14 ADVANCE 214 0 0

15 RELEASE 214 0 0

16 RELEASE 214 0 0

17 PRIORITY 214 0 0

BACKOFF 18 ASSIGN 428 0 0 19 TEST 428 0 0

20 ADVANCE 428 0 0

21 TRANSFER 428 0 0 START_XMIT 22 SEIZE 2055 0 0 23 SAVEVALUE 2055 0 0

24 SAVEVALUE 2055 0 0

25 PRIORITY 2055 0 0

26 ADVANCE 2055 1 0

27 ADVANCE 1840 0 0

28 RELEASE 1840 0 0 FREE_NODE 29 RELEASE 1840 0 0 30 DEPART 1840 0 0

31 TERMINATE 1840 0 0 XMIT_ERROR 32 SAVEVALUE 0 0 0 33 TRANSFER 0 0 0

34 GENERATE 1 0 0

35 TERMINATE 1 0 0

FACILITY ENTRIES UTIL. AVE. TIME AVAIL. OWNER PEND INTER RETRY DELAY 1 13 0.287 22.064 1 1691 0 0 0 1 2 5 0.036 7.287 1 1913 0 0 0 0 3 10 0.135 13.452 1 0 0 0 0 0 4 13 0.182 14.028 1 1751 0 0 0 1 5 13 0.233 17.929 1 0 0 0 0 0 6 8 0.105 13.147 1 0 0 0 0 0 7 9 0.096 10.641 1 0 0 0 0 0 8 12 0.173 14.411 1 0 0 0 0 0 9 8 0.064 7.948 1 1901 0 0 0 0

10 7 0.079 11.352 1 1894 0 0 0 0 JAM 2559 0.001 0.000 1 0 0 0 0 0

ETHERNET 2269 0.977 0.430 1 1882 0 0 0 76

QUEUE MAX CONT. ENTRY ENTRY(0) AVE.CONT. AVE.TIME AVE.(-0) RETRY GLOBAL_DELAYS 104 101 1941 0 29.444 15.170 15.170 0

TABLE MEAN STD.DEV. RANGE RETRY FREQUENCY CUM.% MSG_DELAYS 14.351 16.105 0

_ - 1.000 72 3.91 1.000 - 2.000 125 10.71 2.000 - 3.000 145 18.59 3.000 - 4.000 110 24.57 4.000 - 5.000 120 31.09 5.000 - 6.000 99 36.47 6.000 - 7.000 73 40.43 7.000 - 8.000 83 44.95 8.000 - 9.000 82 49.40 9.000 - 10.000 71 53.26

10.000 - 11.000 71 57.12

11.000 - 12.000 72 61.03

12.000 - 13.000 56 64.08

13.000 - 14.000 70 67.88

14.000 - 15.000 46 70.38

15.000 - 16.000 23 71.63

16.000 - 17.000 22 72.83

17.000 - 18.000 19 73.86

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