示例#1
0
    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)
示例#2
0
 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)
示例#3
0
 def initialize(self):
     # keep the ids of products that have already been gathered
     self.alreadyGatheredProductIds=[]
     QueueJobShop.initialize(self)
示例#4
0
 def initialize(self):
     # keep the ids of products that have already been gathered
     self.alreadyGatheredProductIds = []
     QueueJobShop.initialize(self)