# Prevent this program from loading pdq.py in this directory import sys del sys.path[0] import pdq #---- Define globals ------------------------------------------------- arrivRate = 0.75 service_time = 1.0 #---- Initialize ----------------------------------------------------- pdq.Init("OpenCenter") pdq.SetComment("A simple M/M/1 queue") #---- Define the workload and circuit type --------------------------- pdq.streams = pdq.CreateOpen("work", arrivRate) pdq.SetWUnit("Customers") pdq.SetTUnit("Seconds") #---- Define the queueing center ------------------------------------- pdq.nodes = pdq.CreateNode("server", pdq.CEN, pdq.FCFS) #---- Define service demand due to workload on the queueing center --- pdq.SetDemand("server", "work", service_time)
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # # KIND, either express or implied. # ############################################################################### # # mmm.py # # Created by NJG on Fri, Apr 13, 2007 # import pdq # Parameters taken from mmm_sim.py file arrivalRate = 2.0 serviceTime = 1.0 pdq.Init("M/M/m in PyDQ") pdq.SetComment("Cf. SimPy Results.") pdq.streams = pdq.CreateOpen("work", arrivalRate) pdq.SetWUnit("Customers") pdq.SetTUnit("Seconds") pdq.nodes = pdq.CreateNode("server", 3, pdq.MSQ) pdq.SetDemand("server", "work", serviceTime) pdq.Solve(pdq.CANON) pdq.Report()
# # open1msq.py # # Created by NJG on Fri, Apr 13, 2007 (test MSQ vs. M/M/1 in PyDQ) # # $Id: open1msq.py,v 1.2 2009/03/26 02:55:32 pfeller Exp $ # #--------------------------------------------------------------------- import pdq arrivalRate = 0.75 serviceTime = 1.0 pdq.Init("Open1 MSQ Test") pdq.SetComment("Cf. M/M/1/FCFS against MSQ with m=1 in PyDQ.") pdq.streams = pdq.CreateOpen("work", arrivalRate) pdq.SetWUnit("Customers") pdq.SetTUnit("Seconds") pdq.nodes = pdq.CreateNode("MM1", pdq.CEN, pdq.FCFS) pdq.nodes = pdq.CreateNode("MMm", 1, pdq.MSQ) pdq.SetDemand("MM1", "work", serviceTime) pdq.SetDemand("MMm", "work", serviceTime) pdq.Solve(pdq.CANON) print "Using: %s" % pdq.version
############################################################################### # # $Id: open1.py,v 4.4 2009/03/26 02:55:32 pfeller Exp $ # #--------------------------------------------------------------------- import pdq arrivRate = 0.75 service_time = 1.0 #---- Initialize the system ------------------------------------------ pdq.Init("OpenCenter") pdq.SetComment("This is just a simple M/M/1 queue.") #---- Define the queueing center ------------------------------------- pdq.nodes = pdq.CreateNode("server", pdq.CEN, pdq.FCFS) #---- Define the workload and circuit type --------------------------- pdq.streams = pdq.CreateOpen("work", arrivRate) pdq.SetWUnit("Customers") pdq.SetTUnit("Seconds") #---- Define service demand due to workload on the queueing center --- pdq.SetDemand("server", "work", service_time)