示例#1
0
    def haveToDispose(self, callerObject=None):
        '''
        checks if the Buffer can dispose an entity. 
        Returns True only to the potential receiver
        Returns True when all the mould components/parts reside either
        in the internal buffer activeQ or in the callerObject's activeQ
        '''
        # get active object and its queue
        activeObject=self.getActiveObject()
        activeObjectQueue=self.getActiveObjectQueue()
        thecaller=callerObject
        # and then perform the default behaviour
        if ConditionalBuffer.haveToDispose(self,callerObject):
            # update the local variable activeEntity
            activeEntity=activeObjectQueue[0]
            # if we are at the start of the simulation then check if all the child components 
            # of a specific order are present in the buffer and ready to be delivered to the assembly station
            try:
                # for all the components that have the same parent Order as the activeEntity
                activeEntity.order.componentsReadyForAssembly = 1
                for entity in activeEntity.order.getAssemblyComponents():
                # if one of them has not reach the Buffer yet,
                    if not entity.readyForAssembly:
                # the mould is not ready for assembly
                        activeEntity.order.componentsReadyForAssembly = 0
                        break
            # if the activeEntity is of type Mould
            except:
                pass

            try:
                return thecaller.getActiveObjectQueue()[0].order is activeEntity.order\
                       and activeEntity.order.componentsReadyForAssembly
            except:
                return activeEntity.order.componentsReadyForAssembly
    def haveToDispose(self, callerObject=None):
        '''
        checks if the Buffer can dispose an entity. 
        Returns True only to the potential receiver
        Returns True when all the mould components/parts reside either
        in the internal buffer activeQ or in the callerObject's activeQ
        '''
        # get active object and its queue
        activeObject = self.getActiveObject()
        activeObjectQueue = self.getActiveObjectQueue()
        thecaller = callerObject
        # and then perform the default behaviour
        if ConditionalBuffer.haveToDispose(self, callerObject):
            # update the local variable activeEntity
            activeEntity = activeObjectQueue[0]
            # if we are at the start of the simulation then check if all the child components
            # of a specific order are present in the buffer and ready to be delivered to the assembly station
            try:
                # for all the components that have the same parent Order as the activeEntity
                activeEntity.order.componentsReadyForAssembly = 1
                for entity in activeEntity.order.getAssemblyComponents():
                    # if one of them has not reach the Buffer yet,
                    if not entity.readyForAssembly:
                        # the mould is not ready for assembly
                        activeEntity.order.componentsReadyForAssembly = 0
                        break
            # if the activeEntity is of type Mould
            except:
                pass

            try:
                return thecaller.getActiveObjectQueue()[0].order is activeEntity.order\
                       and activeEntity.order.componentsReadyForAssembly
            except:
                return activeEntity.order.componentsReadyForAssembly
示例#3
0
 def haveToDispose(self, callerObject=None):
     '''
     checks if the Buffer can dispose an entity. 
     Returns True only to the potential receiver
     Returns True when all the mould components/parts reside either
     in the internal buffer activeQ or in the callerObject's activeQ
     '''
     # get active object and its queue
     activeObject = self.getActiveObject()
     activeObjectQueue = self.getActiveObjectQueue()
     thecaller = callerObject
     # and then perform the default behaviour
     if ConditionalBuffer.haveToDispose(self, callerObject):
         # update the local variable activeEntity
         activeEntity = activeObjectQueue[0]
         try:
             return thecaller.getActiveObjectQueue()[0].order is activeEntity.order\
                    and activeEntity.order.componentsReadyForAssembly
         except:
             return activeEntity.order.componentsReadyForAssembly
示例#4
0
 def haveToDispose(self, callerObject=None):
     '''
     checks if the Buffer can dispose an entity. 
     Returns True only to the potential receiver
     Returns True when all the mould components/parts reside either
     in the internal buffer activeQ or in the callerObject's activeQ
     '''
     # get active object and its queue
     activeObject=self.getActiveObject()
     activeObjectQueue=self.getActiveObjectQueue()
     thecaller=callerObject
     # and then perform the default behaviour
     if ConditionalBuffer.haveToDispose(self,callerObject):
         # update the local variable activeEntity
         activeEntity=activeObjectQueue[0]
         try:
             return thecaller.getActiveObjectQueue()[0].order is activeEntity.order\
                    and activeEntity.order.componentsReadyForAssembly
         except:
             return activeEntity.order.componentsReadyForAssembly