Exemplo n.º 1
0
#
#  $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

pdq.Report()

#---------------------------------------------------------------------
Exemplo n.º 2
0
               self.visitRatio[1], self.visitRatio[2])
            ShowState("%s\n%s\n%s\n%s" % (dbstr0, dbst1, dbstr2, dbstr3))


def ShowState(*L):
    """ L is a list of strings.  Displayed by sys.stderr as concatenated 
        elements of L and then stops execution
    """
    sys.stderr.write("*** Trace state *** \n%s\n***\n" % "".join(L))
    sys.exit(1)


# PDQ modeling code starts here ...
jNet = JackNet("SimPy Jackson Network", 1)  # create an instance
pdq.Init(jNet.name)
pdq.SetWUnit("Msgs")
pdq.SetTUnit("Time")

# Create PDQ context and workload for the network
streams = pdq.CreateOpen(jNet.work, jNet.arrivRate)

# Create PDQ queues
for i in range(len(jNet.router)):
    nodes = pdq.CreateNode(jNet.router[i], pdq.CEN, pdq.FCFS)
    pdq.SetVisits(jNet.router[i], jNet.work, jNet.visitRatio[i], \
       jNet.servTime[i])

# Solve the model and report the peformance measures
pdq.Solve(pdq.CANON)
pdq.Report()
# generic PDQ format
Exemplo n.º 3
0
#  copies of the Software, and permit persons to whom the Software is         #
#  furnished to do so, under the terms of the COPYING file.                   #
#                                                                             #
#  This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY  #
#  KIND, either express or implied.                                           #
###############################################################################

#
# Created by NJG on Wed, Apr 18, 2007
#
#
# $Id: orca.py,v 1.2 2009/03/26 02:55:32 pfeller Exp $

import pdq

# Measured parameters
servers = 4
arivrate = 0.099  # per hr
servtime = 10.0  # hrs

pdq.Init("ORCA Batch")
nstreams = pdq.CreateOpen("Crunch", arivrate)
pdq.SetWUnit("Jobs")
pdq.SetTUnit("Hours")

nnodes = pdq.CreateNode("HPC", int(servers), pdq.MSQ)

pdq.SetDemand("HPC", "Crunch", servtime)
pdq.Solve(pdq.CANON)
pdq.Report()
Exemplo n.º 4
0
#!/usr/bin/env python
###############################################################################
#  Copyright (C) 1994 - 2009, Performance Dynamics Company                    #
#                                                                             #
#  This software is licensed as described in the file COPYING, which          #
#  you should have received as part of this distribution. The terms           #
#  are also available at http://www.perfdynamics.com/Tools/copyright.html.    #
#                                                                             #
#  You may opt to use, copy, modify, merge, publish, distribute and/or sell   #
#  copies of the Software, and permit persons to whom the Software is         #
#  furnished to do so, under the terms of the COPYING file.                   #
#                                                                             #
#  This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY  #
#  KIND, either express or implied.                                           #
###############################################################################

#
# M/M/1 in PyDQ

import pdq

pdq.Init("Python Test Script")
pdq.nodes = pdq.CreateNode("Deadhorse", pdq.CEN, pdq.FCFS)
pdq.streams = pdq.CreateOpen("Floggit", 0.75)
pdq.SetWUnit("Cust")
pdq.SetTUnit("Min")
pdq.SetDemand("Deadhorse", "Floggit", 1.0)
pdq.Solve(pdq.CANON)
pdq.Report()