UNIT 3: SIMULATION LAB - CORE CONCEPTS & PRACTICAL IMPLEMENTATION
1.0 Introduction & Foundations of Simulation Lab
-
Purpose: To bridge theoretical simulation concepts (from course) with hands-on model building, experimentation, and analysis using specialized software.
-
Scope: Focuses on discrete-event simulation (DES) as the primary paradigm for studying system dynamics over time.
-
Theory vs. Practice: Theory provides mathematical models (queues, inventories); Lab provides the tool to implement, test, and analyze these models under complex, realistic conditions.
-
Lab Ethics & Best Practices: Maintain model integrity, document all assumptions and changes, use version control (e.g.,
Model_v1.2.sim), and ensure reproducibility of results. -
Software Ecosystem: Common tools include Arena Rockwell, Simio, AnyLogic (multi-method), and FlexSim. Choice dictates specific module names but core concepts are transferable.
[!TIP] Exam Focus: Be prepared to define the primary goal of the simulation lab (implementation & validation of theory) and list 2-3 key software packages by name.
2.0 Software Environment & Tool Proficiency
-
Core Paradigm: Most DES tools are flowchart-based (drag-and-drop modules representing processes). Some (AnyLogic) also support agent-based and system dynamics.
-
UI Navigation: Key panels typically include:
-
Library/Toolbar: Contains modules (Create, Process, Dispose).
-
Model Window/Canvas: Where the flowchart is built.
-
Properties Panel: To define module parameters (e.g., processing time, resource name).
-
Project/Data Panel: Manages variables, resources, and external data files.
-
-
File Operations: Always use Save As with version numbers. Understand the project file structure (often a folder containing model file, data files, reports).
[!TIP] Common Pitfall: Confusing the Properties Panel (for a selected module) with the Data Panel (for global definitions like variables). Always check you are editing the correct entity.
3.0 Model Development: Building Blocks & Constructs
3.1 Entity Creation and Management
-
Entity Types: Represent items/customers/jobs flowing through the system (e.g.,
PartA,Customer). -
Attributes: Entity-specific data (e.g.,
Priority,Size,Destination). Defined in the Entity Type properties. Used for routing (Decidemodule) or calculations. -
Routing:
Decidemodule for conditional routing (e.g.,If Attribute.Type == "Express").RouteorTransfermodules for unconditional paths.
3.2 Resource Definition and Allocation
| Resource Type | Description | Typical Use |
|---|---|---|
| Seized/Delayed | Entity waits until resource is free, then occupies it for a time. | Most common (e.g., machine, server, teller). |
| Preemptive | A higher-priority entity can interrupt a lower-priority one using the resource. | Rare, for emergency or priority systems. |
| Transporters | Mobile resources that move entities between locations. | Forklifts, AGVs, nurses. |
-
Capacity & Schedules: Define number of identical units (
Capacity=3). Use Shift/Schedule definitions to model breaks, shifts, and 24/7 operation. -
Failures: Define MTBF (Mean Time Between Failures) and MTTR (Mean Time To Repair) distributions in resource properties.
3.3 Process Logic and Flow Control
-
Core Modules:
-
Create: Generates entities according to an inter-arrival time distribution (e.g.,Exponential(5)). -
Process: Models an operation (delay) requiring a resource and/or a processing time distribution (e.g.,Triangular(2,5,8)). -
Decide: Routes based on a condition (probability or attribute value). -
Assign: Sets/updates variables or entity attributes. -
Release: Frees resources seized earlier. -
Dispose: Removes entity from the system.
-
-
Flow Control: Use
Hold/SignalorBatch/Separatefor synchronization. Loops are created by routing back to a previous module.
3.4 Data Structures: Variables, Attributes, and Expressions
-
Global Variables: System-wide counters or parameters (e.g.,
Total_Completed,Shift_Number). Declared in the Data panel. -
Entity Attributes: Per-entity data (see 3.1). Crucial for routing logic and personalized processing times.
-
Expressions: Used everywhere for dynamic values. Syntax is tool-specific but often similar to Excel (e.g.,
Resource.Capacity,TN(Entity.Attribute)).
3.5 Time and Scheduling
-
Time Distributions: Must be selected based on real data. Common ones:
-
Exponential(λ): For random, memoryless arrivals/service. -
Uniform(a,b): For equally likely times within a range. -
Triangular(min, mode, max): For uncertain times with a most likely value. -
Normal(μ, σ): For times with symmetric variation (clip negative values!).
-
-
Schedules/Calendars: Define working periods (e.g.,
8:00-12:00, 13:00-17:00). Modules use these to know when they are "active."
3.6 Input/Output (I/O) and Data Integration
-
Reading External Data: Use
Read/Filemodules or import CSV/Excel files into Tables. Link table columns to module parameters (e.g., processing time from a columnProcTime). -
Writing Results: Configure Output Reports or use
Writemodules to log specific statistics (e.g., entity cycle time) to a file for external analysis (Excel, R).
[!TIP] Exam Critical: Know the difference between an Attribute and a Variable. Attribute = per-entity; Variable = global. Misusing them is a top modeling error.
4.0 Experimentation & Analysis Framework
4.1 Replication vs. Single-Run Analysis
-
Single Run: One long simulation. Useful for animation/debugging and warm-up analysis. Cannot provide statistical confidence.
-
Replication (Multiple Runs): Standard for output analysis. Run the model
ntimes (e.g., 30) with different random number streams. Each run is independent after warm-up. -
Warm-up Period: Initial transient period where system starts empty. Must be discarded to achieve steady-state. Determine by:
-
Time Series Plot of a key metric (e.g., WIP). Look for stabilization.
-
Rule of Thumb: Discard at least 10% of total run length, but verify visually.
-
4.2 Input Parameter Variation (What-If Analysis)
-
Manual Tuning: Change a parameter (e.g.,
# of servers) and re-run replications. -
Experimenter Tool: Built-in tool to automate runs across a grid of input values (e.g., servers=1,2,3; inter-arrival time=5,10). Collects output for all combinations.
4.3 Defining and Collecting Performance Metrics
| Metric (KOV) | Definition | How to Collect |
|---|---|---|
| Throughput | # of entities processed per unit time. | Dispose module tally or output report. |
| Cycle Time/Sojourn Time | Total time an entity spends in system. | Entity-based statistic (Tally) from Create to Dispose. |
| Utilization | % time a resource is busy. | Built-in resource statistic (Utilization). |
| Queue Length/Time | Average # in queue or average wait time. | Built-in queue statistics (Length, Wait Time). |
| WIP (Work-in-Process) | Average # of entities in system. | System variable or time-persistent statistic. |
-
Time-Persistent vs. Time-Average:
Utilizationis time-persistent (value at each instant).Avg. Queue Lengthis a time-average (integral over time). -
Setting Statistics: In module properties, check
Tally(for per-entity values) orStatistic(for time-persistent values) to be included in reports.
[!TIP] Exam Formula: Confidence Interval for Mean (across replications):
$$\bar{X} \pm t_{\alpha/2, n-1} \times \frac{S}{\sqrt{n}}$$
Where $\bar{X}$ = mean of replication means, $S$ = std dev of replication means, $n$ = # of replications, $t$ = t-distribution value.
5.0 Output Analysis & Interpretation
5.1 Understanding Generated Reports
-
Standard Reports:
Overview(summary),Entity(cycle time, etc.),Resource(utilization, schedule),Queue(length, wait time). -
Custom Reports: Filter by category or create custom reports aggregating specific statistics from multiple modules.
5.2 Statistical Treatment of Output Data
-
Point Estimators: Mean, Median, Min, Max from the replication means (not from a single long run!).
-
Confidence Intervals (CI): Mandatory for any comparative conclusion. A 95% CI not overlapping with another system's CI suggests a statistically significant difference.
-
Comparing Systems (Paired-t Test): When comparing two alternatives (A vs. B), run them with identical random number streams (paired design). Use the paired-t test on the replication outputs for more statistical power.
-
Hypothesis: $$\displaystyle H_0 $$: $$\displaystyle \mu_A = \mu_B $$ (no difference) vs. $$\displaystyle H_1 $$: $$\displaystyle \mu_A \neq \mu_B $$.
-
Test Statistic: $$\displaystyle t = \frac{\bar{d}}{S_d / \sqrt{n}} $$, where $\bar{d}$ is mean of differences $$\displaystyle (A_i - B_i) $$.
-
5.3 Graphical Analysis
-
Time Series Plot: For warm-up determination (see 4.1). Also shows system behavior over time (e.g., cyclic utilization).
-
Histogram: Shows distribution shape of an output (e.g., cycle times). Check for normality (important for t-tests).
-
Box Plot: Excellent for comparing multiple scenarios (e.g., cycle time for 1, 2, 3 servers). Shows median, quartiles, outliers.
-
Scatter Plot: To visualize relationship between input parameter and output metric.
[!TIP] Critical Rule: Never compare results from a single run. Always use replications and report confidence intervals. This is a top exam question.
6.0 Advanced Modeling Constructs
-
Submodels/Hierarchical Modeling: Encapsulate a recurring logic block (e.g., "Inspection Station") as a reusable submodel. Promotes clean design.
-
Advanced Routing:
Transporterfor mobile resources;Conveyorfor paced lines;Networknodes for path-based movement (e.g., in warehouses). -
Custom Logic/Scripting: Use embedded VBA (Arena), JavaScript (Simio), or Java (AnyLogic) for complex logic not possible with standard modules (e.g., custom scheduling, complex calculations).
-
Animation & 3D Visualization: Not just for pretty pictures. Used for debugging (watch entities move) and communication with stakeholders. Can be simple 2D shapes or full 3D.
-
Debugging Techniques:
-
Step Execution: Run model one event at a time.
-
Breakpoints: Pause execution when a condition is met (e.g.,
Entity.Attribute > 100). -
Tracing: Log detailed event sequence to a file.
-
7.0 Model Verification & Validation (V&V)
| Verification | Validation | |
|---|---|---|
| Question | "Did I build the model right?" | "Did I build the right model?" |
| Goal | Ensure model is free of bugs and implements logic correctly. | Ensure model accurately represents the real system for its intended purpose. |
| Methods | - Debugging & Trace mode<br>- Logic walkthroughs<br>- Checking for infinite loops<br>- "Glass-box" testing (knowing expected output for given input) | - Face validation with domain expert<br>- Sensitivity analysis on inputs<br>- Comparing output to historical real data<br>- "Black-box" testing (does output behavior look realistic?) |
[!TIP] Common Mistake: Skipping V&V in the lab report. Always dedicate a section to: 1) How you verified (debugging steps), 2) How you validated (expert review, sensitivity tests).
8.0 Lab Report Writing & Presentation
-
Standard Structure:
-
Problem Statement & Objectives: What decision is being supported?
-
Conceptual Model: Flow diagram of the real system, key entities, resources, processes.
-
Detailed Model Specification: Software used, list of all assumptions, input data sources & distributions (with justification!), entity/resource definitions.
-
V&V Plan & Results: How you checked correctness and realism.
-
Experimental Design: Scenarios tested, number of replications, warm-up period justification.
-
Results & Analysis: Tables/figures of key output metrics with 95% CIs. Statistical comparisons (paired-t test results).
-
Conclusions & Recommendations: Clear answer to the original problem. Limitations of the model.
-
-
Effective Visuals: Use screenshots of the model flowchart (annotated), tables with CIs, box plots for comparison. Avoid wall-of-text.
-
Management Summary: A 1-page executive summary at the front, stating the problem, key findings, and recommendation in non-technical language.
9.0 Common Lab Case Studies & Applications
-
Manufacturing: Job shop (routing via attributes), assembly line (batching, conveyors), push/pull systems (Kanban).
-
Service: Call center (skill-based routing,
Abandonmodule), hospital ED (priority triage, resource sharing), bank queue (multiple tellers, drive-up). -
Logistics: Warehouse picking (resource travel time), distribution center (cross-docking).
-
Validation Exercises: Build and compare simulation results of M/M/1 and M/M/c queues to their analytical formulas (e.g., $$\displaystyle L_q = \frac{\rho^2}{1-\rho} $$ for M/M/1). This tests model logic correctness.
[!TIP] Final Exam Strategy: For any case study, first identify: Entities? Resources? Key Process (with distribution)? Primary KOVs? Then map to standard modules (
Create->Process(with resource) ->Dispose).