currentStep attribute is used to update activeEntity and currentOperator schedule (task_id)

parent 50915cea
......@@ -60,12 +60,16 @@ class MachineJobShop(Machine):
self.stpRng=RandomNumberGenerator(self, setupTime)
# check if there is a need for manual processing
self.checkForManualOperation(type='Setup',entity=activeEntity)
# if there is currentOperator then update the taskId of corresponding step of their schedule according to the task_id of the first remaining route step
if self.currentOperator:
taskId = activeEntity.remainingRoute[0].get("task_id", None)
if taskId:
self.currentOperator.schedule[-1]["task_id"] = taskId
activeEntity.currentStep = activeEntity.remainingRoute.pop(0) #remove data from the remaining route of the entity
if activeEntity.currentStep:
# update the task_id of the currentStep dict within the schedule
try:
activeEntity.schedule[-1]["task_id"] = activeEntity.currentStep["task_id"]
# if there is currentOperator then update the taskId of corresponding step of their schedule according to the task_id of the currentStep
if self.currentOperator:
self.currentOperator.schedule[-1]["task_id"] = activeEntity.currentStep["task_id"]
except KeyError:
pass
return activeEntity
#===========================================================================
......
......@@ -106,6 +106,13 @@ class QueueJobShop(Queue):
def getEntity(self):
activeEntity=Queue.getEntity(self)
activeEntity.currentStep = activeEntity.remainingRoute.pop(0) #remove data from the remaining route of the entity
# update the task_id of the current schedule step dict
# find the currentStep within the entity's route
if activeEntity.currentStep:
try:
activeEntity.schedule[-1]["task_id"] = activeEntity.currentStep["task_id"]
except KeyError:
pass
return activeEntity
#===========================================================================
......
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