#!/usr/bin/env python
# encoding: utf-8

import mm1
import sim


### Params
# Mean interarrival rate of customers per second;
# hence, 0.05 <=> 3 people/minute
interarrival_rate = 0.05
# Mean service rate by the teller per second;
# hence, 0.1 <=> 6 people/minute
service_rate = 0.1
  
### Initialize
# Create new simulation engine
se = sim.SimulationEngine()
# Seed default PRNG
se.prng.seed = 100
# Create MM1 specific event handler
event_handler = mm1.MM1EventHandler()
event_handler.interarrival_rate = interarrival_rate
event_handler.service_rate = service_rate
  
### Simulate
# Schedule finishing event; simulate for 24h
se.stop(60*60*24)
# Start simulating
se.start()

@@ -45,23 +45,552 @@
 ort 
-mm1%0Aimport sim%0A
+argparse%0Aimport mm1%0Aimport sim%0Aimport time%0A%0A%0A### Parse command line arguments%0Aparser = argparse.ArgumentParser(description=%22M/M/1 queue simulation -- Main script%22)%0Aparser.add_argument('sim_duration', metavar='simulation_duration',%0A                    type=int, help='simulation duration in seconds')%0Aparser.add_argument('--seed', dest='seed', default=int(round(time.time())),%0A                    type=int, help='seed for the PRNG (default: current system timestamp)')%0Aargs = parser.parse_args()%0Asim_duration = args.sim_duration%0Aseed = args.seed
 %0A%0A##
@@ -921,11 +921,12 @@
 d = 
-100
+seed
 %0A# C
@@ -1136,43 +1136,29 @@
 vent
-; simulate for 24h%0Ase.stop(60*60*24
+%0Ase.stop(sim_duration
 )%0A# 

Add command line arguments to main script.