Commit 3846fd2a authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Sebastien Robin

BatchReassembly class added

parent 5cea27e3
......@@ -28,17 +28,16 @@ BatchDecomposition is a Core Object that takes a batch and decomposes to sub-bat
from SimPy.Simulation import Process, Resource
from SimPy.Simulation import activate, waituntil, now, hold
import scipy.stats as stat
from Globals import G
from CoreObject import CoreObject
from RandomNumberGenerator import RandomNumberGenerator
import scipy.stats as stat
from Entity import Entity
from SubBatch import SubBatch
from Batch import Batch
from Globals import G
# ===========================================================================
# the Batch-Decomposition Object
......@@ -88,7 +87,7 @@ class BatchDecomposition(CoreObject):
while 1:
yield waituntil, self, self.canAcceptAndIsRequested #wait until the Queue can accept an entity
#and one predecessor requests it
ent=self.getEntity()
self.getEntity()
# self.outputTrace("got into "+self.objName)
......@@ -109,6 +108,7 @@ class BatchDecomposition(CoreObject):
activeObject = self.getActiveObject()
activeObjectQueue=activeObject.getActiveObjectQueue() #get the internal queue of the active core object
activeEntity = activeObjectQueue.pop()
G.BatchWaitingList.append(activeEntity) # this batch has to be reassembled by the method reassemble
numberOfSubBatchUnits = activeEntity.numberOfUnits/self.numberOfSubBatches
for i in range(self.numberOfSubBatches):
......@@ -169,7 +169,7 @@ class BatchDecomposition(CoreObject):
#if we have only one predecessor just check if there is a place available and the predecessor has an entity to dispose
if(len(activeObject.previous)==1):
return self.canAccept(self) and giverObject.haveToDispose(activeObject)
return self.canAccept() and giverObject.haveToDispose(activeObject)
isRequested=False # dummy boolean variable to check if any predecessor has something to hand in
maxTimeWaiting=0 # dummy timer to check which predecessor has been waiting the most
......
This diff is collapsed.
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