当前位置: 首页>>代码示例>>Python>>正文


Python CoreObject.getEntity方法代码示例

本文整理汇总了Python中CoreObject.CoreObject.getEntity方法的典型用法代码示例。如果您正苦于以下问题:Python CoreObject.getEntity方法的具体用法?Python CoreObject.getEntity怎么用?Python CoreObject.getEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CoreObject.CoreObject的用法示例。


在下文中一共展示了CoreObject.getEntity方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getEntity

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import getEntity [as 别名]
 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
开发者ID:mmariani,项目名称:dream,代码行数:10,代码来源:Conveyer.py

示例2: getEntity

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import getEntity [as 别名]
 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
开发者ID:cpcdevelop,项目名称:dream,代码行数:12,代码来源:Queue.py

示例3: getEntity

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import getEntity [as 别名]
 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
开发者ID:cpcdevelop,项目名称:dream,代码行数:14,代码来源:Conveyer.py

示例4: getEntity

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import getEntity [as 别名]
 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          
开发者ID:mmariani,项目名称:dream,代码行数:14,代码来源:Exit.py

示例5: getEntity

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import getEntity [as 别名]
 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
开发者ID:cpcdevelop,项目名称:dream,代码行数:15,代码来源:Dismantle.py

示例6: getEntity

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import getEntity [as 别名]
    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
开发者ID:cpcdevelop,项目名称:dream,代码行数:21,代码来源:Exit.py

示例7: getEntity

# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import getEntity [as 别名]
 def getEntity(self):
     activeEntity=CoreObject.getEntity(self)  #run the default behavior 
     return activeEntity
开发者ID:mmariani,项目名称:dream,代码行数:5,代码来源:Queue.py


注:本文中的CoreObject.CoreObject.getEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。