2 Installing PyDQ

3 Related Python Tools

3.1 SciPy

3.2 NumPy

3.3 SimPy

4 PyDQ Examples

4.1 Single queueing facility

4.2 Communications network

5 Feedback

This page has been updated to include more python-specific examples, as well as showing how to use PyDQ with other python packages, e.g., NumPy (see Sections 3.2 and 4.2). The online PDQ Manual also contains PyDQ definitions and examples. The Python version of PDQ is included as part of the current PDQ release. Making the PDQ C library available to the Python interpreter was the handy work of

- Run the Makeall script at the top-level directory:

`shell> ./Makeall` - Build manually in the python directory:

`shell> cd python`

`shell> make`

`shell> ./test.py`

**Cashier utilization:**- ρ = λS = 0.75 or 75% busy
**Residence time:**- R = S / (1 − ρ) = 4 minutes
**Queue length:**- Q = λR = 3 customers
**Waiting line:**- L = Q − ρ = 2.25 customers

- Use the routing probabilities in the diagram to write down the
**traffic equations**:λ _{1}= λ + 0.2 λ _{3}(1) λ _{2}= 0.5 λ _{1}(2) λ _{3}= 0.5 λ _{1}+ 0.8 λ_{2}(3) - Use the NumPy solver to calculate the internal
**workflows**: λ_{1}, λ_{2}, λ_{3} - Use these values to calculate the
**visit ratios**: v_{1}= λ_{1}/λ, v_{2}= λ_{2}/λ, v_{3}= λ_{3}/λ - We are told the router service times: S
_{1}= 1.0, S_{2}= 2.0, S_{3}= 1.0, - Use the visit ratios to define the router service
**demands**: D_{1}= v_{1}S_{1}, D_{2}= v_{2}S_{2}, D_{3}= v_{3}S_{3} - Use these service demands to parameterize the
**pdq.SetDemand()**function in PyDQ - Call
**pdq.Solve(pdq.CANON)**

Statistic | SimPy | PyDQ |

Avg. queue length at Comp1 | 1.6297 | 1.5625 |

Avg. queue length at Comp2 | 1.6192 | 1.5625 |

Avg. queue length at Comp3 | 1.1724 | 1.2162 |

Avg. number in the system | 4.4213 | 4.3412 |

Average response time | 8.8639 | 8.6824 |

Average service time | 1.1994 | 1.1994 |

Average throughput | 0.4983 | 0.5000 |

Total jobs simulated | 9966 | N/A |

Total simulation time | 20000.00 | N/A |

real time | 67.56 | 0.20 |

user time | 20.32 | 0.07 |

sys time | 1.96 | 0.02 |

Lines of code in the model | 197 | 75 |

File translated from T

On 31 Aug 2008, 08:41.