Debian Codegraph @

docs/source/Tutorials/bankprograms/bank01.py

raw symbols SCIP
1 """ bank01: The single non-random Customer """ # (1)
2 from SimPy.Simulation import * # (2)
3
4 ## Model components -----------------------------
5
6
7 class Customer(Process): # (3)
8 """ Customer arrives, looks around and leaves """
9
10 def visit(self, timeInBank): # (4)
11 print("%2.1f %s Here I am" % (now(), self.name)) # (5)
12 yield hold, self, timeInBank # (6)
13 print("%2.1f %s I must leave" % (now(), self.name)) # (7)
14
15 ## Experiment data ------------------------------
16
17 maxTime = 100.0 # minutes (8)
18 timeInBank = 10.0 # minutes
19
20 ## Model/Experiment ------------------------------
21
22 initialize() # (9)
23 c = Customer(name="Klaus") # (10)
24 activate(c, c.visit(timeInBank), at=5.0) # (11)
25 simulate(until=maxTime) # (12)