Commit d80b1fbd authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

Queue object updated so that it also outputs trace

parent 29802823
......@@ -72,7 +72,7 @@ class CoreObject(Process):
#removes an entity from the Object
def removeEntity(self):
self.Res.activeQ.pop(0)
self.Res.activeQ.pop(0)
#gets an entity from the predecessor that the predecessor index points to
def getEntity(self):
......
......@@ -4,7 +4,7 @@
"_class": "Dream.Configuration",
"numberOfReplications": "1",
"maxSimTime": "1440",
"trace": "No",
"trace": "Yes",
"confidenceLevel": "0.95"
},
"elementList": [
......
......@@ -83,7 +83,9 @@ class Queue(CoreObject):
while 1:
yield waituntil, self, self.canAcceptAndIsRequested #wait until the Queue can accept an entity
#and one predecessor requests it
self.getEntity()
self.getEntity()
self.outputTrace("got into "+self.objName)
#if entity just got to the dummyQ set its startTime as the current time
if self.isDummy:
......@@ -137,6 +139,12 @@ class Queue(CoreObject):
flag=True
return len(self.Res.activeQ)>0 and flag
#removes an entity from the Object
def removeEntity(self):
self.outputTrace("releases "+self.objName)
self.Res.activeQ.pop(0)
#checks if the Queue can accept an entity and there is an entity in some predecessor waiting for it
#also updates the predecessorIndex to the one that is to be taken
def canAcceptAndIsRequested(self):
......
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