findCandidateEntities of OperatorManagedJob renamed to pickCandidateEntitiesFrom

parent f2eb0a82
......@@ -89,15 +89,16 @@ class OperatorManagedJob(Operator):
#=======================================================================
# findCandidateEntities method finding the candidateEntities of the operator
#=======================================================================
def findCandidateEntities(self):
def pickCandidateEntitiesFrom(self, pendingEntities=[]):
# print 'trying to import G'
from Globals import G
router=G.Router
if router.pending:
print now(), self.id
for entity in [x for x in router.pending if x.canProceed and x.manager==self]:
# from Globals import G
# router=G.Router
# if router.pending:
if pendingEntities:
# print now(), self.id
for entity in [x for x in pendingEntities if x.canProceed and x.manager==self]:
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
......
......@@ -428,14 +428,12 @@ class Router(ObjectInterruption):
#===========================================================================
def findCandidateEntities(self):
for operator in self.candidateOperators:
# print now(), operator.id
# 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]:
operator.candidateEntities.append(entity)
# print ' ', [x.id for x in operator.candidateEntities]
#=======================================================================
# 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