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 @@ ...@@ -32,7 +32,7 @@
"nodes": { "nodes": {
"Q1": { "Q1": {
"_class": "Dream.Queue", "_class": "Dream.Queue",
"capacity": "100000", "capacity": "-1",
"left": 0.6968085106382979, "left": 0.6968085106382979,
"name": "StartQueue", "name": "StartQueue",
"top": 0.7727272727272727 "top": 0.7727272727272727
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
}, },
"Q1": { "Q1": {
"_class": "Dream.Queue", "_class": "Dream.Queue",
"capacity": "100000", "capacity": "-1",
"left": 0.6968085106382979, "left": 0.6968085106382979,
"name": "StartQueue", "name": "StartQueue",
"top": 0.7727272727272727 "top": 0.7727272727272727
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
}, },
"Q1": { "Q1": {
"_class": "Dream.Queue", "_class": "Dream.Queue",
"capacity": "100000", "capacity": "-1",
"left": 0.6968085106382979, "left": 0.6968085106382979,
"name": "StartQueue", "name": "StartQueue",
"top": 0.7727272727272727 "top": 0.7727272727272727
......
...@@ -27,7 +27,7 @@ Models a FIFO queue where entities can wait in order to get into a server ...@@ -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 Process, Resource
from SimPy.Simulation import waituntil, now from SimPy.Simulation import waituntil, now, infinity
from CoreObject import CoreObject from CoreObject import CoreObject
# =========================================================================== # ===========================================================================
# the Queue object # the Queue object
...@@ -44,7 +44,10 @@ class Queue(CoreObject): ...@@ -44,7 +44,10 @@ class Queue(CoreObject):
self.objName=name self.objName=name
self.type="Queue" # String that shows the type of object self.type="Queue" # String that shows the type of object
# holds the capacity of the Queue # 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 # 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.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 # 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