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

21. SHIPPORT.GPS

Simulation of a port.

A harbor port has three berths 1, 2 and 3. At any given time Berth1 can accommodate two small ships, or one medium ship. Berth2 and Berth3 can each handle one large ship, two medium ships or four small ships.

The interarrival time of ships is 26 hours, exponentially distributed, and small, medium, and large ships are in the proportions 5:3:2 respectively. Queuing for berths is on a first come first served basis, except that no medium or small ship may go to a berth for which a large ship is waiting, and medium ships have a higher priority than small ships.

Unloading times for ships are exponentially distributed with mean times as follows: small ships, 15 hours; medium ships, 30 hours; and large ships, 45 hours. The loading times are as follows:

Small ships 24±6 hours uniformly distributed.

Medium ships 36±10 hours uniformly distributed.

Large ships 56±12 hours uniformly distributed.

The tide must be high for large ships to enter or leave Berths 2 and 3. Low tide lasts 3 hours, high tide, 10 hours.

1.Run the simulation for 500 days.

2.Determine the distribution of transit times of each type of ship.

3.Determine the utilization of the three berths.

;GPSS World Sample File - SHIPPORT.GPS

;Based on a model by Gerard F. Cummings

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

* *

* Ship and Port Simulation * * Time in in Hours *

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

Berth1 EQU 1 Berth2 EQU 2 Berth3 EQU 3 Tide EQU 1 Tsmall EQU 1 Tmedium EQU 2 Tlarge EQU 3

*

*———Boolean Variables———————————————————————

Var1 BVARIABLE (R$Berth2’GE’1+R$Berth3’GE’1)#Q3’E’0 Var2 BVARIABLE R$Berth2’GE’1

Var3 BVARIABLE R$Berth3’GE’1 Var4 BVARIABLE SE$Berth1

Var5 BVARIABLE (R$Berth2’GE’2+R$Berth3’GE’2)#Q3’E’0 Var6 BVARIABLE R$Berth2’GE’2

Var7 BVARIABLE R$Berth3’GE’2 Var8 BVARIABLE SE$Berth3#LS1 Var9 BVARIABLE SE$Berth2#LS1

*

*—Size of Berths in relation to small ships————————————— Berth1 STORAGE 2

Berth2 STORAGE 4 Berth3 STORAGE 4

*

*————Table Definations—————————————————————— Tsmall TABLE M1,30,10,20 ;Small ship transit time Tmedium TABLE M1,30,10,20 ;Medium ship transit time Tlarge TABLE M1,30,10,20 ;Large ship transit time

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

*

*————Day Timer——————————————————————————

GENERATE 24 ;One xact each day TERMINATE 1 ;Clock operates once/day

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

*

*————Tide Control———————————————————————— GENERATE ,,0,1

Again LOGIC R Tide ;Cycling xact models ; the tide

ADVANCE 3 ;Tide is low for 3 hours LOGIC S Tide ;Tide comes in ADVANCE 10 ;Tide is high for 10 hrs

TRANSFER ,Again ;Branch back to ‘Again’

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

GENERATE (Exponential(1,0,26)) ;A ship every 26 hrs. TRANSFER 500,,Inter ;50 % are small

*

*———Characteristics of small ships are assigned to parameters—— ASSIGN Size,1 ;Type ship small, size=1

ASSIGN Capacity,1 ;Capacity P2=1 ; Small ship

ASSIGN Quenum,1 ;Queue #1 for ; small ships

ASSIGN M_Unload,15 ;Mean unload time ASSIGN M_Load,24 ;Mean load time ASSIGN Loadsp,6 ;Load time spread QUEUE P$Quenum ;Join queue-small ships TRANSFER Both,Pier1,Pier2

*———Assign Berth 1 When Available———————————————— Pier1 GATE SNF Berth1

ASSIGN Berth_Num,1 ;Berth obtained=Berth1

*———Move into Berth and Unload and Load————————————— Small ENTER P$Berth_num,P$Capacity ;Enter berth using up ; ship capacity

DEPART P$Quenum ;Depart queue

ADVANCE P$M_Unload,(Exponential(1,0,1)) ;Unload time ADVANCE P$M_Load,P$Loadsp ;Loading time

TEST E P$Size,3,Skipit ;A large ship?

*———When Switch is Set, Tide is High——————————————— GATE LS Tide ;Wait for tide

Skipit LEAVE P$Berth_Num,P$Capacity ;Leave berth by ; ship capacity

TABULATE P$Quenum ;Tabulate transit time ; by ship type

TERMINATE ;Ship sails

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

*———Assign Berth 2 or Berth 3 when available(dependent—————— * on the ship configuration

Pier2 TEST E BV$Var1,1 ;Small ship tries 2 or 3 TRANSFER Both,Bert2,Bert3 ;Try berth2 or berth3 Bert2 TEST E BV$VAR2,1 ;Berth2 available?

ASSIGN Berth_Num,2 ;Assigned to berth2 TRANSFER ,Small

Bert3 TEST E BV$Var3,1 ;Berth3 available?

ASSIGN Berth_Num,3 ;Assigned to berth3

TRANSFER ,Small

*

*———Characteristics of medium ships are assigned to parameters—— Inter TRANSFER 400,,Large ;20% of all ships

; are large

PRIORITY 2 ;All medium ships ; enter here

ASSIGN Size,2 ;Type ship medium, ; Size=2

ASSIGN Capacity,2 ;Capacity = 2 ; Medium ship

ASSIGN Quenum,2 ;Queue 2 for med ships ASSIGN M_Unload,30 ;Mean unload time ASSIGN M_Load,36 ;Mean load time ASSIGN Loadsp,10 ;Load time spread QUEUE P$Quenum ;Join queue for small

; ships

TRANSFER Both,Quay1,Quay2

Quay1 TEST E BV$Var4,1 ;Try for berth1 ASSIGN Berth_Num,1 ;Assigned to berth1 TRANSFER ,Small ;Transfer for processing Quay2 TEST E BV$Var5,1 ;Try for berth 2 or 3 TRANSFER Both,,Quay3 ;Try berth2 first

TEST E BV$Var6,1 ;Is berth2 available? ASSIGN Berth_Num,2 ;Gets berth2 TRANSFER ,Small ;Transfer for processing Quay3 TEST E BV$Var7,1 ;Try for berth3 ASSIGN Berth_Num,3 ;Assigned to berth3 TRANSFER ,Small ;Transfer for

;unload/load

*

*———Characteristics of large ships are assigned to parameters—— Large PRIORITY 3 ;All large ships

;enter here

ASSIGN Size,3 ;Type ship large, Size=3 ASSIGN Capacity,4 ;Capacity=4 Large ship ASSIGN Quenum,3 ;Queue number 3 for

; large ships

ASSIGN M_Unload,45 ;Mean unload time ASSIGN M_Load,56 ;Mean load time ASSIGN Loadsp,12 ;Load time spread QUEUE P$Quenum ;Join queue for

; large ships

TRANSFER Both,First,Second ;Try Berth3 and Berth2 First TEST E BV$Var8,1 ;Try Berth3 first

ASSIGN Berth_Num,3 ;Berth number=3 ; Entered Berth3

TRANSFER ,Small ;Transfer for ; unload/load

Second TEST E BV$Var9,1 ;Try berth2 second ASSIGN Berth_Num,2 ;Berth number=2

; Entered Berth2

TRANSFER ,Small ;Transfer for

; unload/load

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

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 time the simulation and decrement the Termination Count once per simulated day. A single transaction circulates in the middle segment to represent the ebb and flow of the tides. This affects the accessibility of the berths. Transactions in the bottom segment represent ships. Each is given attributes according to the size of the ship it represents. It then waits for a suitable berth, exchanges cargo, and leaves the port.

There are 9 Boolean variables, or GPSS Bvariable Entities, defined in the beginning of the model. Boolean Variables return a value of 1 or 0 when evaluated. When the value of the BVARIABLE expression is 0 a 0 result is returned, otherwise a value of 1 is returned. The following list contains the interpretation of the BVARIABLES in this model.

Boolean Variables Used in SHIPPORT.GPS

Variable Value Interpretation name returned

Var1 0 No space in Berth 2 and 3 or large ship waiting.

1 Space in Berth 2 or 3 and no large ship waiting.

Var2 0 Berth 2 is full.

1 There is space in Berth 2.

Var3 0 Berth 3 is full.

1 Space is available in Berth 3.

Var4 0 Some space used in Berth 1, no room for medium ship.

1 Berth 1 is completely available, room for medium ship.

Var5 0 Space not available for a medium ship or large ship waiting.

1 Space available for a medium ship and no large ship waiting.

Var6 0 Space not available for medium ship in Berth 2.

1 Space available for medium ship in Berth 2.

Var7 0 Space not available for medium ship in Berth 3.

1 Space available for medium ship in Berth 3.

Var8 0 Space not available for large ship in Berth 3 or tide not in.

1 Space available for large ship in Berth 3 and tide in.

Var9 0 Space not available for large

ship in

Berth 2 or tide

not

in.

1 Space

available for large

ship in

Berth 2

and tide is in.

 

 

The logic of the SHIPPORT.GPS model is depicted below.

Figure 21—1. The Logic of the Shipport Model.

Running the Simulation

To run the simulation and create a Standard Report,

CHOOSE File / Open

and in the dialog box

SELECT SHIPPORT

and then

SELECT Open

Next, create the simulation

CHOOSE Command / Create Simulation

then

CHOOSE Command / START

and in the dialog box, replace the 1.

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