File: bank_renege.rst

package info (click to toggle)
python-simpy3 3.0.11-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,080 kB
  • sloc: python: 2,885; makefile: 138
file content (24 lines) | stat: -rw-r--r-- 663 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
===========
Bank Renege
===========

Covers:

- Resources: Resource
- Condition events

A counter with a random service time and customers who renege. Based on the
program bank08.py from TheBank tutorial of SimPy 2. (KGM)

This example models a bank counter and customers arriving t random times. Each
customer has a certain patience. It waits to get to the counter until she’s at
the end of her tether. If she gets to the counter, she uses it for a while
before releasing it.

New customers are created by the ``source`` process every few time steps.

.. literalinclude:: code/bank_renege.py

The simulation's output:

.. literalinclude:: code/bank_renege.out