コード例 #1
0
 def removeEntity(self, entity=None):
     activeEntity = Machine.removeEntity(self, entity)
     scrapQuantity=self.scrapRng.generateNumber()  
     activeEntity.numberOfUnits-=int(scrapQuantity)  # the scrapQuantity should be integer at whatever case
     if activeEntity.numberOfUnits<0:
         activeEntity.numberOfUnits==0
     return activeEntity
コード例 #2
0
 def removeEntity(self, entity=None):
     activeEntity = Machine.removeEntity(self, entity)
     scrapQuantity = self.scrapRng.generateNumber()
     activeEntity.numberOfUnits -= int(
         scrapQuantity
     )  # the scrapQuantity should be integer at whatever case
     if activeEntity.numberOfUnits < 0:
         activeEntity.numberOfUnits == 0
     return activeEntity
コード例 #3
0
ファイル: MachineJobShop.py プロジェクト: PanosBarlas/dream
 def removeEntity(self, entity=None):
     receiverObject=self.receiver  
     activeEntity=Machine.removeEntity(self, entity)         #run the default method  
     removeReceiver=True 
     # search in the internalQ. If an entity has the same receiver do not remove
     for ent in self.Res.users:
         nextObjectIds=ent.remainingRoute[0].get('stationIdsList',[])
         if receiverObject.id in nextObjectIds:
             removeReceiver=False      
     # if not entity had the same receiver then the receiver will be removed    
     if removeReceiver:
         self.next.remove(receiverObject)
     return activeEntity
コード例 #4
0
 def removeEntity(self, entity=None):
     receiverObject=self.receiver  
     activeEntity=Machine.removeEntity(self, entity)         #run the default method  
     removeReceiver=True 
     # search in the internalQ. If an entity has the same receiver do not remove
     for ent in self.Res.users:
         nextObjectIds=ent.remainingRoute[0].get('stationIdsList',[])
         if receiverObject.id in nextObjectIds:
             removeReceiver=False      
     # if not entity had the same receiver then the receiver will be removed    
     if removeReceiver:
         self.next.remove(receiverObject)
     return activeEntity