Commit 601abebe authored by Georgios Dagkakis's avatar Georgios Dagkakis

define static random number seed

parent 907b6735
from dream.simulation.imports import Machine, Queue, NonStarvingEntry, Exit, Part, EventGenerator,ExcelHandler, Part from dream.simulation.imports import Machine, Queue, NonStarvingEntry, Exit, Part, EventGenerator,ExcelHandler, Part
from dream.simulation.Globals import runSimulation, G from dream.simulation.Globals import runSimulation, G
import random import random
from random import Random
Rnd = Random(3)
p=0.01 p=0.01
g=0.01 g=0.01
...@@ -111,7 +113,7 @@ def controllerMethod(): ...@@ -111,7 +113,7 @@ def controllerMethod():
break break
def createRandomNumber(): def createRandomNumber():
return random.uniform(0,1) return Rnd.uniform(0,1)
#define the objects of the model #define the objects of the model
...@@ -120,7 +122,7 @@ NS2=NonStarvingEntry('NS2','Entry2',entityData={'_class':'Dream.Part','status':' ...@@ -120,7 +122,7 @@ NS2=NonStarvingEntry('NS2','Entry2',entityData={'_class':'Dream.Part','status':'
M1=OpMachine('M1','Machine1', processingTime={'Fixed':{'mean':0.1}}) M1=OpMachine('M1','Machine1', processingTime={'Fixed':{'mean':0.1}})
M2=OpMachine('M2','Machine2', processingTime={'Fixed':{'mean':0.1}}) M2=OpMachine('M2','Machine2', processingTime={'Fixed':{'mean':0.1}})
M3=OpMachine('M3','Machine3', processingTime={'Fixed':{'mean':0.1}}) M3=OpMachine('M3','Machine3', processingTime={'Fixed':{'mean':0.1}})
B123=OpQueue('B123','Queue', capacity=45) B123=OpQueue('B123','Queue', capacity=10)
E=OpExit('E1','Exit') E=OpExit('E1','Exit')
Controller=EventGenerator('EV','Controller',start=0,interval=1,method=controllerMethod) Controller=EventGenerator('EV','Controller',start=0,interval=1,method=controllerMethod)
...@@ -142,7 +144,7 @@ for obj in objectList: ...@@ -142,7 +144,7 @@ for obj in objectList:
E.GoodExits=[] E.GoodExits=[]
# call the runSimulation giving the objects and the length of the experiment # call the runSimulation giving the objects and the length of the experiment
runSimulation(objectList, 1000.01, numberOfReplications=50) runSimulation(objectList, 1000, numberOfReplications=50)
#print the results #print the results
PRt=sum(E.Exits)/float(len(E.Exits)) PRt=sum(E.Exits)/float(len(E.Exits))
......
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