Commit b7a8c678 authored by Georgios Dagkakis's avatar Georgios Dagkakis

example to print product information

parent 87f3af37
...@@ -24,7 +24,7 @@ Tr5=MilkTransport('Tr5','Tr5') ...@@ -24,7 +24,7 @@ Tr5=MilkTransport('Tr5','Tr5')
M2=MilkProcess('M2','F') M2=MilkProcess('M2','F')
M3=MilkProcess('M3','W') M3=MilkProcess('M3','W')
E=ExitJobShop('E','Exit') E=MilkExit('E','Exit')
route1=[{"stationIdsList": ["T1"]}, route1=[{"stationIdsList": ["T1"]},
{"stationIdsList": ["Tr1"],"processingTime":{'Fixed':{'mean':0.034682*milkUnit}}}] {"stationIdsList": ["Tr1"],"processingTime":{'Fixed':{'mean':0.034682*milkUnit}}}]
...@@ -44,14 +44,21 @@ commonRoute=[{"stationIdsList": ["T2"]}, ...@@ -44,14 +44,21 @@ commonRoute=[{"stationIdsList": ["T2"]},
MPList=[] MPList=[]
for i in range(int(865/float(milkUnit))): for i in range(int(865/float(milkUnit))):
MP=MilkPack('MT_A'+str(i),'MT_A'+str(i),route=route1+commonRoute,liters=milkUnit,fat=3.8,productId=1) MP=MilkPack('MT_A'+str(i),'MT_A'+str(i),route=route1+commonRoute,liters=milkUnit,fat=3.8,productId='Product X')
MPList.append(MP) MPList.append(MP)
for i in range(int(135/float(milkUnit))): for i in range(int(135/float(milkUnit))):
MP=MilkPack('MT_B'+str(i),'MT_B'+str(i),route=route2+commonRoute,currentStation=T3,liters=milkUnit,fat=0.1,productId=1) MP=MilkPack('MT_B'+str(i),'MT_B'+str(i),route=route2+commonRoute,currentStation=T3,liters=milkUnit,fat=0.1,productId='Product X')
MPList.append(MP) MPList.append(MP)
runSimulation([T1,T2,T3,TBM2,TAM2,TBM3,TAM3,Tr1,Tr2,Tr3,Tr4,Tr5,M2,M3,E]+MPList, 1000,trace='Yes') runSimulation([T1,T2,T3,TBM2,TAM2,TBM3,TAM3,Tr1,Tr2,Tr3,Tr4,Tr5,M2,M3,E]+MPList, 1000,trace='Yes')
ExcelHandler.outputTrace('MilkPlant2') ExcelHandler.outputTrace('MilkPlant2')
for productId in E.finishedProductDict:
volume=E.finishedProductDict[productId]['volume']
totalFat=E.finishedProductDict[productId]['totalFat']
exitTime=E.finishedProductDict[productId]['exitTime']
fat=totalFat/float(volume)
print 'from', productId, volume, 'liters were produced of', fat, '% fat. Product ready at t=',exitTime
print 'Execution Time=',time.time()-start print 'Execution Time=',time.time()-start
\ No newline at end of file
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