コード例 #1
0
 def __init__(self, id, name=None, nextCapacityStationBufferId=None, **kw):
     Exit.__init__(self, id, name)
     self.isLocked = True
     self.nextCapacityStationBufferId = nextCapacityStationBufferId  # the id of the next station. If it is None it
     # means it is the end of the system.
     self.nextCapacityStationBuffer = None  # the next buffer. If it is None it
     from dream.simulation.Globals import G
     if hasattr(G, 'CapacityStationExitList'):
         G.CapacityStationExitList.append(self)
     else:
         G.CapacityStationExitList = []
         G.CapacityStationExitList.append(self)
コード例 #2
0
 def __init__(self, id, name=None, nextCapacityStationBufferId=None,**kw):
     Exit.__init__(self, id, name)
     self.isLocked=True
     self.nextCapacityStationBufferId=nextCapacityStationBufferId    # the id of the next station. If it is None it 
                                                                     # means it is the end of the system.
     self.nextCapacityStationBuffer=None                             # the next buffer. If it is None it
     from dream.simulation.Globals import G
     if hasattr(G, 'CapacityStationExitList'):
         G.CapacityStationExitList.append(self)
     else:
         G.CapacityStationExitList=[]
         G.CapacityStationExitList.append(self)
コード例 #3
0
 def initialize(self):
     Exit.initialize(self)
     self.isLocked = True
     # list that contains the entities that are just obtained so that they can be
     # moved to the next buffer
     self.currentlyObtainedEntities = []
     # find the next buffer
     if self.nextCapacityStationBufferId:
         from dream.simulation.Globals import G
         # find the project that the capacity entity is part of
         for capacityStationBuffer in G.CapacityStationBufferList:
             if capacityStationBuffer.id == self.nextCapacityStationBufferId:
                 self.nextCapacityStationBuffer = capacityStationBuffer
                 break
コード例 #4
0
 def initialize(self):
     Exit.initialize(self)
     self.isLocked=True
     # list that contains the entities that are just obtained so that they can be 
     # moved to the next buffer
     self.currentlyObtainedEntities=[]
     # find the next buffer
     if self.nextCapacityStationBufferId:
         from dream.simulation.Globals import G
         # find the project that the capacity entity is part of
         for capacityStationBuffer in G.CapacityStationBufferList:
             if capacityStationBuffer.id==self.nextCapacityStationBufferId:
                 self.nextCapacityStationBuffer=capacityStationBuffer
                 break
コード例 #5
0
 def getEntity(self):
     activeEntity=Exit.getEntity(self)
     alreadyWorkedDict=activeEntity.capacityProject.alreadyWorkedDict   
     stationId=self.giver.id
     alreadyWorkedDict[stationId]+=activeEntity.requiredCapacity
     
     
コード例 #6
0
 def getEntity(self):
     activeEntity = Exit.getEntity(self)
     alreadyWorkedDict = activeEntity.capacityProject.alreadyWorkedDict
     stationId = self.giver.id
     alreadyWorkedDict[stationId] += activeEntity.requiredCapacity
コード例 #7
0
 def outputResultsJSON(self):
     # output results only for the last exit
     if not self.nextCapacityStationBuffer:
         Exit.outputResultsJSON(self)
コード例 #8
0
 def canAccept(self, callerObject=None):
     if self.isLocked:
         return False
     return Exit.canAccept(self)
コード例 #9
0
 def outputResultsJSON(self):
     # output results only for the last exit
     if not self.nextCapacityStationBuffer:
         Exit.outputResultsJSON(self)
コード例 #10
0
 def canAccept(self, callerObject=None):
     if self.isLocked:
         return False
     return Exit.canAccept(self)