本文整理汇总了Python中dream.simulation.imports.Exit.defineRouting方法的典型用法代码示例。如果您正苦于以下问题:Python Exit.defineRouting方法的具体用法?Python Exit.defineRouting怎么用?Python Exit.defineRouting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dream.simulation.imports.Exit
的用法示例。
在下文中一共展示了Exit.defineRouting方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from dream.simulation.imports import Exit [as 别名]
# 或者: from dream.simulation.imports.Exit import defineRouting [as 别名]
entityList=[]
for i in range(5): # create the WIP in a loop
Q1PartId='Q1_P'+str(i)
Q1PartName='Q1_Part'+str(i)
PQ1=Part(Q1PartId, Q1PartName, currentStation=Q1)
entityList.append(PQ1)
Q2PartId='Q2_P'+str(i)
Q2PartName='Q2_Part'+str(i)
PQ2=Part(Q2PartId, Q2PartName, currentStation=Q2)
entityList.append(PQ2)
#define predecessors and successors for the objects
Q1.defineRouting(successorList=[M])
Q2.defineRouting(successorList=[M])
M.defineRouting(successorList=[E])
E.defineRouting(predecessorList=[M])
EV=EventGenerator('EV', 'PredecessorChanger', start=0, stop=50, interval=10,method=changeMachinePredecessor,
argumentDict={'machine':M, 'possiblePredecessors':[Q1,Q2]})
def main(test=0):
# add all the objects in a list
objectList=[Q1,Q2,M,E,EV]+entityList
# set the length of the experiment
maxSimTime=float('inf')
# call the runSimulation giving the objects and the length of the experiment
runSimulation(objectList, maxSimTime, trace='Yes')
# calculate metrics
working_ratio = (M.totalWorkingTime/E.timeLastEntityLeft)*100
示例2: main
# 需要导入模块: from dream.simulation.imports import Exit [as 别名]
# 或者: from dream.simulation.imports.Exit import defineRouting [as 别名]
Q1=LineClearance('Q1','Queue1',capacity=2)
M2=Machine('M2','Machine2',processingTime={'Fixed':{'mean':4}})
BRA=BatchReassembly('BRA', 'BatchReassembly', numberOfSubBatches=4, processingTime={'Fixed':{'mean':0}})
M3=Machine('M3','Machine3',processingTime={'Fixed':{'mean':1}})
E=Exit('E','Exit')
# define the predecessors and successors for the objects
S.defineRouting([Q])
Q.defineRouting([S],[BD])
BD.defineRouting([Q],[M1])
M1.defineRouting([BD],[Q1])
Q1.defineRouting([M1],[M2])
M2.defineRouting([Q1],[BRA])
BRA.defineRouting([M2],[M3])
M3.defineRouting([BRA],[E])
E.defineRouting([M3])
def main(test=0):
# add all the objects in a list
objectList=[S,Q,BD,M1,Q1,M2,BRA,M3,E]
# set the length of the experiment
maxSimTime=1440.0
# call the runSimulation giving the objects and the length of the experiment
runSimulation(objectList, maxSimTime, trace='Yes')
# calculate metrics
working_ratio_M1 = (M1.totalWorkingTime/maxSimTime)*100
blockage_ratio_M1 = (M1.totalBlockageTime/maxSimTime)*100
waiting_ratio_M1 = (M1.totalWaitingTime/maxSimTime)*100
working_ratio_M2 = (M2.totalWorkingTime/maxSimTime)*100
示例3: main
# 需要导入模块: from dream.simulation.imports import Exit [as 别名]
# 或者: from dream.simulation.imports.Exit import defineRouting [as 别名]
#create failures
F1=Failure(victim=M1, distribution={'distributionType':'Fixed','MTTF':60,'MTTR':5}, 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.MachineList=[M1,M2]
G.ObjectInterruptionList=[F1,F2] #add all the objects in G.ObjList so that they can be easier accessed later
#define predecessors and successors for the objects
S.defineRouting([M1])
M1.defineRouting([S],[Q])
Q.defineRouting([M1],[M2])
M2.defineRouting([Q],[E])
E.defineRouting([M2])
def main():
initialize() #initialize the simulation (SimPy method)
#initialize all the objects
R.initialize()
for object in G.ObjList:
object.initialize()
for objectInterruption in G.ObjectInterruptionList:
objectInterruption.initialize()
#activate all the objects
示例4: main
# 需要导入模块: from dream.simulation.imports import Exit [as 别名]
# 或者: from dream.simulation.imports.Exit import defineRouting [as 别名]
#define the objects of the model
Frame.capacity=4
Sp=Source('SP','Parts', interArrivalTime={'Fixed':{'mean':0.5}}, entity='Dream.Part')
Sf=Source('SF','Frames', interArrivalTime={'Fixed':{'mean':2}}, entity='Dream.Frame')
M=Machine('M','Machine', processingTime={'Fixed':{'mean':0.25}})
A=Assembly('A','Assembly', processingTime={'Fixed':{'mean':2}})
E=Exit('E1','Exit')
F=Failure(victim=M, distribution={'TTF':{'Fixed':{'mean':60.0}},'TTR':{'Fixed':{'mean':5.0}}})
#define predecessors and successors for the objects
Sp.defineRouting([A])
Sf.defineRouting([A])
A.defineRouting([Sp,Sf],[M])
M.defineRouting([A],[E])
E.defineRouting([M])
def main(test=0):
# add all the objects in a list
objectList=[Sp,Sf,M,A,E,F]
# set the length of the experiment
maxSimTime=1440.0
# call the runSimulation giving the objects and the length of the experiment
runSimulation(objectList, maxSimTime)
# calculate metrics
working_ratio=(A.totalWorkingTime/maxSimTime)*100
# return results for the test
if test:
return {"frames": E.numOfExits,