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

machine changed so that many of the input parameters (eg stdev, failure) are...

machine changed so that many of the input parameters (eg stdev, failure) are optional with default values. It will make it easier to provide simple examples
parent 6b4274fd
......@@ -168,8 +168,9 @@ def createObjects():
if(id in repairman.coreObjectIds):
r=repairman
M=Machine(id, name, 1, distributionType, [mean,stdev,min,max], failureDistribution,
MTTF, MTTR, availability, r)
M=Machine(id, name, 1, distribution=distributionType, failureDistribution=failureDistribution,
MTTF=MTTF, MTTR=MTTR, availability=availability, repairman=r,
mean=mean,stdev=stdev,min=min,max=max)
M.nextIds=getSuccessorList(id)
G.MachineList.append(M)
G.ObjList.append(M)
......@@ -193,10 +194,12 @@ def createObjects():
if(id in repairman.coreObjectIds):
r=repairman
M=MachineJobShop(id, name, 1, distributionType, [mean,stdev,min,max], failureDistribution,
MTTF, MTTR, availability, r)
M=MachineJobShop(id, name, 1, distribution=distributionType, failureDistribution=failureDistribution,
MTTF=MTTF, MTTR=MTTR, availability=availability, repairman=r,
mean=mean,stdev=stdev,min=min,max=max)
M.nextIds=getSuccessorList(id)
G.MachineJobShopList.append(M)
G.MachineList.append(M)
G.ObjList.append(M)
elif objClass=='Dream.Exit':
......@@ -233,6 +236,7 @@ def createObjects():
schedulingRule=element.get('schedulingRule', 'FIFO')
Q=QueueJobShop(id, name, capacity, isDummy, schedulingRule=schedulingRule)
Q.nextIds=getSuccessorList(id)
G.QueueList.append(Q)
G.QueueJobShopList.append(Q)
G.ObjList.append(Q)
......
......@@ -38,28 +38,27 @@ import scipy.stats as stat
class Machine(CoreObject):
#initialize the id the capacity, of the resource and the distribution
def __init__(self, id, name, capacity, dist, time, fDist, MTTF, MTTR, availability, repairman):
def __init__(self, id, name, capacity, distribution='Fixed', mean=1, stdev=0, min=0, max=10, failureDistribution='No', MTTF=0, MTTR=0, availability=0, repairman=None):
Process.__init__(self)
self.predecessorIndex=0 #holds the index of the predecessor from which the Machine will take an entity next
self.successorIndex=0 #holds the index of the successor where the Machine will dispose an entity next
self.id=id
self.objName=name
self.capacity=capacity
self.distType=dist #the distribution that the procTime follows
self.failureDistType=fDist #the distribution that the failure follows
self.distType=distribution #the distribution that the procTime follows
self.failureDistType=failureDistribution #the distribution that the failure follows
self.repairman=repairman
self.rng=RandomNumberGenerator(self, self.distType)
self.rng.avg=time[0]
self.rng.stdev=time[1]
self.rng.min=time[2]
self.rng.max=time[3]
self.rng.avg=mean
self.rng.stdev=stdev
self.rng.min=min
self.rng.max=max
self.MTTF=MTTF
self.MTTR=MTTR
self.availability=availability
self.next=[] #list with the next objects in the flow
self.previous=[] #list with the previous objects in the flow
self.nextIds=[] #list with the ids of the next objects in the flow
......
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