Simulation using gpss/h introduction to gpss/h march 2009 THE gpss/h world view



Yüklə 486 b.
tarix11.10.2017
ölçüsü486 b.
#4322


Simulation using GPSS/H - Introduction to GPSS/H

  • March 2009


THE GPSS/H WORLD VIEW

  • The system is modeled from the viewpoint of entities moving through the system.

  • These dynamic moving entities are called Transactions.

  • Envisioned as moving through the system by moving from Block to Block.

  • Collection of Blocks representing the whole system is called a Block Diagram



Block Command in GPSS/H



Example



BASIC ELEMENTS OF GPSS/H

  • Transaction

  • Resources and other entities

  • Blocks

  • Control Statements

  • Compiler Directives

  • Standard Numerical Attributes



TRANSACTIONS

  • Transactions is abbreviated as XACTs

  • Created to perform certain task in the model

  • After completing their task, Transaction leave the system and are destroyed.

  • These Transactions are temporary entities (Note: Transactions may never leave the system, called permanent entities)

  • A transaction represent an objec (person in ATM system, car in assembly system, etc)

  • A transaction has one or more attributes (an attribute of car is color or type)

  • In complex model, there are several type transaction

    • Garment production system  T-shirt, Jeans, Jacket, etc
    • Toll highway system  truck, van, sedan, etc
    • Commuter trains  passenger and trains


RESOURCES

  • Static, permanent entities in a GPSS/H model.

  • They do not leave the system and cannot be destroyed.

  • Used to perform a certain task (e.g., to serve a customer at the checkout counter)

  • Resources may be people or objects (e.g., the clerk in the checkout line, assembly stations, machine, etc)



RESOURCES

  • Two types of resources: Facilities and Storages

    • Facilities are used to model single unit resources
    • Storages are used to model multiple, parallel resources


GPSS/H BLOCKS

  • Describe how a transaction moves through a system

  • A Block represents a specific action or event

  • A combination of Blocks represent the processing of a Transaction as it moves through the system (called “logic” of a simulation model)



Example : Joe Barbershop

  • Konsumen datang untuk merapikan rambut dengan interval waktu antara 12 – 24 menit (distribusi uniform).

  • Melepas jaket dan meletakkan pada gantungan 0.5 menit

  • Jika tukang potong rambut JOE sedang sibuk , konsumen menunggu. Jika tidak, konsumen akan dilayani dalam waktu 12 – 18 menit (distribusi uniform).

  • Setekah selesi dipotong konsomen akan meninggalkan tempat barbershop.







CONTROL STATEMENTS

  • SIMULATE

  • START 100

  • END

  • SIMULATE control statement indicates to GPSS/H that the model is to be executed after successful compilation.

  • START control statement defines simulation run length and initiates the execution of the Block diagram

  • END control statement indicates the end of the source file.



Input Format

  • Fixed format

  • Free format

  • For better readability, we recommend that you use fixed format

  • A statement is divided into 4 fields –the line label; the operation code; the operands; for comments –See Fig. 3.4



Input Format



STANDARD OUTPUT REPORT

  • The standard out put report is divided into two parts

    • The GPSS/H model listing and information about the GPSS/H model in general
    • The simulation results


A Recommended Organization of A GPSS/H Model



Getting Started

  • Marc 2009



Install GPSS/H program

  • Copy program GPSS/H pada satu folder di hardisk atau di flashdisk.

  • Program GPSS/H dapat diinstal dengan perintah A:\install jika masih berupa souce code.



Running a GPSS/H model

  • Program simulasi GPSSH disimpan dalam file text dengan penamaan

  • Aktifkan command prompt

  • Pada window command prompt, pindahkan direktori aktif ke direktori program GPSSH

  • Pada window command prompt, gpssh enter contoh gpssh joebarb



Screen Capture of GPSS-H program



Results of GPSS/H

  • Hasil simulasi akan disimpan .

  • Cara melihat hasil simulasi

    • Dari windows command prompt, ketik type
    • Atau dengan menggunakan aplikasi notepad dengan membuka file


Output dari command prompt



Output dengan Notepad



BASIC GPSS/H BLOCKS AND CONTROL STATEMENTS

  • Lecture Notes - Chapter 3



Introduction

  • A GPSS/H source file consists of

    • Blocks
      • Represent an action or event that can affect one or more transaction or change system state
      • Sequence of blocks  structure of system being simulated
      • A picture of Sequence of blocks is called a Block Diagram
    • Control Statements
      • Define entities, read input data files, perform calculation, initiate execution of a simulation run, or print customized report
    • Compiler Directives


Introduction

  • The most commonly used GPSS/H Blocks and Control Statements

    • GENERATE and TERMINATE, for creating and destroying Transaction
    • ADVANCE for holding a Transaction for a specified period of time
    • SEIZE and RELEASE, for capturing and freeing a Facility
    • SIMULATE, START and END for control statements of a simulation run


EXAMPLE 3-1

  • One bundle of cloth material is needed to make one dozen T=shirts. Bundles are delivered to the dock between 3 and 5 minutes apart.

  • It takes 2 minutes for the line feeder to transport a bundle from the dock to the staging area.

  • In the staging area, one line server arranges the cloth into separate T-shirt components and loads them onto a cart –takes between 2.75 and 4.75 minutes.



EXAMPLE 3-1

  • Questions:

  • How much time does it take for the line server to prepare 100 bundles?

  • How busy is the line server during this period of time?



TRANSCTION IDENTIFICATION







GPSS/H Blocks

  • The GENERATE block models the arrival of a Transaction into the system

  • The TERMINATE Block models the exit of a Transaction from the system

  • The GENERATE block has 8 operands –we will discuss only the first four and please see the others in the later Chapter.



GENERATE block



GENERATE block

  • A: specifies the mean inter arrival time for Transactions to be created

  • B: is numeric value (in a uniform distribution), that specifies the spread

  • C: specifies the time at which the first Transactions arrives

  • D: specifies the limit count of the number of Transactions to be created



GENERATE block

  • Examples:

  • GENERATE 4.1

  • GENERATE 4.1, ,3

  • GENERATE4.1,2.1, ,10

  • GENERATE , , ,1

  • GENERATE RVEXPO (2,8.5)



TERMINATE block

  • TERMINATE block has one operand

  • TERMINATE 1

    • Whenever a Transaction enters this block, the Transaction is destroyed and the value of the termination counter will be decremented by 1
  • TERMINATE

    • The operand is 0, so that the termination counter will not decrease even though a Transaction is destroyed.


TERMINATE block



ADVANCE block

  • ADVANCE block holds a Transaction for a specified length of time –commonly used to represent the processing time or the traveling time

  • The block has two operands, A and B

  • In a Uniform Distribution:

    • A: specifies the mean time for a Transactions to be held in this block
    • B: specifies the spread above and below the mean holding time


ADVANCE block



ADVANCE block

  • ADVANCE 2.1

  • ADVANCE 3.75,1

  • ADVANCE RVTRI(4,6.0,7.5,15.0)



SEIZE and RELEASE Blocks

  • SEIZE and RELEASE Blocks model the capture and release of a Facility, respectively.

  • SEIZE Block has one operand, specifying the name of Facility or the Facility number

  • RELEASE Block frees the specified Facility from capture.

  • The block has one operand, specifying the name of Facility or the Facility number to be released



SEIZE and RELEASE Blocks



SEIZE and RELEASE Blocks



SEIZE and RELEASE Blocks

  • SEIZE SERVER

  • SEIZE 1

  • RELEASE SERVER

  • RELEASE 1



CONTROL STATEMENT

  • SIMULATE control statement indicates to GPSS/H that the model is to be executed after successful compilation.

  • START control statement defines simulation run length and initiates the execution of the Block diagram

  • END control statement indicates the end of the source file.



START control statement

  • The START control statement has four operands

  • A-operand, (A>0), establishes an initial value of the simulation termination counter, TG1

  • Operands B, C & D will not be used in this text.

  • EX-1.3:

    • START 100, (TG1=100)
    • TERMINATE 1, (TG1 is decremented by 1, and as soon as TG1 =0 or <1, GPSS/H stops the simulation)


GPSS/H Model Listing of EX-1.3



RUNNING A GPSS/H Model

  • The GPSS/H model for Example 3-1 (EX3-1), The Filename of the source code: EX3-1.GPS

  • Two ways to run a GPSS/H model:

  • Type GPSSH and press RETURN, GPSS/H will prompt you to enter the name of the model

  • Or Type GPSSH filename (e.g., GPSSH EX3-1.GPS or GPSSH EX3-1) and press RETURN.



RUNNING A GPSS/H Model

  • If compilation is successful, GPSS/H will automatically execute the model.

  • The standard simulation output will be written to a file with the same filename, except it has the “.LIS” (e.g., EX3-1.LIS).



The Standard Simulation Output File

  • Divided into two parts:

  • The GPSS/H model summary

  • The Simulation results.



Simulation results



Simulation Results

  • Can be separated into four sections:

  • Clock section

  • Block count section

  • Entity summary

  • Random number stream section



Simulation Results



Entity Summary:[the Facilities Report]

  • The FACILITY column gives the name or number of a Facility.

  • The  AVG UTIL DURING  TOTAL TIME column shows the fraction of the total time that the Facility was in a state of capture.

  • A Facility is always in one of two states, available or unavailable. These two states (and their corresponding Blocks, FAVAIL and FUNAVAIL) will be discussed briefly in Chapter 16. If the FUNAVAIL Block is never used, then a Facility is available 100% of the time. The  AVG UTTL DURING  AVAIL TIME and UNAVL TRAE columns refer to the fraction of the time the Facility was held in a state of capture while the Facility was available and unavailable, respectively. If the Facility was always available, these columns will be blank.

  • The ENTRIES column shows the total number of instances the Facility was captured.



Entity Summary:[the Facilities Report]

  • The AVERAGE TIME/XACT column shows the average holding time per capture.

  • The CURRENT STATUS column shows whether the Facility is currently available or unavailable. For the simple models used in this book, the status is always AVAIL. Note that AVAIL is independent of a Facility's busy or idle status.

  • The PERCENT AVAIL column shows the fraction of the total time the Facility was available. Blank means 100%.

  • The SEIZING XACT column shows the Transaction number that is currently in control of the Facility. If the Facility is free, this column remains blank.

  • A Facility can be preempted. Preemption will be discussed briefly in Chapter 16. The PREEMPTING XACT column shows the number of the PREEMPTing Transaction.



Random number stream section

  • Shows information about the random number streams used in the model.

  • In Example 3.1, 202 random number were used to simulate the arrival and processing of 100 bundles of cloth.

  • Why not 200?



Answers to Questions in EX-3.1

  • (1) Look at the value of the relative clock at the end of the simulation (399.2730 minutes)

  • (2) The line server was utilized 0.956 of the total time



Setting Up A Program File

  • Create a model file

    • using the DOS editor (Type EDIT at the command prompt in the GPSSH directory).
    • Notepad
    • Use capitals for all code


Create a model file

    • Recommended that the following fixed column format be used.
    • Col. 1 * (only used for a comment line)
    • Col. 2 9 Label
    • Col. 10 blank
    • Col.11 20 Operation (Control Statement or Block Statement)
    • Col. 21 blank
    • Col. 22 72 Operands


Running A program File

  • Running a program file

    • GPSSH> gpssh fn.gps (return) or
    • GPSSH> gpssh fn (return)


Exercises using the GENERATE, TERMINATE and ADVANCE blocks

  • Objective :

    • to use an editor or word processor to create a GPSSH model file,
    • to run the simulation,
    • to answer questions on the automatically produced post simulation report.
  • Procedure: Type in the file listed below and run it.

    • New Blocks: GENERATE, TERMINATE
    • New Control statements: SIMULATE, START, END
    • Additional statement type : Comment statement *


Model File:

  • SIMULATE

  • * The SIMULATE control statement indicates to the compiler to

  • * compile and run the support system to run the simulation model

  • GENERATE 2

  • * Create an arrival every two time units beginning at time 2 units

  • TERMINATE 1

  • * Remove each arrival,one by one

  • *

  • START 5

  • *

  • * Simulate until 5 arrivals have been removed

  • * END indicates to the compiler the end of model file

  • *

  • END



Questions

  • At what simulated time was the post simulation report produced?

  • What is the number of the GENERATE BLOCK ?

  • What is the number of the TERMINATE BLOCK ?

  • What is the total number of arrivals? Hint: Look at the TOTAL count at the GENERATE BLOCK.

  • What is the CURRENT number of arrivals at each BLOCK ?

  • Modify and execute a model to determine the time of the 13th arrival.



Model File:

  • SIMULATE

  • * The SIMULATE control statement indicates to the support system

  • * compiler to compile and run the simulation model

  • GENERATE RVEXPO(1,12), ,0

  • * Create arrivals randomly with mean time between arrivals 12

  • * units using random number generator 1 beginning at time 0 units

  • *

  • TERMINATE 1

  • * Remove each arrival, one by one

  • *

  • START 1000

  • *

  • * Simulate until 1000 arrivals have been removed

  • *

  • * END indicates to the compiler the end of model file

  • *

  • END



Questions

  • At what simulated time was the post simulation report produced?

  • What is the number of the GENERATE BLOCK ?

  • What is the number of the TERMINATE BLOCK ?

  • What is the total number of arrivals? Hint: Look at the TOTAL count at the GENERATE BLOCK.

  • What is the CURRENT number of arrivals at each BLOCK ?

  • Repeat the simulation using random number generator 2 and answer questions 1 5. (Hint: use RVEXPO (2, 12)). What are the differences if any between the two simulations ?



Yüklə 486 b.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©www.genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə