Пример #1
0
    def getEntity(self): 
        activeEntity = CoreObject.getEntity(self)           #run the default method
        # if the entity is in the G.pendingEntities list then remove it from there
        from Globals import G
#         G.pendingEntities[:]=(entity for entity in G.pendingEntities if not entity is activeEntity)
        if G.RouterList:
            if activeEntity in G.pendingEntities:
                G.pendingEntities.remove(activeEntity)
#         if activeEntity in G.EntityList:
#             G.EntityList.remove(activeEntity)
#         self.clear(activeEntity)
        self.totalLifespan+=self.env.now-activeEntity.startTime    #Add the entity's lifespan to the total one. 
        self.numOfExits+=1                                          # increase the exits by one
        self.totalNumberOfUnitsExited+=activeEntity.numberOfUnits   # add the number of units that xited
        self.totalTaktTime+=self.env.now-self.timeLastEntityLeft           # add the takt time
        self.timeLastEntityLeft=self.env.now                               # update the time that the last entity left from the Exit
        activeObjectQueue=self.getActiveObjectQueue()
        del self.Res.users[:]
        # if there is a cancelCondition the exit may end the simulation
        if self.cancelCondition:
            if self.cancelCondition.get('reason',None) =='throughput' and int(self.cancelCondition.get('number',-1))==self.numOfExits:
                self.endSimulation()
            if self.cancelCondition.get('reason',None) =='empty' and self.checkIfSystemEmpty():
                self.endSimulation()
        return activeEntity
Пример #2
0
 def getEntity(self):       
     activeEntity=CoreObject.getEntity(self) 
     self.position.append(0)           #the entity is placed in the start of the conveyer
     #check if the conveyer became full to start counting blockage 
     if self.isFull():
         self.timeBlockageStarted=now()
         self.wasFull=True
     return activeEntity
Пример #3
0
 def getEntity(self):
     activeEntity=CoreObject.getEntity(self)  #run the default behavior 
     # if the level is reached then try to signal the Router to reallocate the operators
     try:
         if self.level:
             if len(self.getActiveObjectQueue())==self.level and self.checkForDedicatedOperators():
                 self.requestAllocation()
     except:
         pass
     return activeEntity
Пример #4
0
 def getEntity(self):
     activeEntity = CoreObject.getEntity(self)  #run the default behavior
     # if the level is reached then try to signal the Router to reallocate the operators
     try:
         if self.level:
             if len(self.getActiveObjectQueue()
                    ) == self.level and self.checkForDedicatedOperators():
                 self.requestAllocation()
     except:
         pass
     return activeEntity
Пример #5
0
 def getEntity(self):       
     #the entity is placed in the start of the conveyer
     self.position.append(0)
     activeEntity=CoreObject.getEntity(self) 
     # counting the total number of units to be moved through the whole simulation time
     self.numberOfMoves+=1
     #check if the conveyer became full to start counting blockage 
     if self.isFull():
         self.timeBlockageStarted=self.env.now
         self.wasFull=True
         self.printTrace(self.id, conveyerFull=str(len(self.getActiveObjectQueue())))
     return activeEntity
Пример #6
0
 def getEntity(self): 
     activeEntity = CoreObject.getEntity(self)           #run the default method
     # if the entity is in the G.pendingEntities list then remove it from there
     from Globals import G
     if activeEntity in G.pendingEntities:
         G.pendingEntities.remove(activeEntity)
     self.totalLifespan+=now()-activeEntity.startTime    #Add the entity's lifespan to the total one. 
     self.numOfExits+=1                                          # increase the exits by one
     self.totalNumberOfUnitsExited+=activeEntity.numberOfUnits   # add the number of units that xited
     self.totalTaktTime+=now()-self.timeLastEntityLeft           # add the takt time
     self.timeLastEntityLeft=now()                               # update the time that the last entity left from the Exit
     return activeEntity          
Пример #7
0
 def getEntity(self):       
     #the entity is placed in the start of the conveyer
     self.position.append(0)
     activeEntity=CoreObject.getEntity(self) 
     # counting the total number of units to be moved through the whole simulation time
     self.numberOfMoves+=1
     #check if the conveyer became full to start counting blockage 
     if self.isFull():
         self.timeBlockageStarted=self.env.now
         self.wasFull=True
         self.printTrace(self.id, conveyerFull=str(len(self.getActiveObjectQueue())))
     return activeEntity
Пример #8
0
 def getEntity(self):
     activeEntity=CoreObject.getEntity(self)     #run the default method
     activeObjectQueue=self.getActiveObjectQueue()
     #get also the parts of the frame so that they can be popped
     for part in activeEntity.getFrameQueue():         
         activeObjectQueue.append(part)
         part.currentStation=self
     activeEntity.getFrameQueue=[]           #empty the frame
     
     #move the frame to the end of the internal queue since we want the frame to be disposed first
     activeObjectQueue.append(activeEntity)
     activeObjectQueue.pop(0)        
     return activeEntity
Пример #9
0
    def getEntity(self):
        activeEntity = CoreObject.getEntity(self)  #run the default method
        activeObjectQueue = self.getActiveObjectQueue()
        #get also the parts of the frame so that they can be popped
        for part in activeEntity.getFrameQueue():
            activeObjectQueue.append(part)
            part.currentStation = self
        activeEntity.getFrameQueue = []  #empty the frame

        #move the frame to the end of the internal queue since we want the frame to be disposed first
        activeObjectQueue.append(activeEntity)
        activeObjectQueue.pop(0)
        return activeEntity
Пример #10
0
    def getEntity(self):
        activeEntity = CoreObject.getEntity(self)  #run the default method
        # if the entity is in the G.pendingEntities list then remove it from there
        from Globals import G
        #         G.pendingEntities[:]=(entity for entity in G.pendingEntities if not entity is activeEntity)
        if G.Router:
            if activeEntity in G.pendingEntities:
                G.pendingEntities.remove(activeEntity)
#         if activeEntity in G.EntityList:
#             G.EntityList.remove(activeEntity)
#         self.clear(activeEntity)
        self.totalLifespan += self.env.now - activeEntity.startTime  #Add the entity's lifespan to the total one.
        self.numOfExits += 1  # increase the exits by one
        self.totalNumberOfUnitsExited += activeEntity.numberOfUnits  # add the number of units that xited
        self.totalTaktTime += self.env.now - self.timeLastEntityLeft  # add the takt time
        self.timeLastEntityLeft = self.env.now  # update the time that the last entity left from the Exit
        activeObjectQueue = self.getActiveObjectQueue()
        del self.Res.users[:]
        return activeEntity
Пример #11
0
    def getEntity(self): 
        activeEntity = CoreObject.getEntity(self)           #run the default method
        # if the entity is in the G.pendingEntities list then remove it from there
        from Globals import G
#         G.pendingEntities[:]=(entity for entity in G.pendingEntities if not entity is activeEntity)
        if G.Router:
            if activeEntity in G.pendingEntities:
                G.pendingEntities.remove(activeEntity)
#         if activeEntity in G.EntityList:
#             G.EntityList.remove(activeEntity)
#         self.clear(activeEntity)
        self.totalLifespan+=self.env.now-activeEntity.startTime    #Add the entity's lifespan to the total one. 
        self.numOfExits+=1                                          # increase the exits by one
        self.totalNumberOfUnitsExited+=activeEntity.numberOfUnits   # add the number of units that xited
        self.totalTaktTime+=self.env.now-self.timeLastEntityLeft           # add the takt time
        self.timeLastEntityLeft=self.env.now                               # update the time that the last entity left from the Exit
        activeObjectQueue=self.getActiveObjectQueue()
        del self.Res.users[:]
        return activeEntity
Пример #12
0
 def getEntity(self):
     activeEntity=CoreObject.getEntity(self)  #run the default behavior 
     return activeEntity