Commit 87f93d8c authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

SubBatch updated so that the parent batch is hold as an attribute. This way...

SubBatch updated so that the parent batch is hold as an attribute. This way the BatchWaitingList global is no longer needed
parent 40e189e3
......@@ -126,7 +126,8 @@ class BatchDecomposition(CoreObject):
numberOfSubBatchUnits = batchNumberOfUnits//self.numberOfSubBatches+1
alreadyAllocatedUnits+=numberOfSubBatchUnits
subBatch=SubBatch(str(activeEntity.id)+'_'+str(i), activeEntity.name+"_SB_"\
+str(i), activeEntity.id, numberOfUnits=numberOfSubBatchUnits) #create the sub-batch
+str(i), numberOfUnits=numberOfSubBatchUnits,
parentBatch=activeEntity) #create the sub-batch
activeObjectQueue.append(subBatch) #append the sub-batch to the active object Queue
activeEntity.subBatchList.append(subBatch)
activeEntity.numberOfSubBatches=self.numberOfSubBatches
......
......@@ -115,12 +115,7 @@ class BatchReassembly(CoreObject):
for subBatch in activeObjectQueue:
numberOfUnits+=subBatch.numberOfUnits
batchToBeReassembled = None
for batch in G.BatchWaitingList:
if activeObjectQueue[0].batchId == batch.id:
batchToBeReassembled = batch
G.BatchWaitingList.remove(batchToBeReassembled)
batchToBeReassembled = activeObjectQueue[0].parentBatch
del activeObjectQueue[:]
batchToBeReassembled.numberOfSubBatches = 1
batchToBeReassembled.numberOfUnits=numberOfUnits
......
......@@ -31,10 +31,11 @@ from Entity import Entity
class SubBatch(Entity):
type="SubBatch"
def __init__(self, id, name, batchId, numberOfUnits=1):
def __init__(self, id, name, numberOfUnits=1, parentBatch=None):
Entity.__init__(self, name=name)
self.id=id
self.numberOfUnits=numberOfUnits
self.batchId=batchId
self.parentBatch=parentBatch
self.batchId=parentBatch.id
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