Assessment 01 (Modeling & Simulation)
Assessment 01 (Modeling & Simulation)
Muhammad Usman
Reg.No: 2021-uam-2162
Section : (B)
Question no 01
Statement of Part A
Given Solution
Discrete-event simulation is a modeling approach where the state of the system changes only at
specific points in time, marked by events. Events occur instantaneously, such as an arrival,
departure, or completion of a task. Between events, the system remains static.
Example: Bank Queue System In a bank queue, customers arrive at random intervals, are
served by tellers, and leave. Events include customer arrivals, service start times, and service
completions. This fits the discrete-event category because system changes happen at discrete
times when these events occur.
Continuous-event simulation models systems that evolve continuously over time, often described
by differential equations. The state of the system changes constantly, not at discrete moments.
The water level in a tank increases or decreases based on inflow and outflow rates. This is a
continuous simulation because the water level changes continuously over time.
Statement of Part B
Given Solution
Time progresses in discrete jumps between events. Events are handled sequentially. Time
progresses continuously, often using small time steps or differential equations.
Typically, simpler to implement, efficient for systems with low event density. More complex due
to continuous updates; computationally intensive for fine-grained accuracy.
Areas of Application
Limitations
Cannot model continuous changes within events. Less efficient for systems with discrete
behaviors.
Question no 02
“In a Bank Queue System simulation, customers arrive at random intervals, and each
customer requires a certain amount of time to be served by one of the available tellers.
The bank has limited tellers, so if all tellers are busy, arriving customers must wait in a
queue until a teller is free.
Using the provided Python code for the Bank Queue System simulation:
Given Solution
Here's the Python simulation for the bank queue system based on the provided parameters:
import random
import simpy
arrival_time = env.now
customer_id = 0
while True:
customer_id += 1
# Parameters
random.seed(42)
simulation_time = 30 # minutes
num_tellers = 3
env = simpy.Environment()
env.run(until=simulation_time)
You can analyze these to determine average wait times and service efficiency. Let me know if
you need an extended version with detailed analysis! By running the above given code