Пример #1
0
from manpy.simulation.imports import Machine, Source, Exit, Part, Queue, Failure
from manpy.simulation.Globals import runSimulation

# define the objects of the model
S = Source(
    "S", "Source", interArrivalTime={"Fixed": {"mean": 0.5}}, entity="manpy.Part"
)
Q = Queue("Q", "Queue", capacity=float("inf"))
M1 = Machine("M1", "Milling1", processingTime={"Fixed": {"mean": 0.25}})
M2 = Machine("M2", "Milling2", processingTime={"Fixed": {"mean": 0.25}})
E = Exit("E1", "Exit")
F = Failure(
    victim=M1,
    distribution={"TTF": {"Fixed": {"mean": 60.0}}, "TTR": {"Fixed": {"mean": 5.0}}},
)

# define predecessors and successors for the objects
S.defineRouting([Q])
Q.defineRouting([S], [M1, M2])
M1.defineRouting([Q], [E])
M2.defineRouting([Q], [E])
E.defineRouting([M1, M2])


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
Пример #2
0
)
from manpy.simulation.Globals import runSimulation

# define the objects of the model
R = Repairman("R1", "Bob")
S = Source(
    "S1", "Source", interArrivalTime={"Fixed": {"mean": 0.5}}, entity="manpy.Part"
)
M1 = Machine("M1", "Machine1", processingTime={"Fixed": {"mean": 0.25}})
Q = Queue("Q1", "Queue")
M2 = Machine("M2", "Machine2", processingTime={"Fixed": {"mean": 1.5}})
E = Exit("E1", "Exit")
# create failures
F1 = Failure(
    victim=M1,
    distribution={"TTF": {"Fixed": {"mean": 60.0}}, "TTR": {"Fixed": {"mean": 5.0}}},
    repairman=R,
)
F2 = Failure(
    victim=M2,
    distribution={"TTF": {"Fixed": {"mean": 40.0}}, "TTR": {"Fixed": {"mean": 10.0}}},
    repairman=R,
)

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