def haveToDispose(self, callerObject=None): if len(self.getActiveObjectQueue()): activeEntity=self.getActiveObjectQueue()[0] if activeEntity.productId not in self.alreadyGatheredProductIds: requestedVolume=activeEntity.remainingRoute[0].get('volume',-1) totalLiters=self.getTotalLiters() if totalLiters<requestedVolume: 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)
def haveToDispose(self, callerObject=None): if len(self.getActiveObjectQueue()): activeEntity = self.getActiveObjectQueue()[0] if activeEntity.productId not in self.alreadyGatheredProductIds: requestedVolume = activeEntity.remainingRoute[0].get( 'volume', -1) totalLiters = self.getTotalLiters() if totalLiters < requestedVolume: 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)
def initialize(self): # keep the ids of products that have already been gathered self.alreadyGatheredProductIds=[] QueueJobShop.initialize(self)
def initialize(self): # keep the ids of products that have already been gathered self.alreadyGatheredProductIds = [] QueueJobShop.initialize(self)