diff --git a/dream/simulation/Assembly.py b/dream/simulation/Assembly.py index e9ddea1a0df5033c4eaea43dbac365ff5f04e8c1..5f14250cc190cbcdc35e414121c6a0ecbe41c590 100644 --- a/dream/simulation/Assembly.py +++ b/dream/simulation/Assembly.py @@ -38,9 +38,7 @@ class Assembly(CoreObject): #initialize the object def __init__(self, id, name, distribution='Fixed', mean=1, stdev=0.1, min=0, max=5, **kw): - CoreObject.__init__(self) - self.id=id - self.objName=name + CoreObject.__init__(self, id, name) self.type="Assembly" #String that shows the type of object self.distType=distribution #the distribution that the procTime follows self.rng=RandomNumberGenerator(self, self.distType) diff --git a/dream/simulation/BatchDecomposition.py b/dream/simulation/BatchDecomposition.py index e41c3446e24f7bf9ea7e7d4a93a059cfdbbef4a0..117602bc02696ec50985a3763bc05d86890451bb 100644 --- a/dream/simulation/BatchDecomposition.py +++ b/dream/simulation/BatchDecomposition.py @@ -46,10 +46,7 @@ class BatchDecomposition(CoreObject): # ======================================================================= def __init__(self, id, name, numberOfSubBatches=1, distribution='Fixed', \ mean=1, stdev=0, min=0, max=10, operator='None', **kw): - CoreObject.__init__(self) - # hold the id, name, and type of the Machine instance - self.id=id - self.objName=name + CoreObject.__init__(self, id, name) self.type="BatchDecomposition" #String that shows the type of object # holds the capacity of the object self.numberOfSubBatches=numberOfSubBatches diff --git a/dream/simulation/CompoundObject.py b/dream/simulation/CompoundObject.py index 6ce0682a492127de9dcc34024593cf7fd9228f51..c41e73b031da728780185f8b1e4a002a0fabc5ff 100644 --- a/dream/simulation/CompoundObject.py +++ b/dream/simulation/CompoundObject.py @@ -71,11 +71,10 @@ class NoneCallerObjectError(Exception): class CompoundObject(CoreObject,Queue): # object arguments may provide information on the type of the object, and the arguments needed to initiate it def __init__(self, id, name, capacity, routing='Series', *objects): - CoreObject.__init__(self) + CoreObject.__init__(self, id, name) # it would be a good idea to have the arguments provided as dictionary - self.id = id # may avoid to use that here - self.objName = name # -||- self.type = 'CompoundObject' + # variable that can hold according to this implementation two different values # 'Parallel' # 'Series' @@ -578,4 +577,4 @@ class CompoundObject(CoreObject,Queue): # def newEntry(self): # self.newEntityWillBeReceived = True - \ No newline at end of file + diff --git a/dream/simulation/Conveyer.py b/dream/simulation/Conveyer.py index 40749b23fe4579623cfb170ddefe211fcd2ead8b..938431f3c22b929d93f4844943c255a708dd92e3 100644 --- a/dream/simulation/Conveyer.py +++ b/dream/simulation/Conveyer.py @@ -36,9 +36,7 @@ from CoreObject import CoreObject class Conveyer(CoreObject): def __init__(self, id, name, length, speed, **kw): - CoreObject.__init__(self) - self.id=id - self.objName=name + CoreObject.__init__(self, id, name) self.type="Conveyer" self.speed=speed #the speed of the conveyer in m/sec self.length=length #the length of the conveyer in meters diff --git a/dream/simulation/CoreObject.py b/dream/simulation/CoreObject.py index a5ea044e23f0278dceab82f53e7123c92428b173..9082a375515ee32e4c0f6f195a257457bbe0f783 100644 --- a/dream/simulation/CoreObject.py +++ b/dream/simulation/CoreObject.py @@ -32,8 +32,10 @@ from SimPy.Simulation import Process, Resource, now # =========================================================================== class CoreObject(Process): - def __init__(self): + def __init__(self, id, name, **kw): Process.__init__(self) + self.id = id + self.objName = name # lists that hold the previous and next objects in the flow self.next=[] #list with the next objects in the flow self.previous=[] #list with the previous objects in the flow diff --git a/dream/simulation/Dismantle.py b/dream/simulation/Dismantle.py index 0d0fe52b794ccf60fee554f1abef1a117744964a..9660f889a7500ccf69acbd7ee61f4f2aafcedf99 100644 --- a/dream/simulation/Dismantle.py +++ b/dream/simulation/Dismantle.py @@ -43,9 +43,7 @@ class Dismantle(CoreObject): # ======================================================================= def __init__(self, id, name, distribution='Fixed', mean=1, stdev=0.1, min=0, max=5, **kw): - CoreObject.__init__(self) - self.id=id - self.objName=name + CoreObject.__init__(self, id, name) self.type="Dismantle" #String that shows the type of object self.distType=distribution #the distribution that the procTime follows self.rng=RandomNumberGenerator(self, self.distType) diff --git a/dream/simulation/Exit.py b/dream/simulation/Exit.py index 4ca3967a727830220c0104f4cffe15e3356e83a5..c0e93820641338eeca335a40b7b1ea24840e19a1 100644 --- a/dream/simulation/Exit.py +++ b/dream/simulation/Exit.py @@ -35,13 +35,11 @@ from CoreObject import CoreObject class Exit(CoreObject): def __init__(self, id, name=None, **kw): - CoreObject.__init__(self) if not name: name = id + CoreObject.__init__(self, id, name) self.predecessorIndex=0 # holds the index of the predecessor from which the Exit will take an entity next # general properties of the Exit - self.id=id - self.objName=name self.type="Exit" # XXX needed ? # # list with routing information # self.previous=[] # list with the previous objects in the flow diff --git a/dream/simulation/Machine.py b/dream/simulation/Machine.py index ecc0209c2ed729f140936354c9d87a6ea1061912..dd2a6e885cadd8a98fa5171c6f368cd1847de6b7 100644 --- a/dream/simulation/Machine.py +++ b/dream/simulation/Machine.py @@ -50,10 +50,7 @@ class Machine(CoreObject): loadDistribution="No",loadMean=0, loadStdev=0, loadMin=0, loadMax=10, setupDistribution="No",setupMean=0, setupStdev=0, setupMin=0, setupMax=10, isPreemptive=False, resetOnPreemption=False, **kw): - CoreObject.__init__(self) - # hold the id, name, and type of the Machine instance - self.id=id - self.objName=name + CoreObject.__init__(self, id, name) self.type="Machine" #String that shows the type of object # holds the capacity of the machine self.capacity=capacity diff --git a/dream/simulation/OrderDecomposition.py b/dream/simulation/OrderDecomposition.py index 4a744a697fd52ab8fd3aa7703b0ba83735f3f4fb..39611d50bc6a76a581c9e10a46d8514b1b96bf19 100644 --- a/dream/simulation/OrderDecomposition.py +++ b/dream/simulation/OrderDecomposition.py @@ -48,12 +48,8 @@ class MouldComponentException(Exception): # the Order-Decomposition Object # =========================================================================== class OrderDecomposition(CoreObject): - def __init__(self, id, name, **kw): - CoreObject.__init__(self) - self.id=id - self.objName=name - self.type='OrderDecomposition' - + type = 'OrderDecomposition' + # ======================================================================= # the initialize method # ======================================================================= diff --git a/dream/simulation/Queue.py b/dream/simulation/Queue.py index 29e00367dbe08a007d672aca2f251e1e4a6d0963..a6c449d06ad753ea5591a514a5b8ff0512f3ec94 100644 --- a/dream/simulation/Queue.py +++ b/dream/simulation/Queue.py @@ -35,14 +35,11 @@ from CoreObject import CoreObject class Queue(CoreObject): def __init__(self, id, name, capacity=1, isDummy=False, schedulingRule="FIFO", **kw): - CoreObject.__init__(self) + CoreObject.__init__(self, id, name) # Process.__init__(self) # used for the routing of the entities self.predecessorIndex=0 # holds the index of the predecessor from which the Queue will take an entity next self.successorIndex=0 # holds the index of the successor where the Queue will dispose an entity next - # hold the id, name, and type of the Queue instance - self.id=id - self.objName=name self.type="Queue" # String that shows the type of object # holds the capacity of the Queue if capacity>0: diff --git a/dream/simulation/Source.py b/dream/simulation/Source.py index d8c56a5b2cd477621fb6aa8593d2bfb813d5615e..b6f852e3c10a96938f7ba67252cba2d2cf334e17 100644 --- a/dream/simulation/Source.py +++ b/dream/simulation/Source.py @@ -36,11 +36,8 @@ import Globals #============================================================================ class Source(CoreObject): def __init__(self, id, name, distribution='Fixed', mean=1, item='Dream.Part', **kw): - CoreObject.__init__(self) -# Process.__init__(self) - # general properties - self.id=id - self.objName=name + CoreObject.__init__(self, id, name) + self.distType=distribution # label that sets the distribution type # properties used for statistics self.totalInterArrivalTime=0 # the total interarrival time