Commit 9229bd67 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

ConditionalBuffer sortEntities clean-up

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