Commit f11bf8f5 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Examples updated to matchnew notations. TODOS: create tests and update...

Examples updated to matchnew notations. TODOS: create tests and update BatchDecomposition/Reassembly distribution definitions
parent 74769aa1
...@@ -54,5 +54,5 @@ def main(): ...@@ -54,5 +54,5 @@ def main():
"working_ratio": working_ratio} "working_ratio": working_ratio}
if __name__ == '__main__': if __name__ == '__main__':
main() main()
...@@ -5,14 +5,14 @@ from dream.simulation.imports import simulate, activate, initialize ...@@ -5,14 +5,14 @@ from dream.simulation.imports import simulate, activate, initialize
# choose to output trace or not # choose to output trace or not
G.trace='Yes' G.trace='Yes'
# define the objects of the model # define the objects of the model
S=BatchSource('S','Source',mean=1.5, entity='Dream.Batch', batchNumberOfUnits=100) S=BatchSource('S','Source',interarrivalTime={'distributionType':'Fixed','mean':1.5}, entity='Dream.Batch', batchNumberOfUnits=100)
Q=Queue('Q','StartQueue',capacity=-1) Q=Queue('Q','StartQueue',capacity=100000)
BD=BatchDecomposition('BC', 'BatchDecomposition', numberOfSubBatches=4, mean=1) BD=BatchDecomposition('BC', 'BatchDecomposition', numberOfSubBatches=4, mean=1)
M1=Machine('M1','Machine1',mean=0.5) M1=Machine('M1','Machine1',processingTime={'distributionType':'Fixed','mean':0.5})
Q1=LineClearance('Q1','Queue1',capacity=2) Q1=LineClearance('Q1','Queue1',capacity=2)
M2=Machine('M2','Machine2',mean=4) M2=Machine('M2','Machine2',processingTime={'distributionType':'Fixed','mean':4})
BRA=BatchReassembly('BRA', 'BatchReassembly', numberOfSubBatches=4, mean=0) BRA=BatchReassembly('BRA', 'BatchReassembly', numberOfSubBatches=4, mean=0)
M3=Machine('M3','Machine3',mean=1) M3=Machine('M3','Machine3',processingTime={'distributionType':'Fixed','mean':1})
E=Exit('E','Exit') E=Exit('E','Exit')
# add all the objects in the G.ObjList so that they can be easier accessed later # add all the objects in the G.ObjList so that they can be easier accessed later
G.ObjList=[S,Q,BD,M1,Q1,M2,BRA,M3,E] G.ObjList=[S,Q,BD,M1,Q1,M2,BRA,M3,E]
...@@ -26,31 +26,55 @@ M2.defineRouting([Q1],[BRA]) ...@@ -26,31 +26,55 @@ M2.defineRouting([Q1],[BRA])
BRA.defineRouting([M2],[M3]) BRA.defineRouting([M2],[M3])
M3.defineRouting([BRA],[E]) M3.defineRouting([BRA],[E])
E.defineRouting([M3]) E.defineRouting([M3])
# initialize the simulation (SimPy method)
initialize() def main():
# initialize all the objects # initialize the simulation (SimPy method)
for object in G.ObjList: initialize()
object.initialize() # initialize all the objects
# activate all the objects for object in G.ObjList:
for object in G.ObjList: object.initialize()
activate(object,object.run()) # activate all the objects
# set G.maxSimTime 1440.0 minutes (1 day) for object in G.ObjList:
G.maxSimTime=1440.0 activate(object,object.run())
# run the simulation # set G.maxSimTime 1440.0 minutes (1 day)
simulate(until=G.maxSimTime) G.maxSimTime=1440.0
# carry on the post processing operations for every object in the topology # run the simulation
for object in G.ObjList: simulate(until=G.maxSimTime)
object.postProcessing() # carry on the post processing operations for every object in the topology
# print trace for object in G.ObjList:
ExcelHandler.outputTrace('Trace') object.postProcessing()
# print the results # print the results
print "the system produced", E.numOfExits, "parts" print "the system produced", E.numOfExits, "parts"
print "the working ratio of", M1.objName, "is", (M1.totalWorkingTime/G.maxSimTime)*100 working_ratio_M1 = (M1.totalWorkingTime/G.maxSimTime)*100
print "the blockage ratio of", M1.objName, 'is', (M1.totalBlockageTime/G.maxSimTime)*100 blockage_ratio_M1 = (M1.totalBlockageTime/G.maxSimTime)*100
print "the waiting ratio of", M1.objName, 'is', (M1.totalWaitingTime/G.maxSimTime)*100 waiting_ratio_M1 = (M1.totalWaitingTime/G.maxSimTime)*100
print "the working ratio of", M2.objName, "is", (M2.totalWorkingTime/G.maxSimTime)*100 print "the working ratio of", M1.objName, "is", working_ratio_M1
print "the blockage ratio of", M2.objName, 'is', (M2.totalBlockageTime/G.maxSimTime)*100 print "the blockage ratio of", M1.objName, 'is', blockage_ratio_M1
print "the waiting ratio of", M2.objName, 'is', (M2.totalWaitingTime/G.maxSimTime)*100 print "the waiting ratio of", M1.objName, 'is', waiting_ratio_M1
print "the working ratio of", M3.objName, "is", (M3.totalWorkingTime/G.maxSimTime)*100 working_ratio_M2 = (M2.totalWorkingTime/G.maxSimTime)*100
print "the blockage ratio of", M3.objName, 'is', (M3.totalBlockageTime/G.maxSimTime)*100 blockage_ratio_M2 = (M2.totalBlockageTime/G.maxSimTime)*100
print "the waiting ratio of", M3.objName, 'is', (M3.totalWaitingTime/G.maxSimTime)*100 waiting_ratio_M2 = (M2.totalWaitingTime/G.maxSimTime)*100
print "the working ratio of", M2.objName, "is", working_ratio_M2
print "the blockage ratio of", M2.objName, 'is', blockage_ratio_M2
print "the waiting ratio of", M2.objName, 'is', waiting_ratio_M2
working_ratio_M3 = (M3.totalWorkingTime/G.maxSimTime)*100
blockage_ratio_M3 = (M3.totalBlockageTime/G.maxSimTime)*100
waiting_ratio_M3 = (M3.totalWaitingTime/G.maxSimTime)*100
print "the working ratio of", M3.objName, "is", working_ratio_M3
print "the blockage ratio of", M3.objName, 'is', blockage_ratio_M3
print "the waiting ratio of", M3.objName, 'is', waiting_ratio_M3
return {"parts": E.numOfExits,
"working_ratio_M1": working_ratio_M1,
"blockage_ratio_M1": blockage_ratio_M1,
"waiting_ratio_M1": waiting_ratio_M1,
"working_ratio_M2": working_ratio_M2,
"blockage_ratio_M2": blockage_ratio_M2,
"waiting_ratio_M2": waiting_ratio_M2,
"working_ratio_M3": working_ratio_M3,
"blockage_ratio_M3": blockage_ratio_M3,
"waiting_ratio_M3": waiting_ratio_M3,
}
if __name__ == '__main__':
main()
...@@ -2,10 +2,10 @@ from dream.simulation.imports import Machine, BatchSource, Exit, Batch, BatchDec ...@@ -2,10 +2,10 @@ from dream.simulation.imports import Machine, BatchSource, Exit, Batch, BatchDec
from dream.simulation.imports import simulate, activate, initialize from dream.simulation.imports import simulate, activate, initialize
# define the objects of the model # define the objects of the model
S=BatchSource('S','Source',mean=0.5, entity='Dream.Batch', batchNumberOfUnits=4) S=BatchSource('S','Source',interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.Batch', batchNumberOfUnits=4)
Q=Queue('Q','StartQueue',capacity=100000) Q=Queue('Q','StartQueue',capacity=100000)
BD=BatchDecomposition('BC', 'BatchDecomposition', numberOfSubBatches=4, mean=1) BD=BatchDecomposition('BC', 'BatchDecomposition', numberOfSubBatches=4, mean=1)
M=Machine('M','Machine',mean=0.5) M=Machine('M','Machine',processingTime={'distributionType':'Fixed','mean':0.5})
E=Exit('E','Exit') E=Exit('E','Exit')
# add all the objects in the G.ObjList so that they can be easier accessed later # add all the objects in the G.ObjList so that they can be easier accessed later
G.ObjList=[S,Q,BD,M,E] G.ObjList=[S,Q,BD,M,E]
...@@ -15,23 +15,35 @@ Q.defineRouting([S],[BD]) ...@@ -15,23 +15,35 @@ Q.defineRouting([S],[BD])
BD.defineRouting([Q],[M]) BD.defineRouting([Q],[M])
M.defineRouting([BD],[E]) M.defineRouting([BD],[E])
E.defineRouting([M]) E.defineRouting([M])
# initialize the simulation (SimPy method)
initialize() def main():
# initialize all the objects # initialize the simulation (SimPy method)
for object in G.ObjList: initialize()
object.initialize() # initialize all the objects
# activate all the objects for object in G.ObjList:
for object in G.ObjList: object.initialize()
activate(object,object.run()) # activate all the objects
# set G.maxSimTime 1440.0 minutes (1 day) for object in G.ObjList:
G.maxSimTime=1440.0 activate(object,object.run())
# run the simulation # set G.maxSimTime 1440.0 minutes (1 day)
simulate(until=G.maxSimTime) G.maxSimTime=1440.0
# carry on the post processing operations for every object in the topology # run the simulation
for object in G.ObjList: simulate(until=G.maxSimTime)
object.postProcessing() # carry on the post processing operations for every object in the topology
# print the results for object in G.ObjList:
print "the system produced", E.numOfExits, "parts" object.postProcessing()
print "the working ratio of", M.objName, "is", (M.totalWorkingTime/G.maxSimTime)*100 # print the results
print "the blockage ratio of", M.objName, 'is', (M.totalBlockageTime/G.maxSimTime)*100 print "the system produced", E.numOfExits, "parts"
print "the waiting ratio of", M.objName, 'is', (M.totalWaitingTime/G.maxSimTime)*100 working_ratio = (M.totalWorkingTime/G.maxSimTime)*100
blockage_ratio = (M.totalBlockageTime/G.maxSimTime)*100
waiting_ratio = (M.totalWaitingTime/G.maxSimTime)*100
print "the working ratio of", M.objName, "is", working_ratio
print "the blockage ratio of", M.objName, 'is', blockage_ratio
print "the waiting ratio of", M.objName, 'is', waiting_ratio
return {"parts": E.numOfExits,
"working_ratio": working_ratio,
"blockage_ratio": blockage_ratio,
"waiting_ratio": waiting_ratio}
if __name__ == '__main__':
main()
...@@ -23,31 +23,32 @@ J1Route=[{"stationIdsList": ["Q1"]}, ...@@ -23,31 +23,32 @@ J1Route=[{"stationIdsList": ["Q1"]},
#define the Jobs #define the Jobs
J=Job('J1','Job1',route=J1Route) J=Job('J1','Job1',route=J1Route)
G.EntityList=[J] #a list to hold all the jobs G.EntityList=[J] #a list to hold all the jobs
initialize() #initialize the simulation (SimPy method)
#initialize all the objects
for object in G.ObjList:
object.initialize()
J.initialize()
#set the WIP def main():
Globals.setWIP(G.EntityList) initialize() #initialize the simulation (SimPy method)
#initialize all the objects
for object in G.ObjList:
object.initialize()
J.initialize()
#activate all the objects #set the WIP
for object in G.ObjList: Globals.setWIP(G.EntityList)
activate(object, object.run())
#activate all the objects
simulate(until=infinity) #run the simulation until there are no more events for object in G.ObjList:
activate(object, object.run())
G.maxSimTime=E.timeLastEntityLeft #calculate the maxSimTime as the time that the last Job left
simulate(until=infinity) #run the simulation until there are no more events
G.maxSimTime=E.timeLastEntityLeft #calculate the maxSimTime as the time that the last Job left
#loop in the schedule to print the results
returnSchedule=[] # dummy variable used just for returning values and testing
for record in J.schedule:
returnSchedule.append([record[0].objName,record[1]])
print J.name, "got into", record[0].objName, "at", record[1]
return returnSchedule
#loop in the schedule to print the results if __name__ == '__main__':
for record in J.schedule: main()
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id \ No newline at end of file
name=None
for obj in G.ObjList:
if obj is record[0]:
name=obj.objName
print J.name, "got into", name, "at", record[1]
\ No newline at end of file
...@@ -26,33 +26,36 @@ J1Route=[{"stationIdsList": ["Q1"]}, ...@@ -26,33 +26,36 @@ J1Route=[{"stationIdsList": ["Q1"]},
J=Job('J1','Job1',route=J1Route) J=Job('J1','Job1',route=J1Route)
G.EntityList=[J] #a list to hold all the jobs G.EntityList=[J] #a list to hold all the jobs
initialize() #initialize the simulation (SimPy method) def main():
initialize() #initialize the simulation (SimPy method)
#initialize all the objects
for object in G.ObjList:
object.initialize()
J.initialize()
#set the WIP
Globals.setWIP(G.EntityList)
#initialize all the objects #activate all the objects
for object in G.ObjList: for object in G.ObjList:
object.initialize() activate(object, object.run())
J.initialize()
#set the WIP
Globals.setWIP(G.EntityList)
#activate all the objects simulate(until=infinity) #run the simulation until there are no more events
for object in G.ObjList:
activate(object, object.run()) G.maxSimTime=E.timeLastEntityLeft #calculate the maxSimTime as the time that the last Job left
simulate(until=infinity) #run the simulation until there are no more events #loop in the schedule to print the results
schedule=[]
G.maxSimTime=E.timeLastEntityLeft #calculate the maxSimTime as the time that the last Job left for record in J.schedule:
schedule.append([record[0].objName,record[1]])
#loop in the schedule to print the results print J.name, "got into", record[0].objName, "at", record[1]
for record in J.schedule: ExcelHandler.outputTrace('TRACE')
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id return schedule
name=None
for obj in G.ObjList: if __name__ == '__main__':
if obj is record[0]: main()
name=obj.objName
print J.name, "got into", name, "at", record[1]
ExcelHandler.outputTrace('TRACE')
...@@ -48,34 +48,38 @@ J3=Job('J3','Job3',route=J3Route, priority=0, dueDate=110) ...@@ -48,34 +48,38 @@ J3=Job('J3','Job3',route=J3Route, priority=0, dueDate=110)
G.JobList=[J1,J2,J3] #a list to hold all the jobs G.JobList=[J1,J2,J3] #a list to hold all the jobs
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day) G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
def main():
initialize() #initialize the simulation (SimPy method)
#initialize all the objects
for object in G.ObjList:
object.initialize()
#initialize all the jobs
for job in G.JobList:
job.initialize()
initialize() #initialize the simulation (SimPy method) #set the WIP for all the jobs
Globals.setWIP(G.JobList)
#initialize all the objects #activate all the objects
for object in G.ObjList: for object in G.ObjList:
object.initialize() activate(object, object.run())
#initialize all the jobs
for job in G.JobList:
job.initialize()
#set the WIP for all the jobs
Globals.setWIP(G.JobList)
#activate all the objects simulate(until=G.maxSimTime) #run the simulation
for object in G.ObjList:
activate(object, object.run()) #output the schedule of every job
returnSchedule=[] # dummy variable used just for returning values and testing
simulate(until=G.maxSimTime) #run the simulation for job in G.JobList:
#loop in the schedule to print the results
#output the schedule of every job for record in job.schedule:
for job in G.JobList: #schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
#loop in the schedule to print the results name=None
for record in job.schedule: returnSchedule.append([record[0].objName,record[1]])
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id print job.name, "got into", record[0].objName, "at", record[1]
name=None print "-"*30
for obj in G.ObjList: return returnSchedule
if obj is record[0]:
name=obj.objName if __name__ == '__main__':
print job.name, "got into", name, "at", record[1] main()
print "-"*30 \ No newline at end of file
...@@ -48,34 +48,38 @@ J3=Job('J3','Job3',route=J3Route, priority=0, dueDate=110) ...@@ -48,34 +48,38 @@ J3=Job('J3','Job3',route=J3Route, priority=0, dueDate=110)
G.JobList=[J1,J2,J3] #a list to hold all the jobs G.JobList=[J1,J2,J3] #a list to hold all the jobs
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day) G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
def main():
initialize() #initialize the simulation (SimPy method)
#initialize all the objects
for object in G.ObjList:
object.initialize()
#initialize all the jobs
for job in G.JobList:
job.initialize()
initialize() #initialize the simulation (SimPy method) #set the WIP for all the jobs
Globals.setWIP(G.JobList)
#initialize all the objects #activate all the objects
for object in G.ObjList: for object in G.ObjList:
object.initialize() activate(object, object.run())
#initialize all the jobs
for job in G.JobList:
job.initialize()
#set the WIP for all the jobs
Globals.setWIP(G.JobList)
#activate all the objects simulate(until=G.maxSimTime) #run the simulation
for object in G.ObjList:
activate(object, object.run()) #output the schedule of every job
returnSchedule=[] # dummy variable used just for returning values and testing
simulate(until=G.maxSimTime) #run the simulation for job in G.JobList:
#loop in the schedule to print the results
#output the schedule of every job for record in job.schedule:
for job in G.JobList: #schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
#loop in the schedule to print the results name=None
for record in job.schedule: returnSchedule.append([record[0].objName,record[1]])
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id print job.name, "got into", record[0].objName, "at", record[1]
name=None print "-"*30
for obj in G.ObjList: return returnSchedule
if obj is record[0]:
name=obj.objName if __name__ == '__main__':
print job.name, "got into", name, "at", record[1] main()
print "-"*30 \ No newline at end of file
...@@ -48,34 +48,38 @@ J3=Job('J3','Job3',route=J3Route, priority=0, dueDate=110) ...@@ -48,34 +48,38 @@ J3=Job('J3','Job3',route=J3Route, priority=0, dueDate=110)
G.JobList=[J1,J2,J3] #a list to hold all the jobs G.JobList=[J1,J2,J3] #a list to hold all the jobs
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day) G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
def main():
initialize() #initialize the simulation (SimPy method)
#initialize all the objects
for object in G.ObjList:
object.initialize()
#initialize all the jobs
for job in G.JobList:
job.initialize()
initialize() #initialize the simulation (SimPy method) #set the WIP for all the jobs
Globals.setWIP(G.JobList)
#initialize all the objects #activate all the objects
for object in G.ObjList: for object in G.ObjList:
object.initialize() activate(object, object.run())
#initialize all the jobs
for job in G.JobList:
job.initialize()
#set the WIP for all the jobs
Globals.setWIP(G.JobList)
#activate all the objects simulate(until=G.maxSimTime) #run the simulation
for object in G.ObjList:
activate(object, object.run()) #output the schedule of every job
returnSchedule=[] # dummy variable used just for returning values and testing
simulate(until=G.maxSimTime) #run the simulation for job in G.JobList:
#loop in the schedule to print the results
#output the schedule of every job for record in job.schedule:
for job in G.JobList: #schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
#loop in the schedule to print the results name=None
for record in job.schedule: returnSchedule.append([record[0].objName,record[1]])
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id print job.name, "got into", record[0].objName, "at", record[1]
name=None print "-"*30
for obj in G.ObjList: return returnSchedule
if obj is record[0]:
name=obj.objName if __name__ == '__main__':
print job.name, "got into", name, "at", record[1] main()
print "-"*30 \ No newline at end of file
...@@ -2,7 +2,7 @@ from dream.simulation.imports import MachineJobShop, QueueJobShop, ExitJobShop, ...@@ -2,7 +2,7 @@ from dream.simulation.imports import MachineJobShop, QueueJobShop, ExitJobShop,
from dream.simulation.imports import simulate, activate, initialize, infinity from dream.simulation.imports import simulate, activate, initialize, infinity
#define the objects of the model #define the objects of the model
Q1=QueueJobShop('Q1','Queue1', capacity=infinity, schedulingRule="LPT") Q1=QueueJobShop('Q1','Queue1', capacity=infinity, schedulingRule="RPC")
Q2=QueueJobShop('Q2','Queue2', capacity=infinity) Q2=QueueJobShop('Q2','Queue2', capacity=infinity)
Q3=QueueJobShop('Q3','Queue3', capacity=infinity) Q3=QueueJobShop('Q3','Queue3', capacity=infinity)
M1=MachineJobShop('M1','Machine1') M1=MachineJobShop('M1','Machine1')
...@@ -48,34 +48,38 @@ J3=Job('J3','Job3',route=J3Route, priority=0, dueDate=110) ...@@ -48,34 +48,38 @@ J3=Job('J3','Job3',route=J3Route, priority=0, dueDate=110)
G.JobList=[J1,J2,J3] #a list to hold all the jobs G.JobList=[J1,J2,J3] #a list to hold all the jobs
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day) G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
def main():
initialize() #initialize the simulation (SimPy method)
#initialize all the objects
for object in G.ObjList:
object.initialize()
#initialize all the jobs
for job in G.JobList:
job.initialize()
initialize() #initialize the simulation (SimPy method) #set the WIP for all the jobs
Globals.setWIP(G.JobList)
#initialize all the objects #activate all the objects
for object in G.ObjList: for object in G.ObjList:
object.initialize() activate(object, object.run())
#initialize all the jobs
for job in G.JobList:
job.initialize()
#set the WIP for all the jobs
Globals.setWIP(G.JobList)
#activate all the objects simulate(until=G.maxSimTime) #run the simulation
for object in G.ObjList:
activate(object, object.run()) #output the schedule of every job
returnSchedule=[] # dummy variable used just for returning values and testing
simulate(until=G.maxSimTime) #run the simulation for job in G.JobList:
#loop in the schedule to print the results
#output the schedule of every job for record in job.schedule:
for job in G.JobList: #schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
#loop in the schedule to print the results name=None
for record in job.schedule: returnSchedule.append([record[0].objName,record[1]])
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id print job.name, "got into", record[0].objName, "at", record[1]
name=None print "-"*30
for obj in G.ObjList: return returnSchedule
if obj is record[0]:
name=obj.objName if __name__ == '__main__':
print job.name, "got into", name, "at", record[1] main()
print "-"*30 \ No newline at end of file
...@@ -2,13 +2,13 @@ from dream.simulation.imports import Machine, Source, Exit, Part, Queue, G, Fail ...@@ -2,13 +2,13 @@ from dream.simulation.imports import Machine, Source, Exit, Part, Queue, G, Fail
from dream.simulation.imports import simulate, activate, initialize, infinity from dream.simulation.imports import simulate, activate, initialize, infinity
#define the objects of the model #define the objects of the model
S=Source('S','Source', mean=0.5, entity='Dream.Part') S=Source('S','Source', interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.Part')
Q=Queue('Q','Queue', capacity=infinity) Q=Queue('Q','Queue', capacity=infinity)
M1=Machine('M1','Milling1', mean=0.25) M1=Machine('M1','Milling1', processingTime={'distributionType':'Fixed','mean':0.25})
M2=Machine('M2','Milling2', mean=0.25) M2=Machine('M2','Milling2', processingTime={'distributionType':'Fixed','mean':0.25})
E=Exit('E1','Exit') E=Exit('E1','Exit')
F=Failure(victim=M1, distributionType='Fixed', MTTF=60, MTTR=5) F=Failure(victim=M1, distribution={'distributionType':'Fixed','MTTF':60,'MTTR':5})
G.ObjList=[S,Q,M1,M2,E] #add all the objects in G.ObjList so that they can be easier accessed later G.ObjList=[S,Q,M1,M2,E] #add all the objects in G.ObjList so that they can be easier accessed later
...@@ -22,32 +22,40 @@ M1.defineRouting([Q],[E]) ...@@ -22,32 +22,40 @@ M1.defineRouting([Q],[E])
M2.defineRouting([Q],[E]) M2.defineRouting([Q],[E])
E.defineRouting([M1,M2]) E.defineRouting([M1,M2])
initialize() #initialize the simulation (SimPy method) def main():
initialize() #initialize the simulation (SimPy method)
for object in G.ObjList:
object.initialize()
for objectInterruption in G.ObjectInterruptionList:
objectInterruption.initialize()
for object in G.ObjList: #activate all the objects
object.initialize() for object in G.ObjList:
activate(object, object.run())
for objectInterruption in G.ObjectInterruptionList: for objectInterruption in G.ObjectInterruptionList:
objectInterruption.initialize() activate(objectInterruption, objectInterruption.run())
#activate all the objects
for object in G.ObjList:
activate(object, object.run())
for objectInterruption in G.ObjectInterruptionList:
activate(objectInterruption, objectInterruption.run())
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
simulate(until=G.maxSimTime) #run the simulation G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
#carry on the post processing operations for every object in the topology simulate(until=G.maxSimTime) #run the simulation
for object in G.ObjList:
object.postProcessing() #carry on the post processing operations for every object in the topology
for object in G.ObjList:
#print the results object.postProcessing()
print "the system produced", E.numOfExits, "parts"
print "the working ratio of", M1.objName, "is", (M1.totalWorkingTime/G.maxSimTime)*100, "%" #print the results
print "the working ratio of", M2.objName, "is", (M2.totalWorkingTime/G.maxSimTime)*100, "%" print "the system produced", E.numOfExits, "parts"
working_ratio_M1=(M1.totalWorkingTime/G.maxSimTime)*100
working_ratio_M2=(M2.totalWorkingTime/G.maxSimTime)*100
print "the working ratio of", M1.objName, "is", working_ratio_M1, "%"
print "the working ratio of", M2.objName, "is", working_ratio_M2, "%"
return {"parts": E.numOfExits,
"working_ratio_M1": working_ratio_M1,
"working_ratio_M2": working_ratio_M2}
if __name__ == '__main__':
main()
...@@ -15,13 +15,13 @@ class SelectiveQueue(Queue): ...@@ -15,13 +15,13 @@ class SelectiveQueue(Queue):
return len(self.getActiveObjectQueue())>0 and (not (M1.canAccept())) return len(self.getActiveObjectQueue())>0 and (not (M1.canAccept()))
#define the objects of the model #define the objects of the model
S=Source('S','Source', mean=0.5, entity='Dream.Part') S=Source('S','Source', interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.Part')
Q=SelectiveQueue('Q','Queue', capacity=infinity) Q=SelectiveQueue('Q','Queue', capacity=infinity)
M1=Machine('M1','Milling1', mean=0.25) M1=Machine('M1','Milling1', processingTime={'distributionType':'Fixed','mean':0.25})
M2=Machine('M2','Milling2', mean=0.25) M2=Machine('M2','Milling2', processingTime={'distributionType':'Fixed','mean':0.25})
E=Exit('E1','Exit') E=Exit('E1','Exit')
F=Failure(victim=M1, distributionType='Fixed', MTTF=60, MTTR=5) F=Failure(victim=M1, distribution={'distributionType':'Fixed','MTTF':60,'MTTR':5})
G.ObjList=[S,Q,M1,M2,E] #add all the objects in G.ObjList so that they can be easier accessed later G.ObjList=[S,Q,M1,M2,E] #add all the objects in G.ObjList so that they can be easier accessed later
...@@ -35,30 +35,39 @@ M1.defineRouting([Q],[E]) ...@@ -35,30 +35,39 @@ M1.defineRouting([Q],[E])
M2.defineRouting([Q],[E]) M2.defineRouting([Q],[E])
E.defineRouting([M1,M2]) E.defineRouting([M1,M2])
initialize() #initialize the simulation (SimPy method) def main():
initialize() #initialize the simulation (SimPy method)
for object in G.ObjList:
object.initialize()
for objectInterruption in G.ObjectInterruptionList:
objectInterruption.initialize()
for object in G.ObjList: #activate all the objects
object.initialize() for object in G.ObjList:
activate(object, object.run())
for objectInterruption in G.ObjectInterruptionList: for objectInterruption in G.ObjectInterruptionList:
objectInterruption.initialize() activate(objectInterruption, objectInterruption.run())
#activate all the objects
for object in G.ObjList:
activate(object, object.run())
for objectInterruption in G.ObjectInterruptionList:
activate(objectInterruption, objectInterruption.run())
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
simulate(until=G.maxSimTime) #run the simulation G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
#carry on the post processing operations for every object in the topology simulate(until=G.maxSimTime) #run the simulation
for object in G.ObjList:
object.postProcessing() #carry on the post processing operations for every object in the topology
for object in G.ObjList:
object.postProcessing()
#print the results
print "the system produced", E.numOfExits, "parts"
working_ratio_M1=(M1.totalWorkingTime/G.maxSimTime)*100
working_ratio_M2=(M2.totalWorkingTime/G.maxSimTime)*100
print "the working ratio of", M1.objName, "is", working_ratio_M1, "%"
print "the working ratio of", M2.objName, "is", working_ratio_M2, "%"
return {"parts": E.numOfExits,
"working_ratio_M1": working_ratio_M1,
"working_ratio_M2": working_ratio_M2}
#print the results if __name__ == '__main__':
print "the system produced", E.numOfExits, "parts" main()
print "the working ratio of", M1.objName, "is", (M1.totalWorkingTime/G.maxSimTime)*100, "%" \ No newline at end of file
print "the working ratio of", M2.objName, "is", (M2.totalWorkingTime/G.maxSimTime)*100, "%"
...@@ -34,13 +34,13 @@ class CountingExit(Exit): ...@@ -34,13 +34,13 @@ class CountingExit(Exit):
return activeEntity #return the entity obtained return activeEntity #return the entity obtained
#define the objects of the model #define the objects of the model
S=Source('S','Source', mean=0.5, entity='Dream.Part') S=Source('S','Source', interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.Part')
Q=SelectiveQueue('Q','Queue', capacity=infinity) Q=SelectiveQueue('Q','Queue', capacity=infinity)
M1=Milling('M1','Milling1', mean=0.25) M1=Milling('M1','Milling1', processingTime={'distributionType':'Fixed','mean':0.25})
M2=Milling('M2','Milling2', mean=0.25) M2=Milling('M2','Milling2', processingTime={'distributionType':'Fixed','mean':0.25})
E=CountingExit('E1','Exit') E=CountingExit('E1','Exit')
F=Failure(victim=M1, distributionType='Fixed', MTTF=60, MTTR=5) F=Failure(victim=M1, distribution={'distributionType':'Fixed','MTTF':60,'MTTR':5})
G.ObjList=[S,Q,M1,M2,E] #add all the objects in G.ObjList so that they can be easier accessed later G.ObjList=[S,Q,M1,M2,E] #add all the objects in G.ObjList so that they can be easier accessed later
...@@ -57,34 +57,43 @@ M1.defineRouting([Q],[E]) ...@@ -57,34 +57,43 @@ M1.defineRouting([Q],[E])
M2.defineRouting([Q],[E]) M2.defineRouting([Q],[E])
E.defineRouting([M1,M2]) E.defineRouting([M1,M2])
initialize() #initialize the simulation (SimPy method) def main():
initialize() #initialize the simulation (SimPy method)
for object in G.ObjList:
object.initialize()
for objectInterruption in G.ObjectInterruptionList:
objectInterruption.initialize()
for object in G.ObjList: #activate all the objects
object.initialize() for object in G.ObjList:
activate(object, object.run())
for objectInterruption in G.ObjectInterruptionList: for objectInterruption in G.ObjectInterruptionList:
objectInterruption.initialize() activate(objectInterruption, objectInterruption.run())
#activate all the objects
for object in G.ObjList:
activate(object, object.run())
for objectInterruption in G.ObjectInterruptionList:
activate(objectInterruption, objectInterruption.run())
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
simulate(until=G.maxSimTime) #run the simulation G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
#carry on the post processing operations for every object in the topology simulate(until=G.maxSimTime) #run the simulation
for object in G.ObjList:
object.postProcessing() #carry on the post processing operations for every object in the topology
for object in G.ObjList:
#print the results object.postProcessing()
print "the system produced", E.numOfExits, "parts"
print "the working ratio of", M1.objName, "is", (M1.totalWorkingTime/G.maxSimTime)*100, "%" #print the results
print "the working ratio of", M2.objName, "is", (M2.totalWorkingTime/G.maxSimTime)*100, "%" print "the system produced", E.numOfExits, "parts"
print M1.objName, "produced", G.NumM1, "parts" working_ratio_M1=(M1.totalWorkingTime/G.maxSimTime)*100
print M2.objName, "produced", G.NumM2, "parts" working_ratio_M2=(M2.totalWorkingTime/G.maxSimTime)*100
print "the working ratio of", M1.objName, "is", working_ratio_M1, "%"
print "the working ratio of", M2.objName, "is", working_ratio_M2, "%"
print M1.objName, "produced", G.NumM1, "parts"
print M2.objName, "produced", G.NumM2, "parts"
return {"parts": E.numOfExits,
"working_ratio_M1": working_ratio_M1,
"working_ratio_M2": working_ratio_M2,
"NumM1":G.NumM1,
"NumM2":G.NumM2}
if __name__ == '__main__':
main()
...@@ -2,14 +2,14 @@ from dream.simulation.imports import Machine, BatchSource, Exit, Batch, BatchDec ...@@ -2,14 +2,14 @@ from dream.simulation.imports import Machine, BatchSource, Exit, Batch, BatchDec
from dream.simulation.imports import simulate, activate, initialize from dream.simulation.imports import simulate, activate, initialize
# define the objects of the model # define the objects of the model
S=BatchSource('S','Source',mean=1.5, entity='Dream.Batch', batchNumberOfUnits=100) S=BatchSource('S','Source',interarrivalTime={'distributionType':'Fixed','mean':1.5}, entity='Dream.Batch', batchNumberOfUnits=100)
Q=Queue('Q','StartQueue',capacity=100000) Q=Queue('Q','StartQueue',capacity=100000)
BD=BatchDecomposition('BC', 'BatchDecomposition', numberOfSubBatches=4, mean=1) BD=BatchDecomposition('BC', 'BatchDecomposition', numberOfSubBatches=4, mean=1)
M1=Machine('M1','Machine1',mean=0.5) M1=Machine('M1','Machine1',processingTime={'distributionType':'Fixed','mean':0.5})
Q1=Queue('Q1','Queue1',capacity=2) Q1=Queue('Q1','Queue1',capacity=2)
M2=Machine('M2','Machine2',mean=1) M2=Machine('M2','Machine2',processingTime={'distributionType':'Fixed','mean':1})
BRA=BatchReassembly('BRA', 'BatchReassembly', numberOfSubBatches=4, mean=0) BRA=BatchReassembly('BRA', 'BatchReassembly', numberOfSubBatches=4, mean=0)
M3=Machine('M3','Machine3',mean=1) M3=Machine('M3','Machine3',processingTime={'distributionType':'Fixed','mean':1})
E=Exit('E','Exit') E=Exit('E','Exit')
# add all the objects in the G.ObjList so that they can be easier accessed later # add all the objects in the G.ObjList so that they can be easier accessed later
G.ObjList=[S,Q,BD,M1,Q1,M2,BRA,M3,E] G.ObjList=[S,Q,BD,M1,Q1,M2,BRA,M3,E]
...@@ -23,33 +23,55 @@ M2.defineRouting([Q1],[BRA]) ...@@ -23,33 +23,55 @@ M2.defineRouting([Q1],[BRA])
BRA.defineRouting([M2],[M3]) BRA.defineRouting([M2],[M3])
M3.defineRouting([BRA],[E]) M3.defineRouting([BRA],[E])
E.defineRouting([M3]) E.defineRouting([M3])
# initialize the simulation (SimPy method)
initialize() def main():
# initialize all the objects # initialize the simulation (SimPy method)
for object in G.ObjList: initialize()
object.initialize() # initialize all the objects
# activate all the objects for object in G.ObjList:
for object in G.ObjList: object.initialize()
activate(object,object.run()) # activate all the objects
# set G.maxSimTime 1440.0 minutes (1 day) for object in G.ObjList:
G.maxSimTime=1440.0 activate(object,object.run())
# run the simulation # set G.maxSimTime 1440.0 minutes (1 day)
simulate(until=G.maxSimTime) G.maxSimTime=1440.0
# carry on the post processing operations for every object in the topology # run the simulation
for object in G.ObjList: simulate(until=G.maxSimTime)
object.postProcessing() # carry on the post processing operations for every object in the topology
# print the results for object in G.ObjList:
print "the system produced", E.numOfExits, "parts" object.postProcessing()
# for object in G.MachineList: # print the results
# print "the working ratio of", object.objName, "is", (object.totalWorkingTime/G.maxSimTime)*100 print "the system produced", E.numOfExits, "parts"
# print "the blockage ratio of", object.objName, "is", (object.totalBlockageTime/G.maxSimTime)*100 working_ratio_M1 = (M1.totalWorkingTime/G.maxSimTime)*100
# print "the waiting ratio of", object.objName, "is", (object.totalWaitingTime/G.maxSimTime)*100 blockage_ratio_M1 = (M1.totalBlockageTime/G.maxSimTime)*100
print "the working ratio of", M1.objName, "is", (M1.totalWorkingTime/G.maxSimTime)*100 waiting_ratio_M1 = (M1.totalWaitingTime/G.maxSimTime)*100
print "the blockage ratio of", M1.objName, 'is', (M1.totalBlockageTime/G.maxSimTime)*100 print "the working ratio of", M1.objName, "is", working_ratio_M1
print "the waiting ratio of", M1.objName, 'is', (M1.totalWaitingTime/G.maxSimTime)*100 print "the blockage ratio of", M1.objName, 'is', blockage_ratio_M1
print "the working ratio of", M2.objName, "is", (M2.totalWorkingTime/G.maxSimTime)*100 print "the waiting ratio of", M1.objName, 'is', waiting_ratio_M1
print "the blockage ratio of", M2.objName, 'is', (M2.totalBlockageTime/G.maxSimTime)*100 working_ratio_M2 = (M2.totalWorkingTime/G.maxSimTime)*100
print "the waiting ratio of", M2.objName, 'is', (M2.totalWaitingTime/G.maxSimTime)*100 blockage_ratio_M2 = (M2.totalBlockageTime/G.maxSimTime)*100
print "the working ratio of", M3.objName, "is", (M3.totalWorkingTime/G.maxSimTime)*100 waiting_ratio_M2 = (M2.totalWaitingTime/G.maxSimTime)*100
print "the blockage ratio of", M3.objName, 'is', (M3.totalBlockageTime/G.maxSimTime)*100 print "the working ratio of", M2.objName, "is", working_ratio_M2
print "the waiting ratio of", M3.objName, 'is', (M3.totalWaitingTime/G.maxSimTime)*100 print "the blockage ratio of", M2.objName, 'is', blockage_ratio_M2
print "the waiting ratio of", M2.objName, 'is', waiting_ratio_M2
working_ratio_M3 = (M3.totalWorkingTime/G.maxSimTime)*100
blockage_ratio_M3 = (M3.totalBlockageTime/G.maxSimTime)*100
waiting_ratio_M3 = (M3.totalWaitingTime/G.maxSimTime)*100
print "the working ratio of", M3.objName, "is", working_ratio_M3
print "the blockage ratio of", M3.objName, 'is', blockage_ratio_M3
print "the waiting ratio of", M3.objName, 'is', waiting_ratio_M3
return {"parts": E.numOfExits,
"working_ratio_M1": working_ratio_M1,
"blockage_ratio_M1": blockage_ratio_M1,
"waiting_ratio_M1": waiting_ratio_M1,
"working_ratio_M2": working_ratio_M2,
"blockage_ratio_M2": blockage_ratio_M2,
"waiting_ratio_M2": waiting_ratio_M2,
"working_ratio_M3": working_ratio_M3,
"blockage_ratio_M3": blockage_ratio_M3,
"waiting_ratio_M3": waiting_ratio_M3,
}
if __name__ == '__main__':
main()
\ No newline at end of file
...@@ -2,8 +2,8 @@ from dream.simulation.imports import Machine, Source, Exit, Part, G ...@@ -2,8 +2,8 @@ from dream.simulation.imports import Machine, Source, Exit, Part, G
from dream.simulation.imports import simulate, activate, initialize from dream.simulation.imports import simulate, activate, initialize
#define the objects of the model #define the objects of the model
S=Source('S1','Source',distribution='Fixed', mean=0.5, entity='Dream.Part') S=Source('S1','Source',interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.Part')
M=Machine('M1','Machine', mean=0.25) M=Machine('M1','Machine', processingTime={'distributionType':'Fixed','mean':0.25})
E=Exit('E1','Exit') E=Exit('E1','Exit')
G.ObjList=[S,M,E] #add all the objects in G.ObjList so that they can be easier accessed later G.ObjList=[S,M,E] #add all the objects in G.ObjList so that they can be easier accessed later
...@@ -13,24 +13,31 @@ S.defineRouting(successorList=[M]) ...@@ -13,24 +13,31 @@ S.defineRouting(successorList=[M])
M.defineRouting(predecessorList=[S],successorList=[E]) M.defineRouting(predecessorList=[S],successorList=[E])
E.defineRouting(predecessorList=[M]) E.defineRouting(predecessorList=[M])
initialize() #initialize the simulation (SimPy method) def main():
initialize() #initialize the simulation (SimPy method)
#initialize all the objects
for object in G.ObjList:
object.initialize()
#initialize all the objects #activate all the objects
for object in G.ObjList: for object in G.ObjList:
object.initialize() activate(object, object.run())
#activate all the objects
for object in G.ObjList:
activate(object, object.run())
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
simulate(until=G.maxSimTime) #run the simulation G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
#carry on the post processing operations for every object in the topology simulate(until=G.maxSimTime) #run the simulation
for object in G.ObjList:
object.postProcessing() #carry on the post processing operations for every object in the topology
for object in G.ObjList:
object.postProcessing()
#print the results
print "the system produced", E.numOfExits, "parts"
working_ratio = (M.totalWorkingTime/G.maxSimTime)*100
print "the total working ratio of the Machine is", working_ratio, "%"
return {"parts": E.numOfExits,
"working_ratio": working_ratio}
#print the results if __name__ == '__main__':
print "the system produced", E.numOfExits, "parts" main()
print "the total working ratio of the Machine is", (M.totalWorkingTime/G.maxSimTime)*100, "%" \ No newline at end of file
...@@ -65,4 +65,4 @@ def main(): ...@@ -65,4 +65,4 @@ def main():
"working_ratio": working_ratio} "working_ratio": working_ratio}
if __name__ == '__main__': if __name__ == '__main__':
main() main()
...@@ -5,16 +5,16 @@ from dream.simulation.imports import simulate, activate, initialize ...@@ -5,16 +5,16 @@ from dream.simulation.imports import simulate, activate, initialize
from dream.KnowledgeExtraction.Plots import Graphs from dream.KnowledgeExtraction.Plots import Graphs
#define the objects of the model #define the objects of the model
R=Repairman('R1', 'Bob') R=Repairman('R1', 'Bob')
S=Source('S1','Source', mean=0.5, entity='Dream.Part') S=Source('S1','Source', interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.Part')
M1=Machine('M1','Machine1', mean=0.25, failureDistribution='Fixed', MTTF=60, MTTR=5, repairman=R) M1=Machine('M1','Machine1', processingTime={'distributionType':'Fixed','mean':0.25})
Q=Queue('Q1','Queue') Q=Queue('Q1','Queue')
M2=Machine('M2','Machine2', mean=1.5, failureDistribution='Fixed', MTTF=40, MTTR=10,repairman=R) M2=Machine('M2','Machine2', processingTime={'distributionType':'Fixed','mean':1.5})
E=Exit('E1','Exit') E=Exit('E1','Exit')
#create failures #create failures
F1=Failure(victim=M1, distributionType='Fixed', MTTF=60, MTTR=5, repairman=R) F1=Failure(victim=M1, distribution={'distributionType':'Fixed','MTTF':60,'MTTR':5}, repairman=R)
F2=Failure(victim=M2, distributionType='Fixed', MTTF=40, MTTR=10, repairman=R) F2=Failure(victim=M2, distribution={'distributionType':'Fixed','MTTF':40,'MTTR':10}, repairman=R)
G.ObjList=[S,M1,M2,E,Q] #add all the objects in G.ObjList so that they can be easier accessed later G.ObjList=[S,M1,M2,E,Q] #add all the objects in G.ObjList so that they can be easier accessed later
...@@ -27,46 +27,55 @@ Q.defineRouting([M1],[M2]) ...@@ -27,46 +27,55 @@ Q.defineRouting([M1],[M2])
M2.defineRouting([Q],[E]) M2.defineRouting([Q],[E])
E.defineRouting([M2]) E.defineRouting([M2])
initialize() #initialize the simulation (SimPy method) def main():
initialize() #initialize the simulation (SimPy method)
#initialize all the objects #initialize all the objects
R.initialize() R.initialize()
for object in G.ObjList:
object.initialize()
for objectInterruption in G.ObjectInterruptionList:
objectInterruption.initialize()
#activate all the objects for object in G.ObjList:
for object in G.ObjList: object.initialize()
activate(object, object.run())
for objectInterruption in G.ObjectInterruptionList:
objectInterruption.initialize()
#activate all the objects
for object in G.ObjList:
activate(object, object.run())
for objectInterruption in G.ObjectInterruptionList:
activate(objectInterruption, objectInterruption.run())
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day)
for objectInterruption in G.ObjectInterruptionList: simulate(until=G.maxSimTime) #run the simulation
activate(objectInterruption, objectInterruption.run())
G.maxSimTime=1440.0 #set G.maxSimTime 1440.0 minutes (1 day) #carry on the post processing operations for every object in the topology
for object in G.ObjList:
object.postProcessing()
R.postProcessing()
#print the results
print "the system produced", E.numOfExits, "parts"
blockage_ratio = (M1.totalBlockageTime/G.maxSimTime)*100
working_ratio = (R.totalWorkingTime/G.maxSimTime)*100
waiting_ratio = (R.totalWaitingTime/G.maxSimTime)*100
print "the blockage ratio of", M1.objName, "is", blockage_ratio, "%"
print "the working ratio of", R.objName,"is", working_ratio, "%"
#create a graph object
graph=Graphs()
#create the pie
graph.Pie([working_ratio,waiting_ratio], "repairmanPie.jpg")
return {"parts": E.numOfExits,
"blockage_ratio": blockage_ratio,
"working_ratio": working_ratio}
simulate(until=G.maxSimTime) #run the simulation
if __name__ == '__main__':
#carry on the post processing operations for every object in the topology main()
for object in G.ObjList:
object.postProcessing()
R.postProcessing()
#print the results
print "the system produced", E.numOfExits, "parts"
print "the blockage ratio of", M1.objName, "is", (M1.totalBlockageTime/G.maxSimTime)*100, "%"
print "the working ratio of", R.objName,"is", (R.totalWorkingTime/G.maxSimTime)*100, "%"
#calculate the percentages for the pie
repairmanWorkingRatio=R.totalWorkingTime/G.maxSimTime*100
repairmanWaitingRatio=R.totalWaitingTime/G.maxSimTime*100
#create a graph object
graph=Graphs()
#create the pie
graph.Pie([repairmanWorkingRatio,repairmanWaitingRatio], "repairmanPie.jpg")
...@@ -3,15 +3,15 @@ from dream.simulation.imports import simulate, activate, initialize ...@@ -3,15 +3,15 @@ from dream.simulation.imports import simulate, activate, initialize
#define the objects of the model #define the objects of the model
R=Repairman('R1', 'Bob') R=Repairman('R1', 'Bob')
S=Source('S1','Source', mean=0.5, entity='Dream.Part') S=Source('S1','Source', interarrivalTime={'distributionType':'Exp','mean':0.5}, entity='Dream.Part')
M1=Machine('M1','Machine1', distribution='Normal', mean=0.25, stdev=0.1, min=0.1, max=1) M1=Machine('M1','Machine1', processingTime={'distributionType':'Normal','mean':0.25,'stdev':0.1,'min':0.1,'max':1})
M2=Machine('M2','Machine2', processingTime={'distributionType':'Normal','mean':1.5,'stdev':0.3,'min':0.5,'max':5})
Q=Queue('Q1','Queue') Q=Queue('Q1','Queue')
M2=Machine('M2','Machine2', distribution='Normal', mean=1.5, stdev=0.3, min=0.5, max=5)
E=Exit('E1','Exit') E=Exit('E1','Exit')
#create failures #create failures
F1=Failure(victim=M1, distributionType='Fixed', MTTF=60, MTTR=5, repairman=R) F1=Failure(victim=M1, distribution={'distributionType':'Fixed','MTTF':60,'MTTR':5}, repairman=R)
F2=Failure(victim=M2, distributionType='Fixed', MTTF=40, MTTR=10, repairman=R) F2=Failure(victim=M2, distribution={'distributionType':'Fixed','MTTF':40,'MTTR':10}, repairman=R)
G.ObjList=[S,M1,M2,E,Q] #add all the objects in G.ObjList so that they can be easier accessed later G.ObjList=[S,M1,M2,E,Q] #add all the objects in G.ObjList so that they can be easier accessed later
......
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