Quiz Study Guide — Chapter 4
This deck is a checklist, not a summary. Every slide is phrased as something you should be able to state, derive, or compute without looking it up.
Scope
This is the event view of discrete-event modeling: you describe what happens to the system as it encounters entities. Chapter 6 covers the process view.
Concepts
The KSL
Model, Executive, ModelElement, KSLEventResponse, TWResponse, CounterSResource, Queue, QObjectEventGenerator, SingleQStationYou should be able to:
You should be able to:
initialize() is called and what belongs in itResponse, TWResponse, and Counter for a given variableSResourceQueue disciplines and the default| Term | Definition |
|---|---|
| Event | An instant in time at which the system state changes |
| Action | An instantaneous operation associated with an event — takes zero simulated time |
| Activity | An operation that takes simulated time, marked by two events |
| State | An abstraction of attribute values that has duration between two events |
| Entity | A conceptual thing that flows through the system, potentially using resources |
A DEDS evolves dynamically through time and its state changes only at discrete points in time — the clock does not tick in fixed equal-sized steps.
The distinction is not about determinism versus stochasticity, and it is not about whether time is consumed.
Activities of specified duration — getting a haircut, for instance — are formally called timed (scheduled) activities.
Time-persistent
Values persist over intervals of time: \(N(t)\), \(Q(t)\), \(B(t)\).
Averaged by time-weighting: \[\bar Q = \frac{1}{t_n - t_0}\int_{t_0}^{t_n} Q(t)\,dt\]
Collected with TWResponse.
Observation-based (tally)
One observation per customer: \(A_i\), \(S_i\), \(D_i\), \(ST_i\), \(T_i\), \(W_i\).
Averaged by a simple arithmetic mean.
Collected with Response.
In the bank simulation, \(N(t) = Q(t) + B(t)\) — number in system equals number in queue plus number busy.
For a resource with \(c\) units and \(B(t)\) busy units, utilization is the time-average of \(B(t)\) divided by \(c\) — the total time busy divided by the total time the resource could be busy.
In the hand bank simulation (7 departed customers over 31 minutes), \(\bar B \approx 24/31\) is the proportion of time the teller was busy.
For an SResource with capacity \(c\), number busy \(B(t)\), and number available \(A(t)\):
\[c = A(t) + B(t), \qquad U(t) = \frac{B(t)}{c}\]
| Class | Role |
|---|---|
Model |
Top-level container for all model elements and the experiment parameters |
Executive |
Controls event execution; works with the calendar to fire events in time order |
ModelElement |
Abstract base class giving subclasses access to the scheduler and the model |
KSLEvent |
One scheduled event: time, priority, name, and a generic message |
EventActionIfc |
Functional interface whose action() method holds the logic run when the event fires |
Every ModelElement is a child of another ModelElement or of the Model itself, forming a hierarchy with Model at the top. Names must be unique.
initialize()initialize() is called once at the beginning of each replication, conceptually at time \(t = 0^-\).
schedule.| Class | Use |
|---|---|
Response |
Observation-based (tally) statistics on values observed at event times |
TWResponse |
Time-weighted statistics on time-persistent variables |
Counter |
Increment/decrement a variable, auto-reset to 0 each replication, collect across-replication statistics |
AggregateTWResponse |
A time-weighted response observing other responses and reflecting their sum |
IndicatorResponse |
A Response subclass collecting 1.0/0.0 from a boolean predicate on an observed response |
QObject instances are transitory: an inner class of ModelElement, not model elements themselves, typically garbage-collected once no longer needed.Queue supports four disciplines: FIFO (the default), LIFO, random, and ranked. On a ranked queue, removal order is governed by the QObject’s priority property.enqueue and removeNext automatically generate statistics on the number in queue and the time in queue.SingleQStation combines an SResource with a Queue. When the resource is seized, the end-of-processing event attaches the customer as the event’s message so it can be retrieved when the event fires.QObjectReceiverIfc is the SAM interface promising receive(), which stations implement so QObjects can be sent between them.The KSL EventGenerator is most analogous to the CREATE module in other simulation packages — it periodically generates arriving entities or events.
It can be turned off, suspended, and resumed during a replication. Once turned off within a replication, it cannot be restarted in that same replication.
State is tracked with a TWResponse, because it is a time-based variable needing time-weighted statistics.
From renewal theory, with mean up time \(\theta_u\) and mean down time \(\theta_d\):
\[P\{\text{UP}\} = \frac{\theta_u}{\theta_u + \theta_d}, \qquad \text{expected cycle length} = \theta_u + \theta_d\]
With \(\theta_u = 1.0\) and \(\theta_d = 2.0\): \(P\{\text{UP}\} = 1/3\) and the cycle length is 3.0.
A replication is a sample path that starts and ends under the same conditions, so that observations across replications are IID.
For the drive-through pharmacy, an M/M/1 with arrival rate \(\lambda\) and service rate \(\mu\):
\[\rho = \frac{\lambda}{\mu}, \qquad L_q = \frac{\rho^2}{1-\rho}, \qquad W_q = \frac{L_q}{\lambda}\]
In queueing notation the M stands for Markov. Two stations in series, each with its own queue and server, form a tandem queue.
| Symbol | Meaning |
|---|---|
| Circle labeled “queue” | A waiting line in the system |
| Rectangle | An activity, with an appropriate label inside |
| Small circle labeled “resource” | A resource within the system |
| Dotted line | Seizing or releasing of a resource |
| Zigzag line | Creation or destruction of an entity |
initialize() is called each replication at \(t = 0^-\); it is not the constructor.EventActionIfc method is action(), not execute() or run().EventGenerator turned off within a replication cannot be restarted that replication.