Exemplo n.º 1
0
sim.addactor(q4)
sim.addactor(dl4)

sim.addprobe(pr1)
sim.addprobe(pr2)
sim.addprobe(pr3)
sim.addprobe(pr4)
sim.addprobe(pr5)
sim.addprobe(pr6)
sim.addprobe(pr7)

sim.start()

drawProbs(pr1.calculatestatistics()[1], sim.tick, "Customer Service Queue")
####drawProbs(pr3.calculatestatistics()[1], sim.tick, 'queue 3')
drawLeaveEnter(pr4.enters, "Self Service Enters")
drawProbs(pr4.calculatestatistics()[1], sim.tick, "Self Service Timeline")

drawProbs(pr5.calculatestatistics()[1], sim.tick, "End Queue Timeline")

ne = pr2.calculatestatistics()[1]
# print(ne)
numz = 0
for i in range(1, len(ne)):
    if ne[i - 1][1] < 5:
        numz += (ne[i][0] - ne[i - 1][0]) * (1 - ne[i][1] / 5)
if ne[len(ne) - 1][1] < 5:
    numz += (sim.tick - ne[len(ne) - 1][0]) * (1 - ne[len(ne) - 1][1] / 5)
utilization = 1 - (numz / sim.tick)

print("Customer Service Utilization:", utilization)
Exemplo n.º 2
0
sim.addactor(d1)
sim.addactor(d2)
sim.addactor(b1)
sim.addactor(s1)
sim.addactor(g1)
sim.addactor(e1)
sim.addactor(e2)
sim.addactor(e3)

sim.addprobe(pr1)
sim.addprobe(pr2)
sim.addprobe(pr3)

sim.start()

drawLeaveEnter(pr1.enters, 'Sold')
drawLeaveEnter(pr2.enters, 'Recycled')
#drawLeaveEnter(pr3.failures, 'Lost Opportunity')
#drawLeaveEnter(pr4.leaves, 'Newspapers Generated')
print("Sold:", len(pr1.enters))
print("Recycled:", len(pr2.enters))
print("Lost Opportunity:", len(pr3.failures))
print("Total Newspapers Generated:", len(pr4.leaves))
print(
    "Total Revenue:",
    str(SELL_PRICE * len(pr1.enters) + RECYCLE_PRICE * len(pr2.enters) -
        BUY_PRICE * len(pr4.leaves)))
print("Max Possible Revenue:",
      str((SELL_PRICE - BUY_PRICE) * (len(pr1.enters) + len(pr3.failures))))
print(
    "Performance:",
Exemplo n.º 3
0
sim = Simulation()
sim.maxtick = 50000
sim.logs = True

sim.addactor(d1)
sim.addactor(d2)
sim.addactor(b1)
sim.addactor(s1)
sim.addactor(g1)
sim.addactor(e1)
sim.addactor(e2)
sim.addactor(e3)

sim.addprobe(pr1)
sim.addprobe(pr2)
sim.addprobe(pr3)

sim.start()

drawLeaveEnter(pr1.enters, 'Sold')
drawLeaveEnter(pr2.enters, 'Recycled')
#drawLeaveEnter(pr3.failures, 'Lost Opportunity')
#drawLeaveEnter(pr4.leaves, 'Newspapers Generated')
print("Sold:",len(pr1.enters))
print("Recycled:",len(pr2.enters))
print("Lost Opportunity:",len(pr3.failures))
print("Total Newspapers Generated:",len(pr4.leaves))
print("Total Revenue:", str(SELL_PRICE * len(pr1.enters) + RECYCLE_PRICE * len(pr2.enters) - BUY_PRICE * len(pr4.leaves)))
print("Max Possible Revenue:", str ((SELL_PRICE - BUY_PRICE) * (len(pr1.enters) + len(pr3.failures))))
print("Performance:", str ((SELL_PRICE * len(pr1.enters) + RECYCLE_PRICE * len(pr2.enters) - BUY_PRICE * len(pr4.leaves)) / ((SELL_PRICE - BUY_PRICE) * (len(pr1.enters) + len(pr3.failures)))))