Upload
brooke-lee
View
219
Download
2
Embed Size (px)
Citation preview
Lecture 3Lecture 3Lecture 3Lecture 3
Concepts of Discrete-Event Concepts of Discrete-Event SimulationSimulation
Concepts of Discrete-Event Concepts of Discrete-Event SimulationSimulation
2
Discrete Event ModelDiscrete Event Model
In the discrete approach to system simulation, state changes in the physical system are represented by a series of discrete changes or events at specific instants of time and such models are known as discrete event models.
The time and state are the two important coordinates used in describing simulation models.
Between events, the states of the entities remain constant.
The change in state is brought about by events which from the driving force behind every discrete event simulation model.
In the discrete approach to system simulation, state changes in the physical system are represented by a series of discrete changes or events at specific instants of time and such models are known as discrete event models.
The time and state are the two important coordinates used in describing simulation models.
Between events, the states of the entities remain constant.
The change in state is brought about by events which from the driving force behind every discrete event simulation model.
3
System TerminologySystem Terminology
System: A collection of entities (e.g., people and machines) that interact
together over time to accomplish one or more goals.
Model: An abstract representation of a system, usually containing
structural logical, or mathematical relationships which describe a system in terms of state, entities and their attributes, sets, processes, events, activities, and delays.
System state: A collection of variables that contain all the information necessary
to describe the system at any time.
System: A collection of entities (e.g., people and machines) that interact
together over time to accomplish one or more goals.
Model: An abstract representation of a system, usually containing
structural logical, or mathematical relationships which describe a system in terms of state, entities and their attributes, sets, processes, events, activities, and delays.
System state: A collection of variables that contain all the information necessary
to describe the system at any time.
4
System TerminologySystem Terminology(cont’)(cont’)
Entities: Any object or component in the system which requires explicit
representation in the model (e.g., a server, a customer, a machine).
Attributes: The properties of a given entity (e.g., the priority of a waiting
customer, the routing of a job through a job shop).
List (Set, Queue): A collection of (permanently or temporarily) associated entities,
ordered in some logical fashion (such as all customers currently in a waiting line, ordered by first come, first served, or by priority).
Entities: Any object or component in the system which requires explicit
representation in the model (e.g., a server, a customer, a machine).
Attributes: The properties of a given entity (e.g., the priority of a waiting
customer, the routing of a job through a job shop).
List (Set, Queue): A collection of (permanently or temporarily) associated entities,
ordered in some logical fashion (such as all customers currently in a waiting line, ordered by first come, first served, or by priority).
5
System TerminologySystem Terminology(cont’)(cont’)
Event: An instantaneous occurrence that changes the state of a system
(such as an arrival of a new customer).
Event notice: A record of an event to occur at the current or some future time,
along with any associated data necessary to execute the event; at a minimum, the record includes the event type and the event time.
Event list: A list of event notices for future events, ordered by time of
occurrence; also known as the future event list (FEL).
Event: An instantaneous occurrence that changes the state of a system
(such as an arrival of a new customer).
Event notice: A record of an event to occur at the current or some future time,
along with any associated data necessary to execute the event; at a minimum, the record includes the event type and the event time.
Event list: A list of event notices for future events, ordered by time of
occurrence; also known as the future event list (FEL).
6
System TerminologySystem Terminology(cont’)(cont’)
Activity: A duration of time of specified length (e.g., a service time or inter-
arrival time), which is known when it begins (although it may be defined in terms of a statistical distribution).
Delay: A duration of time of unspecified indefinite length, which is not
known until it ends (e.g., a customer’s delay in a last-in, first-out waiting line which, when it begins, depends on future arrivals).
Clock: A variable representing simulated time.
Activity: A duration of time of specified length (e.g., a service time or inter-
arrival time), which is known when it begins (although it may be defined in terms of a statistical distribution).
Delay: A duration of time of unspecified indefinite length, which is not
known until it ends (e.g., a customer’s delay in a last-in, first-out waiting line which, when it begins, depends on future arrivals).
Clock: A variable representing simulated time.
7
System TerminologySystem Terminology(Example 2.1)(Example 2.1)
System state: LQ(t), the number of customer waiting to be served at time t LC(t), 0 or 1 indicate counter being idle or busy at time t
Entities Neither the customers nor the servers need to be explicitly
represented, unless certain customer averages are desired
Events: Arrival event Service completion
System state: LQ(t), the number of customer waiting to be served at time t LC(t), 0 or 1 indicate counter being idle or busy at time t
Entities Neither the customers nor the servers need to be explicitly
represented, unless certain customer averages are desired
Events: Arrival event Service completion
8
System TerminologySystem Terminology(Example 2.1)(Example 2.1)
Activities: Interarrival time Service time Unconditional wait
Delay: A customer’s wait in queue until counter becomes free Conditional wait
Activities: Interarrival time Service time Unconditional wait
Delay: A customer’s wait in queue until counter becomes free Conditional wait
9
Main ApproachesMain Approaches
Event-scheduling approach concentrate on the events and how they affect the system state.
The simulation evolves over time by executing events in increasing order of their times of occurrence.
Examples: FORTRAN, GASP IV, C++ Process-interaction approach
concentrate on a single entity (e.g. a customer) and the sequence of events and activities it undergoes as it PASSES THROUGH THE SYSTEM. At any given time, the system may contain many processes (e.g. customers) interacting with each other while competing for a set of resources.
Example: GPSS
Event-scheduling approach concentrate on the events and how they affect the system state.
The simulation evolves over time by executing events in increasing order of their times of occurrence.
Examples: FORTRAN, GASP IV, C++ Process-interaction approach
concentrate on a single entity (e.g. a customer) and the sequence of events and activities it undergoes as it PASSES THROUGH THE SYSTEM. At any given time, the system may contain many processes (e.g. customers) interacting with each other while competing for a set of resources.
Example: GPSS
10
Main ApproachesMain Approaches(cont’)(cont’)
Interactive, menu-driven, animated approach Recently available on PCs. Examples: PROMODEL, SIGMA
Interactive, menu-driven, animated approach Recently available on PCs. Examples: PROMODEL, SIGMA
11
Future Event ListFuture Event List(FEL)(FEL)
Both the event-scheduling and the process-interaction approaches use a variable time advance;
that is, when all events and system state changes have occurred at one instant of simulated time, the simulation clock is advanced to the time of the next imminent event on the FEL.
Both the event-scheduling and the process-interaction approaches use a variable time advance;
that is, when all events and system state changes have occurred at one instant of simulated time, the simulation clock is advanced to the time of the next imminent event on the FEL.
12
Event-SchedulingEvent-SchedulingApproachApproach
This list contains all event notices for events that have been scheduled to occur at a future time.
Scheduling a future event means that at the instant an activity begins, its duration is computed or drawn as a sample from a statistical distribution and the end-activity event, together with its event time, is placed on the future event list.
In the real world, most future events are not scheduled but merely happen – such as random breakdowns or random arrivals.
This list contains all event notices for events that have been scheduled to occur at a future time.
Scheduling a future event means that at the instant an activity begins, its duration is computed or drawn as a sample from a statistical distribution and the end-activity event, together with its event time, is placed on the future event list.
In the real world, most future events are not scheduled but merely happen – such as random breakdowns or random arrivals.
13
Event-SchedulingEvent-SchedulingApproachApproach(Example)(Example)
List of all activities’ SCHEDULED TIME OF COMPLETION (EVENTS)
The FEL is a SET ordered in completion times t1 < t2 < … < tn
ExampleConsider a single server queue with the following arrival times for the first 10 customers:0 4 8 10 13 14 17 20 27 29
and service times for these customers5 5 1 3 2 1 4 7 3 1
Assume that completions are given priority over arrivals
List of all activities’ SCHEDULED TIME OF COMPLETION (EVENTS)
The FEL is a SET ordered in completion times t1 < t2 < … < tn
ExampleConsider a single server queue with the following arrival times for the first 10 customers:0 4 8 10 13 14 17 20 27 29
and service times for these customers5 5 1 3 2 1 4 7 3 1
Assume that completions are given priority over arrivals
14
Event-SchedulingEvent-SchedulingApproachApproach(Example)(Example)
Time = 0
FEL
4 ARRIVAL
5 COMPLETION
.
.
.
.
QUEUE
0
15
Event-SchedulingEvent-SchedulingApproachApproach(Example)(Example)
Time = 4
FEL
5 COMPLETION
8 ARRIVAL
10 COMPLETION
13 ARRIVAL
14 ARRIVAL
17 ARRIVAL
20 ARRIVAL
27 ARRIVAL
29 ARRIVAL
QUEUE
4 #1
arrival time customer
16
Process-InteractionProcess-InteractionApproachApproach
A process is the life cycle of one entity. This life cycle consists of various events and
activities. Some activities may require the use of one or more
resources whose capacities are limited. These and other constraints cause processes to
interact, the simplest example being an entity forced to wait in a queue (on a list) because the resource it needs is busy with another entity.
A process is the life cycle of one entity. This life cycle consists of various events and
activities. Some activities may require the use of one or more
resources whose capacities are limited. These and other constraints cause processes to
interact, the simplest example being an entity forced to wait in a queue (on a list) because the resource it needs is busy with another entity.
17
Process-InteractionProcess-InteractionApproach (cont’)Approach (cont’)
In more precise terms, a process is a time-sequenced list of events, activities, and delays, including demands for resources, that define the life cycle of one entity as it moves through a system.
We see the interaction between two customer processes as customer n + 1 is delayed until the previous customer’s “end-service event” occurs.
In more precise terms, a process is a time-sequenced list of events, activities, and delays, including demands for resources, that define the life cycle of one entity as it moves through a system.
We see the interaction between two customer processes as customer n + 1 is delayed until the previous customer’s “end-service event” occurs.
18
Process-InteractionProcess-InteractionApproachApproach(Example)(Example)
Time
Time
Time
Time
Arrivalevent
Arrivalevent
Beginservice
Beginservice
End-service-event
End-service-event
Interaction
Activity
ActivityDelay
Delay
Customer n
Customer n + 1