Exemplo n.º 1
0
# DELAY_RATE_ABLE = NumberGenerator(RANDINT, a=1, b=5)

d1 = Disposer()
d1.logs = True

# 1 is Able's maximum simultanious clients
dl1 = Delay(d1, DELAY_RATE_ABLE.next, None, 1)
dl1.name = 'Able'
dl1.logs = True

# 1 is Baker's maximum simultanious clients
dl2 = Delay(d1, DELAY_RATE_BAKER.next, None, 1)
dl2.name = 'Baker'
dl2.logs = True

q1 = Queue([dl1, dl2])
q1.logs = True

pr1 = ActorProbe(q1)
pr1.name = 'Queue Probe'
q1.actorprobe = pr1

pr2 = ActorProbe(dl1)
pr2.name = 'Able Probe'
dl1.actorprobe = pr2

pr3 = ActorProbe(dl2)
pr3.name = 'Baker Probe'
dl2.actorprobe = pr3

g1 = AutomaticGenerator(q1, Entity, None, INTERVAL_RATE.next, 200)
Exemplo n.º 2
0
# DELAY_RATE_BAKER = NumberGenerator(RANDINT, a=1, b=7)
# DELAY_RATE_ABLE = NumberGenerator(RANDINT, a=1, b=5)

s1 = Slot()

d1 = Delay(s1, DELAY_EAT.next, None)
d1.name = 'Eat'
#d1.logs = True

# Fast Food
dl1 = Delay(d1, DELAY_RATE_ABLE.next, None, 5)
dl1.name = 'Wait For Fast Food'
#dl1.logs = True

q1 = Queue([dl1])
q1.name = 'Fast Food Queue'
q1.metadata = {'quality': NumberGenerator(UNIFORM, a=3, b=6),
               'cost': NumberGenerator(UNIFORM, a=2, b=7)
               }
#q1.logs = True

pr1 = ActorProbe(q1)
pr1.name = 'Queue Probe'
q1.actorprobe = pr1

pr2 = ActorProbe(dl1)
pr2.name = 'Delay Probe'
dl1.actorprobe = pr2

Exemplo n.º 3
0
DELAY_RATE_BAKER = NumberGenerator(UNIFORM, a=1, b=2)
DELAY_RATE_ABLE = NumberGenerator(TRIANGULAR, low=2, high=3, mode=6)

# DELAY_RATE_BAKER = NumberGenerator(RANDINT, a=1, b=7)
# DELAY_RATE_ABLE = NumberGenerator(RANDINT, a=1, b=5)

d1 = Disposer()
d1.logs = True

# 1 is Able's maximum simultanious clients
dl1 = Delay(d1, DELAY_RATE_ABLE.next, None, 1)
dl1.name = 'Delay'
dl1.logs = True


q1 = Queue([dl1])
q1.logs = True

pr1 = ActorProbe(q1)
pr1.name = 'Queue Probe'
q1.actorprobe = pr1

pr2 = ActorProbe(dl1)
pr2.name = 'Delay Probe'
dl1.actorprobe = pr2


g1 = AutomaticGenerator(q1, Entity, None, INTERVAL_RATE.next, 200)
g1.logs = True

sim = Simulation()
Exemplo n.º 4
0
dl4 = Delay(d1, DELAY_RATE_1.next, None, 1)
dl4.name = "Delay 4"
dl4.logs = False

pr6 = ActorProbe(dl4)
pr6.name = "Probe Delay 4"
dl4.actorprobe = pr6

pr7 = ActorProbe(dl4)
pr7.name = "Global Probe"
pr7.calculatenumentities = True
dl4.actorleaveprobe = pr7


q4 = Queue([dl4])
q4.name = "Queue 4"
q4.logs = False

pr5 = ActorProbe(q4)
pr5.name = "Probe Queue 4"
q4.actorprobe = pr5

########################################################

dl3 = Delay(q4, DELAY_RATE_2.next, None, 0)
dl3.name = "Delay 3"
dl3.logs = False

pr4 = ActorProbe(dl3)
pr4.name = "Probe Delay 3"