本文整理汇总了Python中CoreObject.CoreObject.removeEntity方法的典型用法代码示例。如果您正苦于以下问题:Python CoreObject.removeEntity方法的具体用法?Python CoreObject.removeEntity怎么用?Python CoreObject.removeEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoreObject.CoreObject
的用法示例。
在下文中一共展示了CoreObject.removeEntity方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeEntity=CoreObject.removeEntity(self, entity) #run the default method
self.waitToDispose=False
if self.canAccept():
self.printTrace(self.id, attemptSignalGiver='(removeEntity)')
self.signalGiver()
return activeEntity
示例2: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeObject=self.getActiveObject()
activeEntity=CoreObject.removeEntity(self, entity) # run the default method
activeObject.waitToDispose=False # update the waitToDispose flag
if activeObject.canAccept():
activeObject.signalGiver()
return activeEntity
示例3: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeObject=self.getActiveObject()
activeEntity=CoreObject.removeEntity(self, entity) #run the default method
if self.canAccept():
self.signalGiver()
if self.haveToDispose():
# print now(), self.id, 'will try to signal a receiver from removeEntity'
self.signalReceiver()
return activeEntity
示例4: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeObjectQueue=self.getActiveObjectQueue()
activeEntity=CoreObject.removeEntity(self, entity) #run the default method
#update the flags
if(len(activeObjectQueue)==0):
self.waitToDisposeFrame=False
else:
if(len(activeObjectQueue)==1):
self.waitToDisposePart=False
return activeEntity
示例5: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeEntity=CoreObject.removeEntity(self, entity) #run the default method
self.position.pop(0)
self.waitToDispose=False
#if the conveyer was full, it means that it also was blocked
#we count this blockage time
if self.wasFull:
#self.totalBlockageTime+=now()-self.timeBlockageStarted
self.wasFull=False
#calculate the time that the conveyer will become available again and trigger the conveyerMover
self.timeToBecomeAvailable=((self.position[-1]+self.currentRequestedLength)/float(self.speed))/60
self.conveyerMover.timeToWait=self.timeToBecomeAvailable
self.call=True
return activeEntity
示例6: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
if len(self.getActiveObjectQueue())==1 and len(self.scheduledEntities):
newEntity=self.createEntity() # create the Entity object and assign its name
newEntity.creationTime=self.scheduledEntities.pop(0) # assign the current simulation time as the Entity's creation time
newEntity.startTime=newEntity.creationTime # assign the current simulation time as the Entity's start time
#print self.env.now, 'getting from the list. StartTime=',newEntity.startTime
newEntity.currentStation=self # update the current station of the Entity
G.EntityList.append(newEntity)
self.getActiveObjectQueue().append(newEntity) # append the entity to the resource
self.numberOfArrivals+=1 # we have one new arrival
G.numberOfEntities+=1
self.appendEntity(newEntity)
activeEntity=CoreObject.removeEntity(self, entity) # run the default method
if len(self.getActiveObjectQueue())==1:
self.entityCreated.succeed(newEntity)
return activeEntity
示例7: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeEntity=CoreObject.removeEntity(self, entity) #run the default method
if self.canAccept():
self.signalGiver()
# TODO: disable that for the mouldAssemblyBuffer
if not self.__class__.__name__=='MouldAssemblyBuffer':
if self.haveToDispose():
# self.printTrace(self.id, attemptSignalReceiver='(removeEntity)')
self.signalReceiver()
# check if the queue is empty, if yes then try to signal the router, operators may need reallocation
try:
if self.level:
if not len(self.getActiveObjectQueue()) and self.checkForDedicatedOperators():
self.requestAllocation()
except:
pass
return activeEntity
示例8: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeObject=self.getActiveObject()
activeObjectQueue=activeObject.getActiveObjectQueue()
#run the default method
activeEntity=CoreObject.removeEntity(self, entity, resetFlags=False, addBlockage=False)
#update the flags
if(len(activeObjectQueue)==0):
activeObject.waitToDisposeFrame=False
self.isBlocked=False
self.isProcessing=False
self.addBlockage()
else:
if(len(activeObjectQueue)==1):
activeObject.waitToDisposePart=False
# if the internal queue is empty then try to signal the giver that the object can now receive
if activeObject.canAccept():
activeObject.printTrace(self.id, attemptSignalGiver='(removeEntity)')
activeObject.signalGiver()
return activeEntity
示例9: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeEntity=CoreObject.removeEntity(self, entity) #run the default method
# remove the entity from the position list
self.position.pop(0)
# the object doesn't wait to dispose any more
self.waitToDispose=False
#if the conveyer was full, it means that it also was blocked
#we count this blockage time
if self.wasFull:
# self.totalBlockageTime+=self.env.now-self.timeBlockageStarted
self.wasFull=False
#calculate the time that the conveyer will become available again and trigger the conveyerMover
if self.updateMoveTime():
# print self.id, 'time to move', self.conveyerMover.timeToWait
self.conveyerMover.canMove.succeed(self.env.now)
# if there is anything to dispose of then signal a receiver
if self.haveToDispose():
self.printTrace(self.id, attemptSingalReceiver='(removeEntity)')
self.signalReceiver()
return activeEntity
示例10: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeEntity=CoreObject.removeEntity(self, entity) #run the default method
if self.canAccept():
self.signalGiver()
# TODO: disable that for the mouldAssemblyBuffer
if not self.__class__.__name__=='MouldAssemblyBufferManaged':
if self.haveToDispose():
# self.printTrace(self.id, attemptSignalReceiver='(removeEntity)')
self.signalReceiver()
# reset the signals for the Queue. It be in the start of the loop for now
# xxx consider to dothis in all CoreObjects
self.expectedSignals['isRequested']=1
self.expectedSignals['canDispose']=1
self.expectedSignals['loadOperatorAvailable']=1
# check if the queue is empty, if yes then try to signal the router, operators may need reallocation
try:
if self.level:
if not len(self.getActiveObjectQueue()) and self.checkForDedicatedOperators():
self.requestAllocation()
except:
pass
return activeEntity
示例11: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeObject=self.getActiveObject()
activeEntity=CoreObject.removeEntity(self, entity) #run the default method
return activeEntity
示例12: removeEntity
# 需要导入模块: from CoreObject import CoreObject [as 别名]
# 或者: from CoreObject.CoreObject import removeEntity [as 别名]
def removeEntity(self, entity=None):
activeEntity=CoreObject.removeEntity(self, entity) #run the default method
self.waitToDispose=False
return activeEntity #the object does not wait to dispose now