ONLINEIRAN.IR Close
تبلیغات در بلاگ اسکای
پنجشنبه 31 خرداد ماه سال 1386

1. TURNSTIL.GPS

Simulation of a turnstile at a football stadium.

Problem Statement

Spectators arrive at a turnstile of a football stadium every 7±7 seconds and queue for admittance. The time to pass through is evenly distributed at 5±3 seconds.A model is required to determine the time taken by 300 people to pass through the turnstile.

Listing
In_use EQU 5 ;Mean time
Range EQU 3 ;Half range

        GENERATE  7,7           ;People arrive
        QUEUE     Turn          ;Enter queue
        SEIZE     Turn          ;Acquire turnstile
        DEPART    Turn          ;Depart the queue
        ADVANCE   In_use,Range  ;Use turnstile
        RELEASE   Turn          ;Leave turnstile
        TERMINATE 1             ;One spectator enters

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

2. TELEPHON.GPS

Simulation of a simple telephone system.

A simple telephone system has two external lines. Calls, which originate externally, arrive every 100±60 seconds. When the line is occupied, the caller redials after 5±1 minutes have elapsed. Call duration is 3±1 minutes. A tabulation of the distribution of the time each caller takes to make a successful call is required. How long will it take for 200 calls to be completed?

Listing

* Simple Telephone Simulation 
* Time Unit is one minute 
Sets STORAGE 2
Transit TABLE M1,.5,1,20 ;Transit times
GENERATE 1.667,1 ;Calls arrive
Again GATE SNF Sets,Occupied ;Try for a line
ENTER Sets ;Connect call
ADVANCE 3,1 ;Speak for 3+/-1 min
LEAVE Sets ;Free a line
TABULATE Transit ;Tabulate transit time
TERMINATE 1 ;Remove a Transaction
Occupied ADVANCE 5,1 ;Wait 5 minutes
TRANSFER ,Again ;Try again
**************************************************************

3. PERIODIC.GPS

Simulation of inventory with periodic review.A finished product inventory is controlled by means of a weekly periodic review system. The initial stock is 1000 units. The daily demand varies between 40 and 63 units with equal probability. The target inventory is 1000 units, that is, the order is placed for the difference between the current stock and 1000 units. If the current stock is 800 or more, no order is placed for that week. The company operates a five-day week. The lead time for delivery of an order is one week.

Simulate the inventory system for 200 days and determine if any stockouts occur.

Listing

* Definitions of non Block entities
RMULT 39941
Stock STORAGE 10000 ;Warehouse can hold 10000
Stock TABLE S$Stock,100,100,20 ;Table for inventory amts
Orderqty VARIABLE Target-S$Stock ;Order quantity
Demand VARIABLE RN1@24+40 ;Daily demand
Target EQU 1000 ;Initial stock level
Reorder EQU 800 ;Reorder point
***********************************************************************
* The reorder process
        GENERATE  5,,,,1       ;Review xact, Priority=1
        TEST L    S$Stock,Reorder,Skip ;Is stock < Reorderpt
        ASSIGN    2,V$Orderqty ;Parameter 2=Order quantity
Custwait ADVANCE  5            ;Lead time is 5 days
        ENTER     Stock,P2     ;Stock increases by P2
Skip    TERMINATE              ;Ordering xact is finished
***********************************************************************
* The daily demand decrements quantity on hand
        GENERATE  1            ;Daily demand Transaction
        ASSIGN 1,V$Demand      ;Parameter 1(P1)=daily demand
        TABULATE  Stock        ;Record daily stock
        TEST GE   S$Stock,P1,Stockout ;Can order be filled
        LEAVE     Stock,P1     ;Remove demand from stock
        TERMINATE 1            ;Daily timer
Stockout TERMINATE 1           ;Daily timer
***********************************************************************
* Initialize the inventory
        GENERATE ,,,1,10       ;Set initial stock
        ENTER     Stock,Target ;Set init stock level=target
        TERMINATE              ;Xact is terminated
*********************************************************************

4. TVREPAIR.GPS

Simulation of a television repair shop.

A television shop employs a single repairman to overhaul its rented television sets, service customers’ sets and do on-the-spot repairs. Overhaul of company owned television sets commences every 40±8 hours and takes 10±1 hours to complete. On-the-spot repairs, such as fuse replacement, tuning and adjustments are done immediately. These arrive every 90±10 minutes and take 15±5 minutes. Customers’ television sets requiring normal service arrive every 5±1 hours and take 120±30 minutes to complete. Normal service of television sets has a higher priority than the overhaul of company owned, rented sets.

1. Simulate the operation of the repair department for 50 days.

2. Determine the utilization of the repairman and the delays in the service to customers.

Listing

; GPSS World Sample File - TVREPAIR.GPS, by Gerard F. Cummings
*****************************************************************
* Television Maintenance Man Model *
*****************************************************************
* Repair of rented sets, one each week *
* Time unit is one minute *
*****************************************************************
        GENERATE  2400,480,,,1 ;Overhaul of a rented set
        QUEUE     Overhaul     ;Queue for service
        QUEUE     Alljobs      ;Collect global statistics
        SEIZE     Maintenance  ;Obtain TV repairman
        DEPART    Overhaul     ;Leave queue for man
        DEPART    Alljobs      ;Collect global statistics
        ADVANCE   600,60       ;Complete job 10+/-1 hours
        RELEASE   Maintenance  ;Free repairman
        TERMINATE              ;Remove one Transaction
*****************************************************************
* On the spot repairs
        GENERATE  90,10,,,3    ;On-the-spot repairs
        QUEUE     Spot         ;Queue for spot repairs
        QUEUE     Alljobs      ;Collect global statistics
        PREEMPT   Maintenance,PR ;Get the TV repairman
        DEPART    Spot         ;Depart the ‘spot’ queue
        DEPART    Alljobs      ;Collect global statistics
        ADVANCE   15,5         ;Time for tuning/fuse/fault
        RETURN    Maintenance  ;Free maintenance man
        TERMINATE
****************************************************************
* Normal repairs on customer owned sets
        GENERATE  300,60,,,2   ;Normal TV Repairs
        QUEUE     Service      ;Queue for service
        QUEUE     Alljobs      ;Collect global statistics
        PREEMPT   Maintenance,PR ;Preempt maintenance man
        DEPART    Service      ;Depart the ‘service’ queue
        DEPART    Alljobs      ;Collect global statistics
        ADVANCE   120,30       ;Normal service time
        RETURN    Maintenance  ;Release the man
        TERMINATE
*****************************************************************
        GENERATE  480          ;One xact each 8 hr. day
        TERMINATE 1            
* Day counter
*****************************************************************
* Tables of queue statistics
Overhaul QTABLE Overhaul,10,10,20
Spot QTABLE Spot,10,10,20
Service QTABLE Service,10,10,20
Alljobs QTABLE Alljobs,10,10,20
****************************************************************

5. QCONTROL.GPS

Simulation of a quality control system.

Problem Statement

A component is manufactured by a sequence of three processes, each followed by a short two minute inspection. The first process requires 20% of components to be reworked. The second and third processes require 15% and 5% of components reworked, respectively. Sixty percent of components reworked are scrapped and the remaining forty percent need reprocessing on the process from which they were rejected.

Manufacturing of a new component commences on average, every 30 minutes, exponentially distributed. The time for the first process is given by the following table.

Time For First Process

Frequency         .05     .13     .16     .22     .29     .15
Process time       10     14      21   32     38    45

The second process takes 15±6 minutes and the final process time is normally distributed with a mean of 24 minutes and a standard deviation of 4 minutes.

1. Simulate the manufacturing processes for 100 completed components.

2. Determine the time taken, and the number of components rejected.

Listing

*****************************************************************
RMULT 93211
* Definitions
Transit TABLE M1,100,100,20 ;Transit Time
Process FUNCTION RN1,D7
0,0/.05,10/.18,14/.34,21/.56,32/.85,38/1.0,45
*****************************************************************
        GENERATE  (Exponential(1,0,30))
        ASSIGN    1,FN$Process    ;Process time in P1
Stage1  SEIZE     Machine1
        ADVANCE   P1              ;Process 1
        RELEASE   Machine1
        ADVANCE   2               ;Inspection
        TRANSFER  .200,,Rework1   ;20% Need rework
*****************************************************************
Stage2  SEIZE     Machine2
        ADVANCE   15,6            ;Process 2
        RELEASE   Machine2
        ADVANCE   2               ;Inspection
        TRANSFER  .150,,Rework2   ;15% Need rework
*****************************************************************
Stage3  SEIZE     Machine3
        ADVANCE   (Normal(1,24,4)) ;Process 3
        RELEASE   Machine3
        ADVANCE   2               ;Inspection 3
        TRANSFER  .050,,Rework3   ;5% need rework
        TABULATE  Transit         ;Record transit time
        TERMINATE 1
*****************************************************************
Rework1 TRANSFER  .400,,Stage1
        TERMINATE
Rework2 TRANSFER  .400,,Stage2
        TERMINATE
Rework3 TRANSFER  .400,,Stage3
        TERMINATE

6. ORDERPNT.GPS
Simulation of an order point inventory system.

An inventory system is controlled by an order point, set at 600 units, and an economic order quantity of 500 units. The initial stock quantity is 700. Daily demand is in the range 40 to 63 units, evenly distributed. The lead-time from ordering to delivery of goods is one week (5 days)Simulate the inventory system for a period of 100 days.Determine the distribution of inventory and the actual daily sales.

Listing

* Initialize and define
INITIAL X$EOQ,500 ;Economic order qty.
INITIAL X$Point,600 ;Order point
INITIAL X$Stock,700 ;Set initial stock=700
Inventory TABLE X$Stock,0,50,20 ;Table of stock levels
Sales TABLE P$Demand,38,2,20 ;Table of sales levels
Var2 VARIABLE RN1@24+40
*********************************************************************
GENERATE ,,,1
Again TEST L X$Stock,X$Point ;Order placed on successful test
ADVANCE 5 ;Lead time = 1 week
SAVEVALUE Stock+,X$EOQ ;Economic order
TRANSFER ,Again ;Cycle transaction again
*********************************************************************
        GENERATE  1             ;Daily demand xact
        ASSIGN    Demand,V$Var2 ;Assign daily demand
        TABULATE  Inventory     ;Record inventory
        TEST GE   X$Stock,P$Demand ;Make sure order can be filled
        SAVEVALUE Stock-,P$Demand ;Remove demand from stock
        SAVEVALUE Sold,P$Demand ;X$Sold=Daily demand
        TABULATE  Sales         ;Record daily sales
        TERMINATE 1             ;Daily timer
*********************************************************************

7. MANUFACT.GPS

Simulation of an electronics manufacturing system.

A manufacturing department of an electronics company makes digital watches. In the dispatch department, the watches are packed by an automatic packing machine, in display packets, in the quantities ordered by retailers. The order size is given by the following function.

Order Size

Frequency         .10      .25      .30      .15      .12      .05      .03
Order Size          6        12       18       24       30       36       48

The mean time between order arrivals is 15 minutes, exponentially distributed. The packing time per order is 120 seconds plus 10 seconds per watch packed in the order. The manufacturing department produces the digital watches in lot sizes of 60 units, in 455 minutes.

Simulate 5 days of the company operation to provide the following information:

1. The average number of orders waiting in the packing department.

2. The quantity of watches dispatched each day.

3. The distribution of transit times of orders.

Listing

* Time Unit is one hour *
Sizeorder FUNCTION RN1,D7               ;Order size
.10,6/.35,12/.65,18/.80,24/.92,30/.97,36/1.0,48
Transit TABLE    M1,.015,.015,20        ;Transit time
Numbe r TABLE    X1,100,100,20          ;No. packed each day
Ptime   VARIABLE .0028#P1+0.0334        ;Packing time
Amount  EQU      1000                   ;Initial stock amount
Stock   STORAGE  4000                   ;Warehouse holds
                                        ; 4000 units
***********************************************************************
        GENERATE (Exponential(1,0,0.25)) ;Order arrives
        ASSIGN   1,1,Sizeorder          ;P1=order size
        TEST GE  S$Stock,P1,Stockout    ;Is stock sufficient?
        LEAVE    Stock,P1               ;Remove P1 from stock
        QUEUE    Packing
        SEIZE    Machine                ;Get a machine
        DEPART   Packing
        ADVANCE  V$Ptime                ;Packing time
        RELEASE  Machine                ;Free the machine
        SAVEVALUE 1+,P1                ;Accumulate no. packed
        TABULATE Transit               ;Record transit time
        TERMINATE
Stockout TERMINATE
***********************************************************************
        GENERATE  0.75,0.08334,1       ;Xact every 40+/-5 mins
        ENTER     Stock,60             ;Make 60, Stock
                                       ; increased by 60
Stockad TERMINATE
***********************************************************************
        GENERATE  8                   ;Xact every day
        TABULATE  Number
        SAVEVALUE 1,0
        TERMINATE 1
*********************************************************************
        GENERATE  ,,,1,10             ;Initial stock xact
        ENTER     Stock,Amount        ;Set initial stock
        TERMINATE
***********************************************************************

8. TEXTILE.GPS

Simulation of a textile factory.

A textile factory produces fine mohair yarn in three departments. The first department draws and blends the raw material, in sliver form, and reduces it to a suitable thickness for spinning, in 5 reducer frames. The second department spins the yarn in one of 40 spinning frames. The final process is in the winding department, where the yarn is wound from spinning bobbins onto cones for dispatch. There are 8 winding frames, to perform the winding operation.The factory works 8 hours per day. The unit of production is 10 kilograms of yarn. Reducing frames produce one unit every 38±2 minutes, while the spinning frames and winding frames produce one unit in 320±20 minutes and 64±4 minutes, respectively.The initial inventory of reduced material is 50 units (in Savevalue Reduced), spun material is 25 units (in Savevalue Spun) and finished yarn is 25 units (in Savevalue Wound). The finished material is dispatched, in a container of capacity 200 units, every two days.

1. Simulate the production process in the textile factory for 5 days

2. Find the distribution of the in-process inventories.

3. Determine the utilization of each of the three types of machines.

Listing

Reducers STORAGE 5 ;Represents 5 reducer frames
Spinners STORAGE 40 ;Represents 40 spinning frames
Winders STORAGE 8 ;Represents 8 winding frames
Reducing TABLE X$Reduced,20,20,20 ;Inventory reduced material
Spinning TABLE X$Spun,20,20,20 ;Inventory spun material
Winding TABLE X$Wound,20,20,20 ;Inventory wound material
INITIAL X$Reduced,50
INITIAL X$Spun,25
INITIAL X$Wound,25
**********************************************************************
        GENERATE  0.334,,1    ;Time unit is one hour
        QUEUE     One         ;Enter queue for reducing
        ENTER     Reducers    ;Get a machine
        DEPART    One         ;Depart the queue
        ADVANCE   0.634,0.334 ;Process time
        LEAVE     Reducers    ;Leave the machine
*********************************************************************
        SAVEVALUE Reduced+,1  ;Reduced inventory up by 1
        QUEUE     Two         ;Queue for spinning process
        ENTER     Spinners    ;Get a spinning machine
        DEPART    Two         ;Depart the queue
        ADVANCE   5.334,0.334 ;Process time
        LEAVE     Spinners    ;Free a machine
        SAVEVALUE Reduced-,1  ;Reduced inventory down 1
*********************************************************************
        SAVEVALUE Spun+,1     ;Spun inventory up by one
        QUEUE     Three       ;Queue for winding process
        ENTER     Winders     ;Get a winding machine
        DEPART    Three       ;Depart the queue
        ADVANCE   1.067,0.067 ;Process time
        LEAVE     Winders     ;Free a winding machine
        SAVEVALUE Spun-,1     ;Spun inventory down by 1
*********************************************************************
        SAVEVALUE Wound+,1    ;Wound inventory up by 1
        TERMINATE             ;Xact is finished
*********************************************************************
        GENERATE  8           ;One xact every day
        TABULATE  Reducing    ;Record inventory of
                              ; process
        TABULATE  Spinning    ;Record inventory of spun
                              ; material
        TABULATE  Winding     ;Record inventory of wound
                              ; material
        TERMINATE 1           ;One day has passed
***********************************************************************
        GENERATE 16           ;A xact every 2 days
        TEST GE   X$Wound,200,Notthere ;If not done don’t dispatch
        SAVEVALUE Wound-,200  ;200 Kgs produce delivered
        TERMINATE             ;Xact is finished
Notthere TERMINATE            ;Xact is finished
*********************************************************************
 

9. OILDEPOT.GPS

Simulation of an Oil Storage Depot.

An oil storage depot distributes three grades of fuel, a) home heating oil, b) light industrial fuel oil, and c) diesel fuel for road vehicles. There is one pump for each grade of fuel, and the demand for each is the same. Orders for fuel oil vary between 3000 and 5000 gallons, in increments of 10 gallons, evenly distributed. The time required to fill fuel trucks is a function of the following.

1. The pumping rate (6, 5 and 7 minutes per 1000 gallons respectively).

2. The order size.

3. The number of vehicles in the depot (30 seconds extra per vehicle).

4. Setup time, a fixed time of two minutes.

The depot can hold a maximum of twelve trucks. The mean arrival rate of trucks is 18 minutes, modified by the following function.

Truck Arrival Rates

Frequency        .20   .40   .25   .15
Ratio to mean    .45   .60   1.5   2.0

1. Simulate the operation of the oil storage depot for 5 days.

2. Find the distribution of transit times of trucks.

3. What is the total quantity of fuel sold each day?

Listing

; GPSS World Sample File - OILDEPOT.GPS, by Gerard F. Cummings
****************************************************************
* Oil Storage and Distribution Depot 
* Time Unit Is One Minute 
****************************************************************
RMULT 5631,39941
Arr FUNCTION RN2,C5             ;Arrivals frequency
0,0/0.2,.45/.6,1/.85,1.5/1.0,2
Pumprate FUNCTION P$Type,L3 ;Mins to pump 1000 gals
1,6/2,5/3,7
Gals VARIABLE (RN1@201+300)#10
Type VARIABLE RN1@3+1
Pump VARIABLE (FN$Pumprate#P$Gals)/1000+S$Depot/2+2
Depot   STORAGE   12            ;Room for 12 trucks max
Transit TABLE M1,10,10,20       ;Time of truck in depot
Qty TABLE X$Gals,20000,20000,9  ;Qty of oil sold per day
****************************************************************
        GENERATE  18,FN$Arr     ;Truck arrivals
        ASSIGN    Gals,V$Gals   ;P$Gals=Number of gals
        ASSIGN    Type,V$Type   ;P$Type=Type of oil
        ENTER     Depot         ;Truck enters depot
        QUEUE     P$Type        ;Queue for type of oil
        SEIZE     P$Type        ;Get a pump
        DEPART    P$Type        ;Depart the queue
        ADVANCE   V$Pump        ;Service time pumping
        RELEASE   P$Type        ;Release the pump
        LEAVE     Depot         ;Truck leaves the depot
        SAVEVALUE Gals+,P$Gals  ;Tally no. of gals sold
        TABULATE  Transit       ;Table of transit times
        TERMINATE               ;Truck departs
****************************************************************
        GENERATE  480           ;One transaction per day
        TABULATE  Qty           ;Record no. of gals sold
        SAVEVALUE Sold+,X$Gals  ;Record total oil sold
        SAVEVALUE Gals,0        ;Savevalue set to 0
        TERMINATE 1             ;One day has passed
****************************************************************

10. ASSEMBLY.GPS

Simulation of a pump assembly process.

A manufacturer makes centrifugal pump units which are assembled to customer orders. The orders arrive on average, every 5 hours, exponentially distributed. When the order arrives, two copies are made. The original order is used to obtain a motor from stock and prepare it for assembly (200±100 minutes). The first copy is used to order and adapt a pump (180±120 minutes), and the second copy is used to initiate the manufacture of the baseplate (80±20 minutes).

When the pump and the baseplate are ready, a test fitting is carried out (50±10 minutes). All three components are assembled, when they are available. The unit is then dismantled, and the pump and motor are painted, and the baseplate is galvanized. Final assembly then takes place (150±30 minutes).

1. Investigate the utilization of the manufacturing facilities.

2. Determine the transit times and delays, of customers’ orders.

3. What Facility will be a bottleneck, if orders increase significantly?

4. Simulate the assembly of 50 motor-pump units.

Listing

; GPSS World Sample File - ASSEMBLY.GPS, by Gerard F. Cummings
***********************************************************************
* Assembly of Motor Pump and Baseplate 
***********************************************************************
Transit TABLE M1,200,200,20
***********************************************************************
        GENERATE  (Exponential(1,0,300)) ;New order arrives
        SPLIT     2,Factory,1   ;Make 2 copies of order
***********************************************************************
* Purchase Motor Original Transaction Goes Here, P1=1
        QUEUE     Motor         ;Queue for motor
        SEIZE     Motor         ;Get a Facility
        DEPART    Motor         ;Depart the queue
        ADVANCE   200,100       ;Take motor from stock
        RELEASE   Motor         ;Free the Facility
        TRANSFER  ,Tryout       ;Send to trial assembly
***********************************************************************
Factory TEST E    P1,2,Baseplate ;Is P1=2 ?
        QUEUE     Pumps         ;Join the Queue (P1=2)
        SEIZE     Pumps         ;Get a Facility
        DEPART    Pumps         ;Depart the Queue
        ADVANCE   180,120       ;Prepare the Pump
Pump    MATCH     Plate         ;Wait for baseplate
        ADVANCE   50,10         ;Check pump on baseplate
        RELEASE   Pumps         ;Free the Facility
        TRANSFER  ,Tryout       ;Send for a tryout
***********************************************************************
Baseplate QUEUE   Base          ;Join Queue P1 must=3
        SEIZE     Base          ;Get a Facility
        DEPART    Base          ;Depart the Queue
        ADVANCE   80,20         ;Make the baseplate
Plate   MATCH     Pump          ;Wait for the pump unit
        ADVANCE   50,10         ;Check the pump on baseplate
        RELEASE   Base          ;Free the Facility
***********************************************************************
Tryout  GATHER    3             ;Gather 3 units to tryout
        ADVANCE   60            ;Trial assembly
        TEST E    P1,1,Finish   ;Is it the motor?(P1=1)
***********************************************************************
        SEIZE     Paint1        ;Get first paint Facility
        ADVANCE   100,20        ;Paint the motor
        RELEASE   Paint1        ;Free paint Facility 1
        TRANSFER  ,Build        ;Send for assembly
***********************************************************************
Finish  TEST E    P1,2,Basplate ;Is it the pump?(P1=2)
        SEIZE     Paint2        ;Get paint Facility 2
        ADVANCE   120,30        ;Paint the Pump
        RELEASE   Paint2        ;Free paint Facility 2
        TRANSFER  ,Build        ;Send for assembly
Basplate SEIZE    Galvanize     ;Get a Facility
        ADVANCE   120,30        ;Galvanize baseplate
        RELEASE   Galvanize     ;Free the Facility
***********************************************************************
Build   ASSEMBLE  3             ;Collect 3 units
        ADVANCE   150,30        ;Assemble unit
        TABULATE  Transit       ;Record transit time
        TERMINATE 1             ;One unit completed

11. ROBOTFMS.GPS

Simulation of a robot operated FMS.

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
*******************************************************************

12. BICYCLE.GPS

Simulation of a bicycle factory.

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

* 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
*********************************************************************

13. STOCKCTL.GPS

Simulation of a warehouse and branch inventories.

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
****************************************************************

14. LOCKSIMN.GPS

Lock and Canal Simulation.

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

15. FOUNDRY.GPS

Foundry Simulation

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
*********************************************************************
 

16. TAPEPREP.GPS

Simulation of NC tape preparation.

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

* 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
**********************************************************************

17. TRAFFIC.GPS

Simulation of traffic at a T-junction.

Cars arrive at a T-junction every 6.28 seconds hyperexponentially distributed (standard deviation = 8.40 seconds). The cars then make a left turn northbound onto a highway. When cars cross the southbound lanes, they must wait in a center aisle which can accommodate a maximum of 8 cars. Each car takes 3.6 seconds (Erlang k=4 ) to cross the traffic lanes. It takes 4 seconds (Erlang k=5 ) to merge with northbound traffic. Southbound traffic arrives every 55±5 seconds and takes 15±5 seconds to pass the T-junction. Northbound traffic arrives every 60±5 seconds and takes 15±5 seconds to pass.

Simulate the traffic at the T-junction for 10 minutes.

1. Determine the transit time of northbound cars turning at the T-junction.

2. Tabulate the actual Erlang service times.

3. Find the maximum number of cars queuing in the lane, waiting to make a left turn.

Listing

; GPSS World Sample File - TRAFFIC.GPS, by Gerard F. Cummings
***********************************************************************
* *
* Traffic at a T-Junction *
***********************************************************************
* Erlang Service Times ...Hyperexponential Arrivals *
* Time Unit is 1/100 Second *
***********************************************************************
* A Hyperexponential Probability Distribution Follows
Hyper FVARIABLE (410+((RN2’L’234)#(1343-410)))#(Exponential(2,0,1))
* f(t) = .234(1/4.10) exp(-t/4.1) + .766(1/13.43) exp(-t/13.43)
***********************************************************************
Aisle STORAGE 8
Mergetime TABLE MP2,100,100,20
Crosstime TABLE MP1,100,100,20
Transit TABLE M1,1000,1000,9
Arrivals TABLE V$Hyper,200,200,20
***********************************************************************
        GENERATE V$Hyper,,300   ;Hyperexponential
        QUEUE    First
        GATE SNF Aisle          ;Is there room in the aisle?
        SEIZE    Southlane      ;Crosses highway
        DEPART   First
        MARK     1
*———Erlang Distribution——————————————————————
        ADVANCE  (Gamma(3,0,4,90)) ;Erlang K=4 waiting time
*                                  ;Mean = 360 time units
*———————————————————————————————————
        TABULATE Crosstime      ;Record crossing time
        ENTER    Aisle          ;Stand in center aisle
        RELEASE  Southlane
        QUEUE    Two            ;Queue for northlane
        SEIZE    Northlane
        DEPART   Two
        LEAVE    Aisle
        MARK     2
* ————Erlang Distribution————————————————————
        ADVANCE  (Gamma(4,0,5,80)) ;Erlang K=5 waiting time
*                                  ;Mean = 400 time units
* ——————————————————————————————————
        RELEASE   Northlane
        TABULATE  Mergetime     ;Merge time to north flow
        TABULATE  Transit
        TABULATE  Arrivals
        TERMINATE
***********************************************************************
        GENERATE  5000,500,,,10 ;Southbound traffic
        SEIZE     Southlane
        ADVANCE   1200,300 ;Time to pass junction
        RELEASE   Southlane
        TERMINATE
***********************************************************************
        GENERATE  6000,500,,,10 ;Northbound traffic
        SEIZE     Northlane
        ADVANCE   1200,300      ;Time to pass junction
        RELEASE   Northlane
        TERMINATE
***********************************************************************
        GENERATE  6000          ;Xact every minute
        TERMINATE 1
*********************************************************************

18. POWDER.GPS

Simulation of customer brand loyalty.

A survey was carried out to assess the brand loyalty of customers to 7 brands of soap powder. The probability of change from one type of powder to another, is given in the table below. It is assumed that the customer will purchase either the same brand of powder again (most likely), or change to some other powder (less likely). Therefore the sum of the probabilities in each row of the matrix is equal to 1. The probability of the market share distribution depends on the number of transitions which have taken place (i.e. the number of successive purchases) and the initial market share of each product.

The purpose of the model is to estimate the market share each powder will achieve, in the long term, assuming that the transition probability matrix will remain the same, and assuming that initially all powders have an equal share of the market.

This process of system changes occurring in sequence is called a Markov Chain.

 

                    Probability of Customer Changing From Row to Column

            SUDS      BUBBLES     CLEANPLUS    SOAPY
    
                         BRANDX     CLEARSHINE    MARVEL       TOTAL

SUDS        .39   .12   .17   .13   .10   .04   .05   1.0

BRANDX      .13   .32   .10   .15   .12   .09   .09   1.0

BUBBLES     .15   .14   .25   .14   .17   .08   .07   1.0

CLEARSHINE  .11   .10   .09   .40   .08   .09   .13   1.0

CLEANPLUS   .05   .12   .16   .09   .37   .14   .07   1.0

MARVEL    &nb