示例#1
0
def main(test=0):
    # add all the objects in a list
    objectList = [Q, M, E, P1, P2]
    # 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")
示例#2
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
示例#3
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")
示例#4
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
示例#5
0
]

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))