Commit 9f4fdc96 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

ConditionalBuffer sortEntities clean-up

parent 20e5ba07
......@@ -96,24 +96,13 @@ class ConditionalBuffer(QueueJobShop):
# =======================================================================
def sortEntities(self):
activeObject = self.getActiveObject()
# (run the default behaviour - loan from Queue)
# if we have sorting according to multiple criteria we have to call the sorter many times
if self.schedulingRule=="MC":
for criterion in reversed(self.multipleCriterionList):
self.activeQSorter(criterion=criterion)
#else we just use the default scheduling rule
else:
self.activeQSorter()
# perform the default sorting
QueueJobShop.sortEntities(activeObject)
# and in the end sort according to the ConditionalBuffer sorting rule
activeObjectQueue = activeObject.getActiveObjectQueue()
# for every entity in the activeObjectQueue
for entity in activeObjectQueue:
# check if the requiredParts (if any) have concluded the steps with sequence smaller
# than the sequence of the entity next step
entity.mayProceed=entity.checkIfRequiredPartsReady()
activeObjectQueue.sort(key=lambda x: x.mayProceed, reverse=True)
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