예제 #1
0
M=Machine('M1','Machine', processingTime={'distributionType':'Fixed','mean':3})
E=Exit('E1','Exit')  

# create a repeated shift pattern
shiftPattern=[]
i = 0 
while i<100:
    shiftPattern.append([i,i+5])
    i+=10
print shiftPattern

#create the shift
SS=ShiftScheduler(victim=M, shiftPattern=shiftPattern) 

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

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

    # calculate metrics
    working_ratio = (M.totalWorkingTime/maxSimTime)*100
    off_shift_ratio=(M.totalOffShiftTime/maxSimTime)*100
예제 #2
0
             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])


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)
예제 #3
0
M1=Machine('M1','Machine1', processingTime={'distributionType':'Fixed','mean':0.25})
Q=Queue('Q1','Queue')
M2=Machine('M2','Machine2', processingTime={'distributionType':'Fixed','mean':1.5})
E=Exit('E1','Exit')  

#create failures
F1=Failure(victim=M1, distribution={'distributionType':'Fixed','MTTF':60,'MTTR':5}, repairman=R) 
F2=Failure(victim=M2, distribution={'distributionType':'Fixed','MTTF':40,'MTTR':10}, repairman=R)

G.ObjList=[S,M1,M2,E,Q]   #add all the objects in G.ObjList so that they can be easier accessed later
G.MachineList=[M1,M2]

G.ObjectInterruptionList=[F1,F2]     #add all the objects in G.ObjList so that they can be easier accessed later

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

def main():
    initialize()                        #initialize the simulation (SimPy method)
    
    #initialize all the objects
    R.initialize()


    for object in G.ObjList:
        object.initialize()
예제 #4
0
M1=Milling('M1','Milling1', processingTime={'distributionType':'Fixed','mean':0.25})
M2=Milling('M2','Milling2', processingTime={'distributionType':'Fixed','mean':0.25})
E=CountingExit('E1','Exit')  

F=Failure(victim=M1, distribution={'distributionType':'Fixed','MTTF':60,'MTTR':5})

G.ObjList=[S,Q,M1,M2,E]   #add all the objects in G.ObjList so that they can be easier accessed later

G.ObjectInterruptionList=[F]     #add all the objects in G.ObjList so that they can be easier accessed later

#create the global counter variables
G.NumM1=0
G.NumM2=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():
    initialize()                        #initialize the simulation (SimPy method)
        
    for object in G.ObjList:
        object.initialize()
        
    for objectInterruption in G.ObjectInterruptionList:
        objectInterruption.initialize()
    
    #activate all the objects 
예제 #5
0
F = Failure(victim=M,
            distribution={
                'TTF': {
                    'Fixed': {
                        'mean': 60.0
                    }
                },
                'TTR': {
                    'Fixed': {
                        'mean': 5.0
                    }
                }
            })

#define predecessors and successors for the objects
Sp.defineRouting([A])
Sf.defineRouting([A])
A.defineRouting([Sp, Sf], [M])
M.defineRouting([A], [E])
E.defineRouting([M])


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
예제 #6
0
M = Machine('M1', 'Machine', processingTime={'Fixed': {'mean': 3}})
E = Exit('E1', 'Exit')

# create a repeated shift pattern
shiftPattern = []
i = 0
while i < 100:
    shiftPattern.append([i, i + 5])
    i += 10
print shiftPattern

# create the shift
SS = ShiftScheduler(victim=M, shiftPattern=shiftPattern)

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


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

    # calculate metrics
    working_ratio = (M.totalWorkingTime / maxSimTime) * 100
    off_shift_ratio = (M.totalOffShiftTime / maxSimTime) * 100
예제 #7
0
from dream.simulation.imports import Machine, Source, Exit, Part, Frame, Assembly, Failure
from dream.simulation.Globals import runSimulation

#define the objects of the model
Frame.capacity=4 
Sp=Source('SP','Parts', interArrivalTime={'Fixed':{'mean':0.5}}, entity='Dream.Part')
Sf=Source('SF','Frames', interArrivalTime={'Fixed':{'mean':2}}, entity='Dream.Frame')
M=Machine('M','Machine', processingTime={'Fixed':{'mean':0.25}})
A=Assembly('A','Assembly', processingTime={'Fixed':{'mean':2}})
E=Exit('E1','Exit')  

F=Failure(victim=M, distribution={'TTF':{'Fixed':{'mean':60.0}},'TTR':{'Fixed':{'mean':5.0}}})

#define predecessors and successors for the objects    
Sp.defineRouting([A])
Sf.defineRouting([A])
A.defineRouting([Sp,Sf],[M])
M.defineRouting([A],[E])
E.defineRouting([M])

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
    
예제 #8
0
                        'mean': 60.0
                    }
                },
                'TTR': {
                    'Fixed': {
                        'mean': 5.0
                    }
                }
            })

#create priority attribute in the Machines
M1.priority = 10
M2.priority = 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
    runSimulation(objectList, maxSimTime)
예제 #9
0
# of a fleet of systems with multiple stakeholders.
# 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
    runSimulation(objectList, maxSimTime)

    # calculate metrics
    working_ratio = (AC.totalWorkingTime/maxSimTime) * 100
예제 #10
0
#     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
    runSimulation(objectList, maxSimTime)

    # calculate metrics