Commit d0d2bc9c authored by Georgios Dagkakis's avatar Georgios Dagkakis

Router to consider if the shift of operators have been changed

parent b8ba7eca
...@@ -164,7 +164,7 @@ class SkilledRouter(Router): ...@@ -164,7 +164,7 @@ class SkilledRouter(Router):
LPFlag=True LPFlag=True
if self.checkCondition: if self.checkCondition:
LPFlag=self.checkIfAllocationShouldBeCalled() LPFlag=self.checkIfAllocationShouldBeCalled()
# in case there are not available stations or operators there is no need to call the LP # in case there are not available stations or operators there is no need to call the LP
if (not self.availableStationsDict) or (not self.availableOperatorList): if (not self.availableStationsDict) or (not self.availableOperatorList):
LPFlag=False LPFlag=False
...@@ -324,6 +324,10 @@ class SkilledRouter(Router): ...@@ -324,6 +324,10 @@ class SkilledRouter(Router):
def checkIfAllocationShouldBeCalled(self): def checkIfAllocationShouldBeCalled(self):
from Globals import G from Globals import G
# loop through the operators. If for one the shift ended or started right now allocation is needed
for operator in G.OperatorsList:
if operator.timeLastShiftEnded==self.env.now or operator.timeLastShiftStarted==self.env.now:
return True
# loop through the machines # loop through the machines
for machine in G.MachineList: for machine in G.MachineList:
# if one machine is starved more than 30 then allocation is needed # if one machine is starved more than 30 then allocation is needed
......
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