Commit 73ecc520 authored by Georgios Dagkakis's avatar Georgios Dagkakis

2 new examples with non starving entry

parent 5858ff7f
from dream.simulation.imports import Machine, NonStarvingEntry, Exit, Part
from dream.simulation.Globals import runSimulation
#define the objects of the model
NS=NonStarvingEntry('NS1','Entry',entityData={'_class':'Dream.Part'})
M=Machine('M1','Machine', processingTime={'distributionType':'Fixed','mean':1})
E=Exit('E1','Exit')
#define predecessors and successors for the objects
NS.defineRouting(successorList=[M])
M.defineRouting(predecessorList=[NS],successorList=[E])
E.defineRouting(predecessorList=[M])
def main():
# add all the objects in a list
objectList=[NS,M,E]
# set the length of the experiment
maxSimTime=10
# call the runSimulation giving the objects and the length of the experiment
runSimulation(objectList, maxSimTime)
#print the results
print "the system produced", E.numOfExits, "parts"
working_ratio = (M.totalWorkingTime/maxSimTime)*100
print "the total working ratio of the Machine is", working_ratio, "%"
return {"parts": E.numOfExits,
"working_ratio": working_ratio}
if __name__ == '__main__':
main()
\ No newline at end of file
from dream.simulation.imports import BatchScrapMachine, NonStarvingEntry, Exit, Part
from dream.simulation.Globals import runSimulation
#define the objects of the model
NS=NonStarvingEntry('NS1','Entry',entityData={'_class':'Dream.Batch','numberOfUnits':100})
M=BatchScrapMachine('M1','Machine', processingTime={'distributionType':'Fixed','mean':0.02})
E=Exit('E1','Exit')
#define predecessors and successors for the objects
NS.defineRouting(successorList=[M])
M.defineRouting(predecessorList=[NS],successorList=[E])
E.defineRouting(predecessorList=[M])
def main():
# add all the objects in a list
objectList=[NS,M,E]
# set the length of the experiment
maxSimTime=10
# call the runSimulation giving the objects and the length of the experiment
runSimulation(objectList, maxSimTime)
#print the results
print "the system produced", E.numOfExits, "parts"
working_ratio = (M.totalWorkingTime/maxSimTime)*100
print "the total working ratio of the Machine is", working_ratio, "%"
return {"parts": E.numOfExits,
"working_ratio": working_ratio}
if __name__ == '__main__':
main()
\ No newline at end of file
......@@ -56,6 +56,7 @@ from dream.simulation.QueueManagedJob import QueueManagedJob
from dream.simulation.MouldAssembly import MouldAssembly
from dream.simulation.MouldAssemblyBuffer import MouldAssemblyBuffer
from dream.simulation.OrderDecomposition import OrderDecomposition
from dream.simulation.NonStarvingEntry import NonStarvingEntry
#Entities
from dream.simulation.Job import Job
......
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