findCandidateEntities of OperatorManagedJob renamed to pickCandidateEntitiesFrom

parent f2eb0a82
...@@ -89,15 +89,16 @@ class OperatorManagedJob(Operator): ...@@ -89,15 +89,16 @@ class OperatorManagedJob(Operator):
#======================================================================= #=======================================================================
# findCandidateEntities method finding the candidateEntities of the operator # findCandidateEntities method finding the candidateEntities of the operator
#======================================================================= #=======================================================================
def findCandidateEntities(self): def pickCandidateEntitiesFrom(self, pendingEntities=[]):
# print 'trying to import G' # print 'trying to import G'
from Globals import G # from Globals import G
router=G.Router # router=G.Router
if router.pending: # if router.pending:
print now(), self.id if pendingEntities:
for entity in [x for x in router.pending if x.canProceed and x.manager==self]: # print now(), self.id
for entity in [x for x in pendingEntities if x.canProceed and x.manager==self]:
self.candidateEntities.append(entity) self.candidateEntities.append(entity)
print ' ', [x.id for x in self.candidateEntities] # print ' ', [x.id for x in self.candidateEntities]
#=========================================================================== #===========================================================================
# check if the operator has only one station as candidate option # check if the operator has only one station as candidate option
......
...@@ -428,13 +428,11 @@ class Router(ObjectInterruption): ...@@ -428,13 +428,11 @@ class Router(ObjectInterruption):
#=========================================================================== #===========================================================================
def findCandidateEntities(self): def findCandidateEntities(self):
for operator in self.candidateOperators: for operator in self.candidateOperators:
# print now(), operator.id
# find which pendingEntities that can move to machines is the operator managing # find which pendingEntities that can move to machines is the operator managing
# operator.findCandidateEntities() # operator.pickCandidateEntitiesFrom(self.pending)
for entity in [x for x in self.pending if x.canProceed and x.manager==operator]: for entity in [x for x in self.pending if x.canProceed and x.manager==operator]:
operator.candidateEntities.append(entity) operator.candidateEntities.append(entity)
# print ' ', [x.id for x in operator.candidateEntities] # print ' ', [x.id for x in operator.candidateEntities]
#======================================================================= #=======================================================================
# find the schedulingRules of the candidateOperators # find the schedulingRules of the candidateOperators
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment