Commit 7a0a1f88 authored by Georgios Dagkakis's avatar Georgios Dagkakis

TwoServers Example editted to match new notations

parent e48b2494
from dream.simulation.imports import Machine, Source, Exit, Part, G, Repairman, Queue, Failure
from dream.simulation.imports import simulate, activate, initialize
#define distributions as a dicts
interarrivalTimeS={}
interarrivalTimeS['distributionType'] = 'Fixed'
interarrivalTimeS['mean'] = 0.5
processingTimeM1={}
processingTimeM1['distributionType'] = 'Fixed'
processingTimeM1['mean'] = 0.25
processingTimeM2={}
processingTimeM2['distributionType'] = 'Fixed'
processingTimeM2['mean'] = 1.5
failure1Distribution={}
failure1Distribution['failureDistribution'] = 'Fixed'
failure1Distribution['MTTF'] = 60
failure1Distribution['MTTR'] = 5
failure2Distribution={}
failure2Distribution['failureDistribution'] = 'Fixed'
failure2Distribution['MTTF'] = 40
failure2Distribution['MTTR'] = 10
#define the objects of the model
R=Repairman('R1', 'Bob')
S=Source('S1','Source', interarrivalTime=interarrivalTimeS, entity='Dream.Part')
M1=Machine('M1','Machine1', processingTime=processingTimeM1)
S=Source('S1','Source', interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.Part')
M1=Machine('M1','Machine1', processingTime={'distributionType':'Fixed','mean':0.25})
Q=Queue('Q1','Queue')
M2=Machine('M2','Machine2', processingTime=processingTimeM2)
M2=Machine('M2','Machine2', processingTime={'distributionType':'Fixed','mean':1.5})
E=Exit('E1','Exit')
#create failures
F1=Failure(victim=M1, distribution=failure1Distribution, repairman=R)
F2=Failure(victim=M2, distribution=failure2Distribution, repairman=R)
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]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment