'BatchDecomposition', numberOfSubBatches=4, processingTime={'Fixed': { 'mean': 1 }}) M1 = Machine('M1', 'Machine1', processingTime={'Fixed': {'mean': 0.5}}) 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):
from dream.simulation.imports import Machine, Queue, Exit, Part, ExcelHandler from dream.simulation.Globals import runSimulation, G #define the objects of the model Q=Queue('Q1','Queue', capacity=1) M=Machine('M1','Machine', processingTime={'Fixed':{'mean':0.25}}) E=Exit('E1','Exit') P1=Part('P1', 'Part1', currentStation=Q) #define predecessors and successors for the objects Q.defineRouting(successorList=[M]) M.defineRouting(predecessorList=[Q],successorList=[E]) E.defineRouting(predecessorList=[M]) def main(test=0): # add all the objects in a list objectList=[Q,M,E,P1] # 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/G.maxSimTime)*100 # return results for the test if test: return {"parts": E.numOfExits, "simulationTime":E.timeLastEntityLeft, "working_ratio": working_ratio}
# The baby step includes: # A source to generate students # A Queue for students to wait for a flight # A machine (aircraft) to give students time # An exit for graduated students # The source is API for Aviation Preflight Indocrination API = Source('API', 'Source', interArrivalTime={'Fixed': { 'mean': 0.5 }}, entity='Dream.Part') RR = Queue('ReadyRoom', 'Queue', capacity=1) AC = Machine('AC1', 'Machine', processingTime={'Fixed': {'mean': 0.25}}) E = Exit('The Fleet', 'The Fleet') # The predecessors and successors for the objects API.defineRouting(successorList=[RR]) RR.defineRouting(predecessorList=[API], successorList=[AC]) AC.defineRouting(predecessorList=[RR], successorList=[E]) E.defineRouting(predecessorList=[AC]) def main(test=0): # add all the objects in a list objectList = [API, RR, AC, E] # set the length of the experiment maxSimTime = 1440.0 # call the runSimulation giving the objects and the length of the # experiment