Commit c07af8d2 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

Queue and main script updated so that the Queue can read if it should output...

Queue and main script updated so that the Queue can read if it should output wip stats and if yes to output it
parent 2fec6055
...@@ -506,7 +506,8 @@ def createObjects(): ...@@ -506,7 +506,8 @@ def createObjects():
capacity=int(element.get('capacity') or 1) capacity=int(element.get('capacity') or 1)
isDummy=bool(int(element.get('isDummy') or 0)) isDummy=bool(int(element.get('isDummy') or 0))
schedulingRule=element.get('schedulingRule', 'FIFO') schedulingRule=element.get('schedulingRule', 'FIFO')
Q=Queue(id, name, capacity, isDummy, schedulingRule=schedulingRule) gatherWipStat=bool(int(element.get('gatherWipStat', 0)))
Q=Queue(id, name, capacity, isDummy, schedulingRule=schedulingRule, gatherWipStat=gatherWipStat)
Q.nextIds=getSuccessorList(id) Q.nextIds=getSuccessorList(id)
G.QueueList.append(Q) G.QueueList.append(Q)
G.ObjList.append(Q) G.ObjList.append(Q)
......
...@@ -34,7 +34,7 @@ from CoreObject import CoreObject ...@@ -34,7 +34,7 @@ from CoreObject import CoreObject
# =========================================================================== # ===========================================================================
class Queue(CoreObject): class Queue(CoreObject):
def __init__(self, id, name, capacity=1, isDummy=False, schedulingRule="FIFO"): def __init__(self, id, name, capacity=1, isDummy=False, schedulingRule="FIFO", gatherWipStat=False):
CoreObject.__init__(self, id, name) CoreObject.__init__(self, id, name)
# Process.__init__(self) # Process.__init__(self)
# used for the routing of the entities # used for the routing of the entities
...@@ -72,8 +72,9 @@ class Queue(CoreObject): ...@@ -72,8 +72,9 @@ class Queue(CoreObject):
raise ValueError("Unknown scheduling rule %s for %s" % raise ValueError("Unknown scheduling rule %s for %s" %
(scheduling_rule, id)) (scheduling_rule, id))
# Will be populated by an event generator self.gatherWipStat=gatherWipStat
self.wip_stat_list = [] # # Will be populated by an event generator
# self.wip_stat_list = []
@staticmethod @staticmethod
def getSupportedSchedulingRules(): def getSupportedSchedulingRules():
...@@ -296,7 +297,9 @@ class Queue(CoreObject): ...@@ -296,7 +297,9 @@ class Queue(CoreObject):
json = {'_class': 'Dream.%s' % self.__class__.__name__, json = {'_class': 'Dream.%s' % self.__class__.__name__,
'id': str(self.id), } 'id': str(self.id), }
# XXX this have to be updated to support multiple generations # XXX this have to be updated to support multiple generations
if G.numberOfReplications == 1 and self.wip_stat_list: # if G.numberOfReplications == 1 and self.wip_stat_list:
json['wip_stat_list'] = self.wip_stat_list # json['wip_stat_list'] = self.wip_stat_list
# XXX this have to be updated to support multiple generations
if G.numberOfReplications == 1 and self.gatherWipStat:
json['wip_stat_list']=self.wipStatList
G.outputJSON['elementList'].append(json) G.outputJSON['elementList'].append(json)
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