Commit 71b8c72e authored by Georgios Dagkakis's avatar Georgios Dagkakis

TwoServers example changed to match new notation

parent 1ac8f292
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', mean=0.5, entity='Dream.Part')
M1=Machine('M1','Machine1', mean=0.25)
R=Repairman('R1', 'Bob')
S=Source('S1','Source', interarrivalTime=interarrivalTimeS, entity='Dream.Part')
M1=Machine('M1','Machine1', processingTime=processingTimeM1)
Q=Queue('Q1','Queue')
M2=Machine('M2','Machine2', mean=1.5)
M2=Machine('M2','Machine2', processingTime=processingTimeM2)
E=Exit('E1','Exit')
#create failures
F1=Failure(victim=M1, distributionType='Fixed', MTTF=60, MTTR=5, repairman=R)
F2=Failure(victim=M2, distributionType='Fixed', MTTF=40, MTTR=10, repairman=R)
F1=Failure(victim=M1, distribution=failure1Distribution, repairman=R)
F2=Failure(victim=M2, distribution=failure2Distribution, 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
......
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