Commit aa515ad8 authored by Georgios Dagkakis's avatar Georgios Dagkakis

once the volume is gathered then the packs can move

parent 04cb55a6
from dream.simulation.applications.MilkPlant.imports import * from dream.simulation.applications.MilkPlant.imports import *
from dream.simulation.imports import ExcelHandler, Exit from dream.simulation.imports import ExcelHandler, ExitJobShop
from dream.simulation.Globals import runSimulation from dream.simulation.Globals import runSimulation
...@@ -11,18 +11,18 @@ Tr1=MilkTransport('Tr1','Tr1') ...@@ -11,18 +11,18 @@ Tr1=MilkTransport('Tr1','Tr1')
Tr2=MilkTransport('Tr2','Tr2') Tr2=MilkTransport('Tr2','Tr2')
Tr3=MilkTransport('Tr3','Tr3') Tr3=MilkTransport('Tr3','Tr3')
E=Exit('E','Exit') E=ExitJobShop('E','Exit')
route1=[{"stationIdsList": ["T1"]}, route1=[{"stationIdsList": ["T1"]},
{"stationIdsList": ["Tr1"],"processingTime":{'Fixed':{'mean':0.17341}}}, {"stationIdsList": ["Tr1"],"processingTime":{'Fixed':{'mean':0.17341}}},
{"stationIdsList": ["T2"]}, {"stationIdsList": ["T2"]},
{"stationIdsList": ["Tr2"],"processingTime":{'Fixed':{'mean':1}},'volume':1000}, {"stationIdsList": ["Tr2"],"processingTime":{'Fixed':{'mean':0}},'volume':1000},
{"stationIdsList": ["E"]}] {"stationIdsList": ["E"]}]
route2=[{"stationIdsList": ["T3"]}, route2=[{"stationIdsList": ["T3"]},
{"stationIdsList": ["Tr3"],"processingTime":{'Fixed':{'mean':1.11111}}}, {"stationIdsList": ["Tr3"],"processingTime":{'Fixed':{'mean':1.11111}}},
{"stationIdsList": ["T2"]}, {"stationIdsList": ["T2"]},
{"stationIdsList": ["Tr2"],"processingTime":{'Fixed':{'mean':1}},'volume':1000}, {"stationIdsList": ["Tr2"],"processingTime":{'Fixed':{'mean':0}},'volume':1000},
{"stationIdsList": ["E"]}] {"stationIdsList": ["E"]}]
MPList=[] MPList=[]
......
...@@ -33,12 +33,21 @@ class MilkTank(QueueJobShop): ...@@ -33,12 +33,21 @@ class MilkTank(QueueJobShop):
def __init__(self, id=None, name=None, capacity=1,**kw): def __init__(self, id=None, name=None, capacity=1,**kw):
QueueJobShop.__init__(self,id,name,capacity) QueueJobShop.__init__(self,id,name,capacity)
def initialize(self):
self.alreadyGatheredProductIds=[]
QueueJobShop.initialize(self)
def haveToDispose(self, callerObject=None): def haveToDispose(self, callerObject=None):
if len(self.getActiveObjectQueue()): if len(self.getActiveObjectQueue()):
requestedVolume=self.getActiveObjectQueue()[0].remainingRoute[0].get('volume',-1) activeEntity=self.getActiveObjectQueue()[0]
if activeEntity.productId not in self.alreadyGatheredProductIds:
requestedVolume=activeEntity.remainingRoute[0].get('volume',-1)
totalLiters=self.getTotalLiters() totalLiters=self.getTotalLiters()
if totalLiters<requestedVolume: if totalLiters<requestedVolume:
return False return False
else:
# print self.env.now, 'gathered', self.getTotalLiters(), 'liters with', self.getFat(), 'fat'
self.alreadyGatheredProductIds.append(activeEntity.productId)
return QueueJobShop.haveToDispose(self, callerObject) return QueueJobShop.haveToDispose(self, callerObject)
def getFat(self): def getFat(self):
......
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