pickCandidateEntitiesFrom moved to operator

parent 9da68a8d
...@@ -101,6 +101,14 @@ class Operator(ObjectResource): ...@@ -101,6 +101,14 @@ class Operator(ObjectResource):
def hasOneOption(self): def hasOneOption(self):
return len(self.candidateStations)==1 return len(self.candidateStations)==1
#=======================================================================
# findCandidateEntities method finding the candidateEntities of the operator
#=======================================================================
def pickCandidateEntitiesFrom(self, pendingEntities=[]):
if pendingEntities:
for entity in [x for x in pendingEntities if x.canProceed and x.manager==self]:
self.candidateEntities.append(entity)
# ======================================================================= # =======================================================================
# sorts the candidateEntities of the Operator according to the scheduling rule # sorts the candidateEntities of the Operator according to the scheduling rule
# TODO: find a way to sort machines or candidate entities for machines, # TODO: find a way to sort machines or candidate entities for machines,
......
...@@ -86,20 +86,6 @@ class OperatorManagedJob(Operator): ...@@ -86,20 +86,6 @@ class OperatorManagedJob(Operator):
# def isAssignedTo(self): # def isAssignedTo(self):
# return self.operatorAssignedTo # return self.operatorAssignedTo
#=======================================================================
# findCandidateEntities method finding the candidateEntities of the operator
#=======================================================================
def pickCandidateEntitiesFrom(self, pendingEntities=[]):
# print 'trying to import G'
# 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]
#=========================================================================== #===========================================================================
# check if the operator has only one station as candidate option # check if the operator has only one station as candidate option
#=========================================================================== #===========================================================================
......
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