本文整理汇总了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
示例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
示例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
示例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
示例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
示例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
示例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