new functionality introduced to OperatorRouter, not fully integrated yet

parent 92170001
......@@ -276,8 +276,10 @@ class CoreObject(Process):
# the hot flag should not be raised
if successorsAreMachines:
activeEntity.hot = True
#=======================================================================
# # TESTING
# print now(), activeEntity.id, "got into "+self.id
#=======================================================================
# update wipStatList
if self.gatherWipStat:
self.wipStatList.append([now(), len(activeObjectQueue)])
......
......@@ -69,8 +69,10 @@ class Broker(ObjectInterruption):
# set the available resource as the currentOperator
self.victim.currentOperator=self.victim.operatorPool.findAvailableOperator()
yield request,self,self.victim.operatorPool.getResource(self.victim.currentOperator)
#===============================================================
# # TESTING
# print now(), self.victim.currentOperator.objName, 'started work in ', self.victim.id
#===============================================================
# self.victim.totalTimeWaitingForOperator+=now()-self.timeWaitForOperatorStarted
# clear the timeWaitForOperatorStarted variable
self.timeWaitForOperatorStarted = 0
......
......@@ -89,6 +89,17 @@ class Router(ObjectInterruption):
# print ' ', operator.id
#===================================================================
# tailored for MachineManagedJob case
candidateOperators=[]
if len(G.pendingEntities):
for entity in G.pendingEntities:
if entity.manager:
if entity.hot and entity.manager.checkIfResourceIsAvailable():
candidateOperators.append(entity.manager)
''' all the pendingEntities that are hot should be examined if they can proceed to the
step of their route as they may not be first in the activeQueue of their currentStations (QueueManagedJob).
'''
# for all the called operators find those available
# sort the objects for each one of them
# and assign the operator to those with the highest priority
......@@ -125,21 +136,6 @@ class Router(ObjectInterruption):
# and if the priorityObject is indeed pending
if priorityObject in self.pendingObjects:
# # find the giver of the priorityObject, assign its exit
# # update the operators list of its operatorPool
# # read its load time (readLoadTime)
# # and identify the entity to get
# # if the priorityObject has entities to get
# if priorityObject.entitiesToGet:
# # if the entitiesToGet have a defined manager
# if priorityObject.entitiesToGet[0].manager:
# priorityObject.giver.assignExit()
# print ' ',priorityObject.giver.exitIsAssigned()
# priorityObject.entityToGet=priorityObject.giver.getActiveObjectQueue()[0]
# print ' ',priorityObject.entityToGet.id
# priorityObject.operatorPool.operators=[priorityObject.giver.getActiveObjectQueue()[0].manager]
# priorityObject.readLoadTime()
# assign an operator to the priorityObject
operator.operatorAssignedTo=priorityObject
#=======================================================
......
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