Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Simulation Script Guide

Installation:

Ensure you have Python installed on your system.


Install SimPy and NumPy libraries if you haven’t already. You can do this via pip:
bash
Copy code
pip install simpy numpy
Script Overview:

The provided script simulates a queueing system for cars entering a museum, varying
arrival rates and service time models.
It uses SimPy for discrete-event simulation and NumPy for random number generation.
Trace Files:

You need to prepare trace files for arrival and service times. Replace the
placeholder lists arrival_trace and service_trace with the actual values from your
trace files.
Ensure the trace files contain arrival times and service times in the appropriate
format (e.g., one value per line).
Simulation Parameters:

The script uses a loop to run simulations for different arrival rates (lambda
values) ranging from 0.5 to 0.65 in steps of 0.05.
Adjust the lambda_values range and other parameters as needed for your specific
simulation requirements.
Running the Script:

Place the script in a directory with the necessary trace files (arrival and service
times).
Update the file names and paths within the script to match your actual files.
Run the script using a Python interpreter:
bash
Copy code
python your_script_name.py
Understanding Output:

The script generates simulation results including average waiting time, maximum
waiting time, and standard deviation.
These results are displayed for each lambda value considered in the simulation.
User Manual:

To create a user manual, document the steps mentioned above in a clear and concise
manner.
Include instructions on how to modify the script for different trace files or
parameter values if necessary.
Add any specific notes or warnings regarding file formats, simulation assumptions,
or dependencies.
By following these steps and understanding the provided script, you should be able
to simulate the queueing system and analyze the waiting times for different
scenarios. Adjustments to the script and trace files can be made to match specific
simulation requirements.

>>> the output :


%Run main.py

Pour lambda = 0.5


Car Car_1: Arrival Time=0.5, Service Time=1.5, Waiting Time=0.0
Car Car_2: Arrival Time=0.55, Service Time=1.5, Waiting Time=1.9999999999999998
Car Car_3: Arrival Time=0.6, Service Time=1.5, Waiting Time=4.05
Car Car_4: Arrival Time=0.65, Service Time=1.5, Waiting Time=6.15

Pour lambda = 0.55


Car Car_1: Arrival Time=0.5, Service Time=1.5, Waiting Time=8.3
Car Car_2: Arrival Time=0.55, Service Time=1.5, Waiting Time=10.3
Car Car_3: Arrival Time=0.6, Service Time=1.5, Waiting Time=12.350000000000001
Car Car_4: Arrival Time=0.65, Service Time=1.5, Waiting Time=14.450000000000001

Pour lambda = 0.6000000000000001


Car Car_1: Arrival Time=0.5, Service Time=1.5, Waiting Time=16.6
Car Car_2: Arrival Time=0.55, Service Time=1.5, Waiting Time=18.6
Car Car_3: Arrival Time=0.6, Service Time=1.5, Waiting Time=20.650000000000002
Car Car_4: Arrival Time=0.65, Service Time=1.5, Waiting Time=22.750000000000004

Pour lambda = 0.6500000000000001


Car Car_1: Arrival Time=0.5, Service Time=1.5, Waiting Time=24.900000000000002
Car Car_2: Arrival Time=0.55, Service Time=1.5, Waiting Time=26.900000000000002
Car Car_3: Arrival Time=0.6, Service Time=1.5, Waiting Time=28.950000000000003
Car Car_4: Arrival Time=0.65, Service Time=1.5, Waiting Time=31.050000000000004

Results :
Average Waiting Time: 0.4959999999999999
Maximum Waiting Time: 31.050000000000004
standard waiting time: 2.250284483348717
>>>

You might also like