Commit 35f7857d authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

Queue updated in order to be able to have infinite capacity. 0 or a negative...

Queue updated in order to be able to have infinite capacity. 0 or a negative integer must be given as input
parent 46fbe879
......@@ -32,7 +32,7 @@
"nodes": {
"Q1": {
"_class": "Dream.Queue",
"capacity": "100000",
"capacity": "-1",
"left": 0.6968085106382979,
"name": "StartQueue",
"top": 0.7727272727272727
......
......@@ -64,7 +64,7 @@
},
"Q1": {
"_class": "Dream.Queue",
"capacity": "100000",
"capacity": "-1",
"left": 0.6968085106382979,
"name": "StartQueue",
"top": 0.7727272727272727
......
......@@ -64,7 +64,7 @@
},
"Q1": {
"_class": "Dream.Queue",
"capacity": "100000",
"capacity": "-1",
"left": 0.6968085106382979,
"name": "StartQueue",
"top": 0.7727272727272727
......
......@@ -27,7 +27,7 @@ Models a FIFO queue where entities can wait in order to get into a server
from SimPy.Simulation import Process, Resource
from SimPy.Simulation import waituntil, now
from SimPy.Simulation import waituntil, now, infinity
from CoreObject import CoreObject
# ===========================================================================
# the Queue object
......@@ -44,7 +44,10 @@ class Queue(CoreObject):
self.objName=name
self.type="Queue" # String that shows the type of object
# holds the capacity of the Queue
self.capacity=capacity
if capacity>0:
self.capacity=capacity
else:
self.capacity=infinity
# consider removing the following, the are restated in the initialize() method
# self.nameLastEntityEntered="" #keeps the name of the last entity that entered in the object
# self.timeLastEntityEntered=0 #keeps the time of the last entity that entered in the object
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment