Exemplo n.º 1
0
from dream.simulation.imports import BatchScrapMachine, NonStarvingEntry, Exit, Part  
from dream.simulation.Globals import runSimulation

#define the objects of the model 
NS=NonStarvingEntry('NS1','Entry',entityData={'_class':'Dream.Batch','numberOfUnits':100})
M=BatchScrapMachine('M1','Machine', processingTime={'Fixed':{'mean':0.02}})
E=Exit('E1','Exit')  

#define predecessors and successors for the objects    
NS.defineRouting(successorList=[M])
M.defineRouting(predecessorList=[NS],successorList=[E])
E.defineRouting(predecessorList=[M])

def main(test=0):
    # add all the objects in a list
    objectList=[NS,M,E]  
    # set the length of the experiment  
    maxSimTime=10
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)

    # calculate metrics
    working_ratio = (M.totalWorkingTime/maxSimTime)*100

    # return results for the test
    if test:
        return {"batches": E.numOfExits,
              "working_ratio": working_ratio}

    #print the results
    print "the system produced", E.numOfExits, "batches"
Exemplo n.º 2
0
                           '_class': 'Dream.Part',
                           'status': 'Good'
                       })
M1 = OpMachine('M1', 'Machine1', processingTime={'Fixed': {'mean': 0.1}})
M2 = OpMachine('M2', 'Machine2', processingTime={'Fixed': {'mean': 0.1}})
M3 = OpMachine('M3', 'Machine3', processingTime={'Fixed': {'mean': 0.1}})
B123 = OpQueue('B123', 'Queue', capacity=capacity, gatherWipStat=True)
E = OpExit('E1', 'Exit')
Controller = EventGenerator('EV',
                            'Controller',
                            start=0,
                            interval=1,
                            method=controllerMethod)

#define predecessors and successors for the objects
NS1.defineRouting(successorList=[M1])
NS2.defineRouting(successorList=[M2])
M1.defineRouting(predecessorList=[NS1], successorList=[B123])
M2.defineRouting(predecessorList=[NS2], successorList=[B123])
B123.defineRouting(predecessorList=[M1, M2], successorList=[M3])
M3.defineRouting(predecessorList=[B123], successorList=[E])
E.defineRouting(predecessorList=[M3])

# add all the objects to a list
objectList = [NS1, NS2, M1, M2, M3, B123, E, Controller]

# set all objects locked at beginning
for obj in objectList:
    obj.locked = True

# GoodExits will keep the number of good parts produced in every replication
Exemplo n.º 3
0
from dream.simulation.imports import Machine, Source, Exit, Part, Queue, NonStarvingEntry
from dream.simulation.Globals import runSimulation

#define the objects of the model
NS = NonStarvingEntry('NS1', 'Entry', entityData={'_class': 'Dream.Part'})
M1 = Machine('M1', 'Machine1', processingTime={'Exp': {'mean': 1}})
Q2 = Queue('Q2', 'Queue2')
M2 = Machine('M2', 'Machine2', processingTime={'Exp': {'mean': 3}})
Q3 = Queue('Q3', 'Queue3')
M3 = Machine('M3', 'Machine3', processingTime={'Exp': {'mean': 5}})
E = Exit('E1', 'Exit')

#define predecessors and successors for the objects
NS.defineRouting(successorList=[M1])
M1.defineRouting(predecessorList=[NS], successorList=[Q2])
Q2.defineRouting(predecessorList=[M1], successorList=[M2])
M2.defineRouting(predecessorList=[Q2], successorList=[Q3])
Q3.defineRouting(predecessorList=[M2], successorList=[M3])
M3.defineRouting(predecessorList=[Q3], successorList=[E])
E.defineRouting(predecessorList=[M3])


def main(test=0):
    # add all the objects in a list
    objectList = [NS, M1, M2, M3, Q2, Q3, E]
    # set the length of the experiment
    maxSimTime = 480

    solutionList = []

    for i in range(1, 10):
Exemplo n.º 4
0
def createRandomNumber():
    return Rnd.uniform(0,1)


#define the objects of the model 
NS1=NonStarvingEntry('NS1','Entry1',entityData={'_class':'Dream.Part','status':'Good'})
NS2=NonStarvingEntry('NS2','Entry2',entityData={'_class':'Dream.Part','status':'Good'})
M1=OpMachine('M1','Machine1', processingTime={'Fixed':{'mean':0.1}})
M2=OpMachine('M2','Machine2', processingTime={'Fixed':{'mean':0.1}})
M3=OpMachine('M3','Machine3', processingTime={'Fixed':{'mean':0.1}})
B123=OpQueue('B123','Queue', capacity=capacity,gatherWipStat=True)
E=OpExit('E1','Exit')  
Controller=EventGenerator('EV','Controller',start=0,interval=1,method=controllerMethod)

#define predecessors and successors for the objects    
NS1.defineRouting(successorList=[M1])
NS2.defineRouting(successorList=[M2])
M1.defineRouting(predecessorList=[NS1],successorList=[B123])
M2.defineRouting(predecessorList=[NS2],successorList=[B123])
B123.defineRouting(predecessorList=[M1,M2],successorList=[M3])
M3.defineRouting(predecessorList=[B123],successorList=[E])
E.defineRouting(predecessorList=[M3])

# add all the objects to a list
objectList=[NS1,NS2,M1,M2,M3,B123,E,Controller]  

# set all objects locked at beginning
for obj in objectList:
    obj.locked=True

# GoodExits will keep the number of good parts produced in every replication