Commit 6180e5b3 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

ConditionalBuffer getEntity correction

parent 0d0c611c
...@@ -56,34 +56,16 @@ class ConditionalBuffer(QueueJobShop): ...@@ -56,34 +56,16 @@ class ConditionalBuffer(QueueJobShop):
#=========================================================================== #===========================================================================
def getEntity(self): def getEntity(self):
activeEntity=QueueJobShop.getEntity(self) activeEntity=QueueJobShop.getEntity(self)
import Globals from Globals import G
# for all the entities in the EntityList # for all the entities in the EntityList
for entity in G.EntityList: for entity in G.EntityList:
requiredParts=entity.getRequiredParts() requiredParts=entity.getRequiredParts()
if requiredParts: if requiredParts:
# if the activeEntity is in the requierdParts of the entity # if the activeEntity is in the requierdParts of the entity
if activeEntity in requiredParts: if activeEntity in requiredParts:
# if the entity is blocked # if the entity that requires the activeEntity can proceed then signal the currentStation of the entity
if not entity.checkIfRequiredPartsReady(): if entity.checkIfRequiredPartsReady():
# concluded flag to signal that the required parts have concluded their sequence self.sendSignal(receiver=entity.currentStation, signal=entity.currentStation.canDispose)
allConcluded=False
# figure out if the all required parts have concluded their sequences
for part in requiredParts:
# if the requiredParts have concluded its sequence then the flag must be set to True
# 1. the requiredPart hasn't reached the last step sequence before the requiring entity's sequence
# 2. The requiredPart has reached the last step sequence but not yet finished its current processing
if (part.nextStepSequence()<entity.nextStepSequence()\
and part.nextStepSequence()>0)\
or (part.nextStepSequence()>=entity.currentStepSequence()\
and part.currentStepSequence() ):
allConcluded=False
break
# if all the requiredParts completed the required sequence
if allConcluded:
# signal the current station of the blocked entity requesting the parts that it can proceed
# with delivering the blocked entity
entity.currentStation.canDispose.succeed(self.env.now)
break
return activeEntity 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