#!/usr/bin/env python
#
#  open1.py --- Solves the performance measures for a single queueing facility
#
#  $Id: open1.py,v 1.3 2007/01/02 02:15:35 plh Exp $
#
#---------------------------------------------------------------------

import pdq

#---- Initialize the system ------------------------------------------
pdq.Init("OpenCenter")
pdq.SetComment("This is just a simple M/M/1 queue.");

#---- Define the workload and circuit type ---------------------------
pdq.streams = pdq.CreateOpen("work"0.75)
pdq.SetWUnit("Customers")
pdq.SetTUnit("Seconds")

#---- Define the queueing center -------------------------------------
pdq.nodes = pdq.CreateNode("server"pdq.CENpdq.FCFS)

#---- Define service demand due to workload on the queueing center ---
pdq.SetDemand("server""work"1.0)

#---- Solve the model ------------------------------------------------
#  Must use the CanonIcal method for an open circuit
pdq.Solve(pdq.CANON)

#---- Generate a report ----------------------------------------------
pdq.Report()
print "Using: %s" % pdq.version

#---------------------------------------------------------------------