Exemple #1
0
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):
        Q2.capacity=i
        Q3.capacity=10-i
        # call the runSimulation giving the objects and the length of the experiment
        runSimulation(objectList, maxSimTime,numberOfReplications=10)
    
        # return results for the test
        if test:
            return {"parts": E.numOfExits}
       
        solutionList.append({
                             "Q2":Q2.capacity,
                             "Q3":Q3.capacity,
                             "throughput":sum(E.Exits)/float(len(E.Exits))
                             }
                            )
        E.Exits=[]
    solutionList.sort(key=lambda x: x.get("throughput",0), reverse=True)
    print "the best allocation is for Q2",solutionList[0]['Q2'],"units and Q3",solutionList[0]['Q2'],\
            "units, with a predicted throughput of",solutionList[0]['throughput']
def main(test=0):

    # add all the objects in a list
    objectList = [S, M1, M2, E, Q, R, F1, F2]
    # 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
    blockage_ratio = (M1.totalBlockageTime / maxSimTime) * 100
    blockage_ratio = (M1.totalBlockageTime / maxSimTime) * 100
    working_ratio = (R.totalWorkingTime / maxSimTime) * 100
    waiting_ratio = (R.totalWaitingTime / maxSimTime) * 100

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

    #print the results
    print "the system produced", E.numOfExits, "parts"
    print "the blockage ratio of", M1.objName, "is", blockage_ratio, "%"
    print "the working ratio of", R.objName, "is", working_ratio, "%"

    #create a graph object
    from dream.KnowledgeExtraction.Plots import Graphs
    graph = Graphs()
    #create the pie
    graph.Pie([working_ratio, waiting_ratio], "repairmanPie.jpg")
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):
        Q2.capacity = i
        Q3.capacity = 10 - i
        # call the runSimulation giving the objects and the length of the experiment
        runSimulation(objectList, maxSimTime, numberOfReplications=10)

        # return results for the test
        if test:
            return {"parts": E.numOfExits}

        solutionList.append({
            "Q2": Q2.capacity,
            "Q3": Q3.capacity,
            "throughput": sum(E.Exits) / float(len(E.Exits))
        })
        E.Exits = []
    solutionList.sort(key=lambda x: x.get("throughput", 0), reverse=True)
    print "the best allocation is for Q2",solutionList[0]['Q2'],"units and Q3",solutionList[0]['Q2'],\
            "units, with a predicted throughput of",solutionList[0]['throughput']
Exemple #4
0
def main(test=0):

    # add all the objects in a list
    objectList=[S,Q,M1,M2,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_M1=(M1.totalWorkingTime/maxSimTime)*100
    working_ratio_M2=(M2.totalWorkingTime/maxSimTime)*100    

    # return results for the test
    if test:
        return {"parts": E.numOfExits,
              "working_ratio_M1": working_ratio_M1,
              "working_ratio_M2": working_ratio_M2,
              "NumM1":G.NumM1,
              "NumM2":G.NumM2}

    #print the results
    print "the system produced", E.numOfExits, "parts"
    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"
def main(test=0):

    # add all the objects in a list
    objectList = [S, Q, BD, M, 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)

    # calculate metrics
    working_ratio = (M.totalWorkingTime / maxSimTime) * 100
    blockage_ratio = (M.totalBlockageTime / maxSimTime) * 100
    waiting_ratio = (M.totalWaitingTime / maxSimTime) * 100

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

    # print the results
    print "the system produced", E.numOfExits, "subbatches"
    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
Exemple #6
0
def main(test=0):
    # add all the objects in a list
    objectList = [S, M1, M2, E, Q, R, F1, F2]
    #objectList = [S, M1, M2, E, Q, R, F2]

    # 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
    blockage_ratio_1 = (M1.totalBlockageTime / maxSimTime) * 100
    blockage_ratio_2 = (M2.totalBlockageTime / maxSimTime) * 100
    operation_time_1 = M1.totalOperationTime
    operation_time_2 = M2.totalOperationTime
    working_ratio_1 = (M1.totalWorkingTime / maxSimTime) * 100
    working_ratio_2 = (M2.totalWorkingTime / maxSimTime) * 100
    working_ratio = (R.totalWorkingTime / maxSimTime) * 100

    # print the results
    print "the system produced", E.numOfExits, "parts"
    print "the blockage ratio of", M1.objName, "is", blockage_ratio_1, "%"
    print "the blockage ratio of", M2.objName, "is", blockage_ratio_2, "%"
    print "the total operation ratio of the Machine1 is", operation_time_1, "%"
    print "the total operation ratio of the Machine2 is", operation_time_2, "%"
    print "the total working ratio of the Machine1 is", working_ratio_1, "%"
    print "the total working ratio of the Machine2 is", working_ratio_2, "%"
    print "the working ratio of", R.objName, "is", working_ratio, "%"
Exemple #7
0
def main(test=0):

    # add all the objects in a list
    objectList=[S,M1,M2,E,Q,R,F1,F2]  
    # 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
    blockage_ratio = (M1.totalBlockageTime/maxSimTime)*100
    blockage_ratio = (M1.totalBlockageTime/maxSimTime)*100
    working_ratio = (R.totalWorkingTime/maxSimTime)*100
    waiting_ratio = (R.totalWaitingTime/maxSimTime)*100

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

    #print the results
    print "the system produced", E.numOfExits, "parts"
    print "the blockage ratio of", M1.objName,  "is", blockage_ratio, "%"
    print "the working ratio of", R.objName,"is", working_ratio, "%"

    #create a graph object
    from dream.KnowledgeExtraction.Plots import Graphs
    graph=Graphs()
    #create the pie
    graph.Pie([working_ratio,waiting_ratio], "repairmanPie.jpg")
Exemple #8
0
def main(test=0):

    # add all the objects in a list
    objectList = [S, M1, M2, E, Q, R, F1, F2]
    # 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
    blockage_ratio = (M1.totalBlockageTime / maxSimTime) * 100
    working_ratio = (R.totalWorkingTime / maxSimTime) * 100

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

    #print the results
    print "the system produced", E.numOfExits, "parts"
    print "the blockage ratio of", M1.objName, "is", blockage_ratio, "%"
    print "the working ratio of", R.objName, "is", working_ratio, "%"
Exemple #9
0
def main(test=0):

    # add all the objects in a list
    objectList = [S, Q, M1, M2, 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_M1 = (M1.totalWorkingTime / maxSimTime) * 100
    working_ratio_M2 = (M2.totalWorkingTime / maxSimTime) * 100

    # return results for the test
    if test:
        return {
            "parts": E.numOfExits,
            "working_ratio_M1": working_ratio_M1,
            "working_ratio_M2": working_ratio_M2
        }

    #print the results
    print "the system produced", E.numOfExits, "parts"
    print "the working ratio of", M1.objName, "is", working_ratio_M1, "%"
    print "the working ratio of", M2.objName, "is", working_ratio_M2, "%"
def main(test=0):

    # add all the objects in a list
    objectList=[S,Q,BD,M,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)
        
    # calculate metrics
    working_ratio = (M.totalWorkingTime/maxSimTime)*100
    blockage_ratio = (M.totalBlockageTime/maxSimTime)*100
    waiting_ratio = (M.totalWaitingTime/maxSimTime)*100
    
    # return results for the test
    if test:
        return {"subbatches": E.numOfExits,
               "working_ratio": working_ratio,
              "blockage_ratio": blockage_ratio,
              "waiting_ratio": waiting_ratio}
        
    # print the results 
    print "the system produced", E.numOfExits, "subbatches"        
    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
Exemple #11
0
def main(test=0):
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList=[QB,Q1,M1,Q2,M2,Q3,M3,QA,E,P1,P2,P3,P4,P5,P6,MA], maxSimTime=float('inf'), trace='Yes')
    
    #output the trace of the simulation
    ExcelHandler.outputTrace('CompoundMachine')
    if test:
        return G.maxSimTime
def main(test=0):
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList=[
        QB, Q1, M1, Q2, M2, Q3, M3, QA, E, P1, P2, P3, P4, P5, P6, MA
    ],
                  maxSimTime=float('inf'),
                  trace='Yes')

    #output the trace of the simulation
    ExcelHandler.outputTrace('CompoundMachine')
    if test:
        return G.maxSimTime
Exemple #13
0
def main():
    # add all the objects in a list
    objectList=[S,M,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)
    
    #print the results
    print "the system produced", E.numOfExits, "parts"
    working_ratio = (M.totalWorkingTime/maxSimTime)*100
    print "the total working ratio of the Machine is", working_ratio, "%"
    return {"parts": E.numOfExits,
          "working_ratio": working_ratio}
Exemple #14
0
def main():
    # 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)
    
    #print the results
    print "the system produced", E.numOfExits, "frames"
    working_ratio=(A.totalWorkingTime/maxSimTime)*100
    print "the working ratio of", A.objName,  "is", working_ratio, "%"
    return {"frames": E.numOfExits,
          "working_ratio": working_ratio}
Exemple #15
0
def main():
    # add all the objects in a list
    objectList=[M1,M2,M3,Q1,Q2,Q3,E,J]  
    # set the length of the experiment  
    maxSimTime=float('inf')
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)
    
    #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 
Exemple #16
0
def main(test=0):
    # add all the objects in a list
    objectList = [M1, M2, M3, Q1, Q2, Q3, E, J]
    # set the length of the experiment
    maxSimTime = float('inf')
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)

    # return results for the test
    if test:
        returnSchedule = []
        for record in J.schedule:
            returnSchedule.append([record[0].objName, record[1]])
        return returnSchedule
Exemple #17
0
def main(test=0):
    # add all the objects in a list
    objectList = [M1, M2, M3, Q1, Q2, Q3, E, J]
    # set the length of the experiment
    maxSimTime=float('inf')
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)

    # return results for the test
    if test:
        returnSchedule = []
        for record in J.schedule:
            returnSchedule.append([record[0].objName, record[1]])
        return returnSchedule
Exemple #18
0
def main():
    # add all the objects in a list
    objectList = [M1, M2, M3, Q1, Q2, Q3, E, J1, J2, J3]
    # set the length of the experiment
    maxSimTime = float('inf')
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)

    # print the results
    for job in [J1, J2, J3]:
        for record in job.schedule:
            print job.name, "got into", record[
                "station"].objName, "at", record["entranceTime"]
        print "-" * 30
Exemple #19
0
def main():
    # add all the objects in a list
    objectList=[M1,M2,M3,Q1,Q2,Q3,E,J]  
    # 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')
      
    #loop in the schedule to print the results
    schedule=[]
    for record in J.schedule:
        schedule.append([record["station"].objName,record["entranceTime"]])
        print J.name, "got into", record["station"].objName, "at", record["entranceTime"] 
    ExcelHandler.outputTrace('TRACE')
    return schedule
Exemple #20
0
def main(test=0):
    # add all the objects in a list
    objectList=[S,Q,M,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)
    # calculate metrics
    working_ratio = (M.totalWorkingTime/maxSimTime)*100
    # return results for the test
    if test:
        return {"parts": E.numOfExits,"working_ratio": working_ratio}
    # print the results
    print "the system produced", E.numOfExits, "parts"
    print "the total working ratio of the Machine is", working_ratio, "%"
Exemple #21
0
def main(test=0):
    # loop through the scheduling rules
    for schedulingRule in ['EDD','RPC']:
        totalDelay=0
        # set the scheduline rule of Q1
        Q1.schedulingRule=schedulingRule
        # call the runSimulation giving the objects and the length of the experiment
        runSimulation(objectList=[M1,M2,M3,Q1,Q2,Q3,E,J1,J2], maxSimTime=float('inf'))
        # loop through the moulds and if they are delayed add to the total delay
        for job in [J1,J2]:
            totalDelay+=max([job.schedule[-1]['entranceTime']-job.dueDate,0])        
        if test:
            return totalDelay    
        # print the total delay
        print "running with", schedulingRule, "total delay is",totalDelay 
Exemple #22
0
def main():
    # 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')

    #print the results
    print "the system produced", E.numOfExits, "parts in", E.timeLastEntityLeft, "minutes"
    working_ratio = (M.totalWorkingTime/G.maxSimTime)*100
    print "the total working ratio of the Machine is", working_ratio, "%"
    ExcelHandler.outputTrace('Wip1')
    return {"parts": E.numOfExits,
            "simulationTime":E.timeLastEntityLeft,
          "working_ratio": working_ratio}
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
    blockage_ratio_M2 = (M2.totalBlockageTime / maxSimTime) * 100
    waiting_ratio_M2 = (M2.totalWaitingTime / maxSimTime) * 100
    working_ratio_M3 = (M3.totalWorkingTime / maxSimTime) * 100
    blockage_ratio_M3 = (M3.totalBlockageTime / maxSimTime) * 100
    waiting_ratio_M3 = (M3.totalWaitingTime / maxSimTime) * 100

    # return results for the test
    if test:
        return {
            "batches": 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,
        }

    # print the results
    print "the system produced", E.numOfExits, "batches"
    print "the working ratio of", M1.objName, "is", working_ratio_M1
    print "the blockage ratio of", M1.objName, 'is', blockage_ratio_M1
    print "the waiting ratio of", M1.objName, 'is', waiting_ratio_M1
    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
    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
    ExcelHandler.outputTrace('TRACE')
Exemple #24
0
def main():
    # add all the objects in a list
    objectList = [S, M1, M2, E, Q, R, F1, F2]
    # set the length of the experiment
    maxSimTime = 1440.0
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime, numberOfReplications=10, seed=1)

    print 'The exit of each replication is:'
    print E.Exits

    working_ratio_M1 = (M1.totalWorkingTime / maxSimTime) * 100
    working_ratio_M2 = (M2.totalWorkingTime / maxSimTime) * 100

    print "the system produced", E.numOfExits
    print "the working ratio of", M1.objName, "is", working_ratio_M1, "%"
    print "the working ratio of", M2.objName, "is", working_ratio_M2, "%"
Exemple #25
0
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
    blockage_ratio_M2 = (M2.totalBlockageTime/maxSimTime)*100
    waiting_ratio_M2 = (M2.totalWaitingTime/maxSimTime)*100    
    working_ratio_M3 = (M3.totalWorkingTime/maxSimTime)*100
    blockage_ratio_M3 = (M3.totalBlockageTime/maxSimTime)*100
    waiting_ratio_M3 = (M3.totalWaitingTime/maxSimTime)*100
    
    # return results for the test
    if test:
        return {"batches": 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,       
              }
        
    # print the results 
    print "the system produced", E.numOfExits, "batches"
    print "the working ratio of", M1.objName, "is", working_ratio_M1
    print "the blockage ratio of", M1.objName, 'is', blockage_ratio_M1
    print "the waiting ratio of", M1.objName, 'is', waiting_ratio_M1
    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
    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
    ExcelHandler.outputTrace('TRACE')
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, "working_ratio": working_ratio}

    # print the results
    print "the system produced", E.numOfExits, "frames"
    print "the working ratio of", A.objName, "is", working_ratio, "%"
Exemple #27
0
def main():
    
    # add all the objects in a list
    objectList=[S,M1,M2,E,Q,R,F1,F2]  
    # set the length of the experiment  
    maxSimTime=1440.0
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)

    #print the results
    print "the system produced", E.numOfExits, "parts"
    blockage_ratio = (M1.totalBlockageTime/maxSimTime)*100
    working_ratio = (R.totalWorkingTime/maxSimTime)*100
    print "the blockage ratio of", M1.objName,  "is", blockage_ratio, "%"
    print "the working ratio of", R.objName,"is", working_ratio, "%"
    return {"parts": E.numOfExits,
          "blockage_ratio": blockage_ratio,
          "working_ratio": working_ratio}
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"
    print "the total working ratio of the Machine is", working_ratio, "%"
Exemple #29
0
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
    runSimulation(objectList, maxSimTime)

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

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

    # print the results
    print "the pipeline produced", E.numOfExits, "winged aviators"
    print "the total flying ratio of the Aircraft is", working_ratio
Exemple #30
0
def main():
    # add all the objects in a list
    objectList=[M1,M2,M3,Q1,Q2,Q3,E,J1,J2,J3]  
    # set the length of the experiment  
    maxSimTime=float('inf')
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)
    
    #output the schedule of every job
    returnSchedule=[]     # dummy variable used just for returning values and testing
    for job in [J1,J2,J3]: 
        #loop in the schedule to print the results
        for record in job.schedule:
            #schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
            name=None
            returnSchedule.append([record[0].objName,record[1]])
            print job.name, "got into", record[0].objName, "at", record[1]
        print "-"*30
    return returnSchedule
Exemple #31
0
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
    runSimulation(objectList, maxSimTime)

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

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

    # print the results
    print "the pipeline produced", E.numOfExits, "winged aviators"
    print "the total flying ratio of the Aircraft is", working_ratio
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

    # return results for the test
    if test:
        return {"parts": E.numOfExits,
            "simulationTime":E.timeLastEntityLeft,
            "working_ratio": working_ratio}
    #print the results
    print '='*50
    print "the system produced", E.numOfExits, "parts in", E.timeLastEntityLeft, "minutes"
    print "the total working ratio of the Machine is", working_ratio, "%"
    ExcelHandler.outputTrace('ChangingPredecessors')
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}

    #print the results
    print "the system produced", E.numOfExits, "parts in", E.timeLastEntityLeft, "minutes"
    print "the total working ratio of the Machine is", working_ratio, "%"
    ExcelHandler.outputTrace('Wip1')
Exemple #34
0
def main(test=0):
    # add all the objects in a list
    objectList=[M1,M2,M3,Q1,Q2,Q3,E,J1,J2,J3]  
    # set the length of the experiment  
    maxSimTime=float('inf')
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)

    # return results for the test
    if test:
        returnSchedule=[]     
        for job in [J1,J2,J3]: 
            for record in job.schedule:
                returnSchedule.append([record[0].objName,record[1]])
        return returnSchedule
    
    # print the results
    for job in [J1,J2,J3]: 
        for record in job.schedule:
            print job.name, "got into", record[0].objName, "at", record[1]
        print "-"*30    
def main():
    
    # add all the objects in a list
    objectList=[S,M1,M2,E,Q,R,F1,F2]  
    # set the length of the experiment  
    maxSimTime=1440.0
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime, numberOfReplications=10, seed=1)
        
    print 'The exit of each replication is:'
    print E.Exits
    
    # calculate confidence interval using the Knowledge Extraction tool
    from dream.KnowledgeExtraction.ConfidenceIntervals import Intervals
    from dream.KnowledgeExtraction.StatisticalMeasures import BasicStatisticalMeasures
    BSM=BasicStatisticalMeasures()
    lb, ub = Intervals().ConfidIntervals(E.Exits, 0.95)
    print 'the 95% confidence interval for the throughput is:'
    print 'lower bound:', lb 
    print 'mean:', BSM.mean(E.Exits)
    print 'upper bound:', ub       
Exemple #36
0
def main():

    # add all the objects in a list
    objectList = [S, M1, M2, E, Q, R, F1, F2]
    # set the length of the experiment
    maxSimTime = 1440.0
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime, numberOfReplications=10, seed=1)

    print 'The exit of each replication is:'
    print E.Exits

    # calculate confidence interval using the Knowledge Extraction tool
    from dream.KnowledgeExtraction.ConfidenceIntervals import Intervals
    from dream.KnowledgeExtraction.StatisticalMeasures import BasicStatisticalMeasures
    BSM = BasicStatisticalMeasures()
    lb, ub = Intervals().ConfidIntervals(E.Exits, 0.95)
    print 'the 95% confidence interval for the throughput is:'
    print 'lower bound:', lb
    print 'mean:', BSM.mean(E.Exits)
    print 'upper bound:', ub
Exemple #37
0
def main(test=0):
    # add all the objects in a list
    objectList=[M1,M2,M3,Q1,Q2,Q3,E,J1,J2,J3]  
    # set the length of the experiment  
    maxSimTime=float('inf')
    # call the runSimulation giving the objects and the length of the experiment
    runSimulation(objectList, maxSimTime)

    # return results for the test
    if test:
        returnSchedule=[]     
        for job in [J1,J2,J3]: 
            for record in job.schedule:
                returnSchedule.append([record[0].objName,record[1]])
        return returnSchedule
    
    # print the results
    for job in [J1,J2,J3]: 
        for record in job.schedule:
            print job.name, "got into", record[0].objName, "at", record[1]
        print "-"*30    
def main():
    # 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)
    
    # print the results 
    print "the system produced", E.numOfExits, "batches"
    working_ratio_M1 = (M1.totalWorkingTime/maxSimTime)*100
    blockage_ratio_M1 = (M1.totalBlockageTime/maxSimTime)*100
    waiting_ratio_M1 = (M1.totalWaitingTime/maxSimTime)*100
    print "the working ratio of", M1.objName, "is", working_ratio_M1
    print "the blockage ratio of", M1.objName, 'is', blockage_ratio_M1
    print "the waiting ratio of", M1.objName, 'is', waiting_ratio_M1
    working_ratio_M2 = (M2.totalWorkingTime/maxSimTime)*100
    blockage_ratio_M2 = (M2.totalBlockageTime/maxSimTime)*100
    waiting_ratio_M2 = (M2.totalWaitingTime/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/maxSimTime)*100
    blockage_ratio_M3 = (M3.totalBlockageTime/maxSimTime)*100
    waiting_ratio_M3 = (M3.totalWaitingTime/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 {"batches": 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,       
          }
# the transition probabilities for machines
M1.p = 0.01
M1.g = 0.01
M1.r = 0.1
M1.f = 0.2
M2.p = 0.01
M2.g = 0.01
M2.r = 0.1
M2.f = 0.2
M3.p = 0.01
M3.g = 0.01
M3.r = 0.1
M3.f = 0.2

# call the runSimulation giving the objects and the length of the experiment
runSimulation(objectList, maxSimTime, numberOfReplications=20, trace='No')

#print the results
PRt = sum(E.Exits) / float(len(E.Exits))
PRg = sum(E.GoodExits) / float(len(E.GoodExits))
# B123ABF=sum(B123.BufferLevel)/float(len(B123.BufferLevel))
print E.Exits
print E.GoodExits
print G.AverageWIP
print 'PRt=', PRt / float(maxSimTime)
print 'PRg=', PRg / float(maxSimTime)
# print 'B123 average buffer level=',B123ABF
for M in [M1, M2, M3]:
    GE = sum(M.GoodExits) / float(len(M.GoodExits))
    print 'PRg' + M.id, '=', GE / float(maxSimTime)
# the transition probabilities for machines
M1.p=0.01
M1.g=0.01
M1.r=0.1
M1.f=0.2
M2.p=0.01
M2.g=0.01
M2.r=0.1
M2.f=0.2
M3.p=0.01
M3.g=0.01
M3.r=0.1
M3.f=0.2

# call the runSimulation giving the objects and the length of the experiment
runSimulation(objectList, maxSimTime, numberOfReplications=20,trace='No')

#print the results
PRt=sum(E.Exits)/float(len(E.Exits))
PRg=sum(E.GoodExits)/float(len(E.GoodExits))
# B123ABF=sum(B123.BufferLevel)/float(len(B123.BufferLevel))
print E.Exits
print E.GoodExits
print G.AverageWIP
print 'PRt=',PRt/float(maxSimTime)
print 'PRg=',PRg/float(maxSimTime)
# print 'B123 average buffer level=',B123ABF
for M in [M1,M2,M3]:
    GE=sum(M.GoodExits)/float(len(M.GoodExits))
    print 'PRg'+M.id,'=',GE/float(maxSimTime)
    
Exemple #41
0
commonRoute=[{"stationIdsList": ["T2"]},
         {"stationIdsList": ["Tr2"],"processingTime":{'Fixed':{'mean':0.03*milkUnit}},'volume':1000},
         {"stationIdsList": ["TBM2"]},
         {"stationIdsList": ["M2"],"processingTime":{'Fixed':{'mean':180}},'volume':1000},
         {"stationIdsList": ["TAM2"]},
         {"stationIdsList": ["Tr4"],"processingTime":{'Fixed':{'mean':0.06*milkUnit}},'volume':1000},
         {"stationIdsList": ["TBM3"]},
         {"stationIdsList": ["M3"],"processingTime":{'Fixed':{'mean':20}},'volume':1000},
         {"stationIdsList": ["E"]}]

MPList=[]       
for i in range(int(865/float(milkUnit))):
    MP=MilkPack('MT_A'+str(i),'MT_A'+str(i),route=route1+commonRoute,liters=milkUnit,fat=3.8*milkUnit,productId='Product X')
    MPList.append(MP)
     
for i in range(int(135/float(milkUnit))):
    MP=MilkPack('MT_B'+str(i),'MT_B'+str(i),route=route2+commonRoute,liters=milkUnit,fat=0.1*milkUnit,productId='Product X')
    MPList.append(MP)
        
runSimulation([T1,T2,T3,TBM2,TAM2,TBM3,TAM3,Tr1,Tr2,Tr3,Tr4,Tr5,M2,M3,E]+MPList, 1000,trace='Yes')
ExcelHandler.outputTrace('MilkPlant2')

for  productId in E.finishedProductDict:
    volume=E.finishedProductDict[productId]['volume']
    totalFat=E.finishedProductDict[productId]['totalFat']
    exitTime=E.finishedProductDict[productId]['exitTime']
    fat=totalFat/float(volume)
    print 'from', productId, volume, 'liters were produced of', fat, '% fat. Product ready at t=',exitTime
    
print 'Execution Time=',time.time()-start
Exemple #42
0
Tr1=MilkTransport('Tr1','Tr1')
Tr2=MilkTransport('Tr2','Tr2')
Tr3=MilkTransport('Tr3','Tr3')

E=ExitJobShop('E','Exit')

route1=[{"stationIdsList": ["T1"]},
         {"stationIdsList": ["Tr1"],"processingTime":{'Fixed':{'mean':0.17341}}},
         {"stationIdsList": ["T2"]},
         {"stationIdsList": ["Tr2"],"processingTime":{'Fixed':{'mean':0}},'volume':1000},
         {"stationIdsList": ["E"]}]

route2=[{"stationIdsList": ["T3"]},
         {"stationIdsList": ["Tr3"],"processingTime":{'Fixed':{'mean':1.11111}}},
         {"stationIdsList": ["T2"]},
         {"stationIdsList": ["Tr2"],"processingTime":{'Fixed':{'mean':0}},'volume':1000},
         {"stationIdsList": ["E"]}]

MPList=[]       
for i in range(173):
    MP=MilkPack('MT_A'+str(i),'MT_A'+str(i),route=list(route1),liters=5,fat=3.8,productId=1)
    MPList.append(MP)
     
for i in range(27):
    MP=MilkPack('MT_B'+str(i),'MT_B'+str(i),route=route2,currentStation=T3,liters=5,fat=0.1,productId=1)
    MPList.append(MP)
        
runSimulation([T1,T2,T3,Tr1,Tr2,Tr3,E]+MPList, 1000,trace='Yes')
ExcelHandler.outputTrace('MilkPlant')

print 1