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

class_name removed from more objects

parent e4a5da84
...@@ -34,7 +34,7 @@ import simpy ...@@ -34,7 +34,7 @@ import simpy
# the CapacityStation object # the CapacityStation object
# =========================================================================== # ===========================================================================
class CapacityStation(Queue): class CapacityStation(Queue):
class_name = 'Dream.CapacityStation' family='CapacityStation'
#=========================================================================== #===========================================================================
# the __init__ method of the CapacityStation # the __init__ method of the CapacityStation
...@@ -65,8 +65,9 @@ class CapacityStation(Queue): ...@@ -65,8 +65,9 @@ class CapacityStation(Queue):
# ======================================================================= # =======================================================================
def outputResultsJSON(self): def outputResultsJSON(self):
from Globals import G from Globals import G
json = {'_class': self.class_name, json = {'_class': 'Dream.%s' % self.__class__.__name__,
'id': self.id, 'id': self.id,
'family': self.family,
'results': {}} 'results': {}}
if (G.numberOfReplications == 1): if (G.numberOfReplications == 1):
# if we had just one replication output the results as numbers # if we had just one replication output the results as numbers
......
...@@ -35,8 +35,7 @@ from ObjectResource import ObjectResource ...@@ -35,8 +35,7 @@ from ObjectResource import ObjectResource
# the resource that operates the machines # the resource that operates the machines
# =========================================================================== # ===========================================================================
class Operator(ObjectResource): class Operator(ObjectResource):
class_name = 'Dream.Operator' family='Operator'
def __init__(self, id, name, capacity=1, schedulingRule='FIFO'): def __init__(self, id, name, capacity=1, schedulingRule='FIFO'):
ObjectResource.__init__(self) ObjectResource.__init__(self)
...@@ -357,6 +356,7 @@ class Operator(ObjectResource): ...@@ -357,6 +356,7 @@ class Operator(ObjectResource):
from Globals import getConfidenceIntervals from Globals import getConfidenceIntervals
json = {'_class': self.class_name, json = {'_class': self.class_name,
'id': self.id, 'id': self.id,
'family': self.family,
'results': {}} 'results': {}}
if(G.numberOfReplications==1): if(G.numberOfReplications==1):
json['results']['working_ratio']=100*self.totalWorkingTime/G.maxSimTime json['results']['working_ratio']=100*self.totalWorkingTime/G.maxSimTime
......
...@@ -34,7 +34,6 @@ from Operator import Operator ...@@ -34,7 +34,6 @@ from Operator import Operator
# the resource that repairs the machines # the resource that repairs the machines
# =========================================================================== # ===========================================================================
class Repairman(Operator): class Repairman(Operator):
class_name = 'Dream.Repairman'
def __init__(self, id, name, capacity=1): def __init__(self, id, name, capacity=1):
Operator.__init__(self,id=id, name=name, capacity=capacity) Operator.__init__(self,id=id, name=name, capacity=capacity)
self.type="Repairman" self.type="Repairman"
......
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