Simscript II.5 - PowerPoint PPT Presentation

About This Presentation
Title:

Simscript II.5

Description:

... object in the model (objects may compete for a service, they will be put in ... This results in its process notice moving from the 'executing' state to the ' ... – PowerPoint PPT presentation

Number of Views:155
Avg rating:3.0/5.0
Slides: 26
Provided by: mahmouda7
Category:
Tags: simscript

less

Transcript and Presenter's Notes

Title: Simscript II.5


1
Simscript II.5
  • Building simulation model with SIMSCRIPT II.5

2
Simulation Model Structure
  • Each simulation model has the following 3
    activities
  • A mechanism for representing arrivals of new
    object (constant delay between successive
    arrivals, uniform, exponential, etc).
  • A representation of what happens to the object in
    the model (objects may compete for a service,
    they will be put in queue if the server is busy)
  • A mechanism for terminating the simulation

3
Terminating the simulation
  • Two approaches for terminating simulation
  • The planned-termination-time method The
    simulation stops immediately at the planned time
    regardless the unfinished processes.
  • The second method allows everything in the model
    to be finished. However the door will be closed
    and no new arrivals are allowed.

4
The Process Concept
  • The dynamic parts in the model that are created
  • They become either immediately after creation or
    will be activated after some specific time.
  • The description of its activity in the model is
    given by a process routine.

5
The Resource Concept
  • A resource is used to model an object that is
    needed by process objects.
  • If the resource is not available (occupied by
    another process object) the process object will
    be placed in a waiting line.

6
SIMSCRIPT II.5 Program Structure
  • A SIMSCRIPT II.5 program consists of three
    modeling elements
  • A preamble
  • A main program
  • A process routine for each process declared in
    the preamble

7
1. Preamble
  • The first part of each SIMSCRIPT II.5 program is
    the preamble.
  • preamble is a declarative and does not include
    any executable statements.
  • It declares all modeling elements including
  • processes and resources in the program.
  • It describes their static feature but does not
    describe how and why they interact.

8
2. Main
  • It contains executable statements.
  • Execution begins with the first statement in the
    Main program.
  • Resources must be created and initialized
  • A simulation begins when the statement
  • Start simulation is executed.

9
Timing Routine
  • All processes will be in the pending list.
  • The timing routine check if there is a process in
    the pending list and select the one that has the
    earliest activation time.
  • Then advance the simulation clock to this time
  • Then determine the process type
  • Remove this process from the pending list
  • Execute the process routine.

10
3. Process Routines
  • Process (entity) is a dynamic object and the
    sequence of actions that experience through its
    life in the model.
  • A process is created and becomes active
    immediately or later at some activation time.
  • Processes interact either implicitly or
    explicitly through executing the statements
    activate, interrupt, or resume.
  • Process routine is a subroutine, which
    corresponds to a particular process.
  • Process notice this record contains information,
    which characterizes the particular realization.

11
A Detailed Discussion of Processes and Resources
  • 1- Processes
  • Each type of process used in a SIMSCRIPT
    simulation model must be defined in the preamble,
  •  Processes include ARRIVAL.GENERATOR and CUSTOMER
  • Where ARRIVAL.GENERATOR and CUSTOMER are two
    processes.
  • Processes can also have characterizing
    attributes, In our example, suppose that each
    CUSTOMER process entity has an associated age
    attribute called CU.AGE.

12
process commands
  • We now explain each of the process commands
  •   Activate statement The activate statement is
    used to create a process notice for a particular
    process and then immediately place the notice in
    the event list.
  • The reference variable for this type of process
    points to the notice.

13
  • Activate a CUSTOMER in 10 minutes
  • This statement means that we create a new
    CUSTOMER process notice with an activation time,
    which is 10 minutes larger than the current value
    of the simulation clock, and then place this
    notice in the event list.

14
Request/relinquish statement
  • The request statement is used by a particular
    process entity (or process notice) in its process
    routine to request a certain number of units of a
    resource of a specified type.
  • request 1 unit of SERVER(l)
  • or
  • request 1 unit of SERVER(l) with priority 5
  • Note the one with the highest priority is
    served next

15
Request/relinquish continue
  • If no priority is specified (the usual case),
    then a priority of 0 is assumed.
  • The relinquish statement is used by a particular
    process entity (or process notice) to relinquish
    (release) a certain number of units of a resource
    of a specified type.
  • relinquish 1 unit of SERVER(l)
  • Note 1 unit of may be shortened to 1.

16
Work/wait
  • The work/wait statements are used by a particular
    process entity, which is executing its process
    routine, to place its process notice back into
    the event list for a specified amount of time.
  • A work statement represents "service" times and a
    wait statement represents "inter-event" (e.g.,
    inter-arrival) times.
  • After one of these statements is executed,
    control is immediately returned to the timing
    routine.
  • work 20 minutes

17
Suspend/reactivate
  • The suspend statement is used by a particular
    process entity to stop its own execution of the
    corresponding process routine. (for example when
    a more priority customer arrives then the current
    executable customer will be suspended)
  • This results in its process notice moving from
    the "executing" state to the "created" state.
  • The notice will stay in this latter state until
    "awakened" by a reactivate "the" (or resume)
    statement in a process or normal routine.
  • reactivate the CUSTOMER now

18
Interrupt/resume
  • The interrupt statement is used in a process or
    normal routine to remove a process notice from
    the event list. (for example when the time of
    closing is reached the interrupt statement is
    used to prevent new customers form entering the
    system)
  • This results in the process notice moving from
    the "pending" state to the "created" state.
  • interrupt the CUSTOMER  
  • resume the CUSTOMER
  • Note resume statement can be used to move a
    suspended process notice from the "created" state
    to the "pending" state.

19
Create/destroy
  • The create statement is used to create a process
    notice for a particular type of process without
    placing it into the event list.
  • create a CUSTOMER
  • let CU.AGE (CUSTOMER) 35
  • activate this CUSTOMER now
  • The destroy statement is used to destroy (i.e.,
    to make non existent) a process notice which is
    in the "created" state.  
  • destroy the CUSTOMER

20
End/return
  • The end, return statement is placed at the end of
    each process routine.

21
2- Resources
  • A resource is an object such as a person or
    machine which provides service to a process
    entity.
  • A resource may have characterizing attributes and
    is defined in the preamble resources
  • every WORK.STATION has a WS.NUM.MACHINES
  • There are five system-defined variables, which
    are automatically associated with each defined
    resource.

22
  • The variable N.WORK.STATION is the number of
    types of workstations desired (i.e., 5).
  • Q.WORK.STATION(I), The first set (or queue)
    contains those jobs waiting to be served by
    WORK.STATION type I, and the corresponding
    variable N.Q.WORK.STATION(I) is the number of
    jobs in the queue at a particular point in time.
  • X.WORK.STATION(I), the second set contains those
    jobs executing WORK.STATION type I, and the
    variable
  • type I at a particular point in time.

23
  • N.X.WORK.STATION(I) is the number of jobs that
    are executing WORK.STATION
  • U.WORK.STATION(I) is the number of idle units or
    machines in WORK.STATION type I at a particular
    point in time.
  • the variable WORK.STATION (i.e., it has the same
    name as the resource itself) is an index variable
    which is equal to one of the WORK.STATION types
    (i.e., 1, 2, 3, 4, or 5).

24
  • In order to allocate storage for the resource
    WORK.STATION, we can execute the following create
    statement
  • create every WORK.STATION(5)
  • (This statement implicitly sets the value of
    N.WORK.STATION to 5.)
  • we can then specify how many units of each type
    are initially available.

25
  • let U.WORK.STATION(l) 3
  • let U.WORK.STATION(2) 3
  • let U.WORK.STATION(5) 1
  • The variable U.WORK.STATION(I) will decrease by
    one each time a machine of type I becomes busy
    conversely, it will increase by one each time a
    machine of type I becomes idle.
Write a Comment
User Comments (0)
About PowerShow.com