Commit a7ef9db3 authored by Georgios Dagkakis's avatar Georgios Dagkakis

changes so that the initial wip processing time may have different distribution than the others

parent 3daaafdc
......@@ -689,6 +689,14 @@ class CoreObject(object):
# calculates the processing time
# =======================================================================
def calculateProcessingTime(self):
# this is only for processing of the initial wip
if self.isProcessingInitialWIP:
activeEntity=self.getActiveObjectQueue()[0]
if activeEntity.remainingProcessingTime:
remainingProcessingTime=activeEntity.remainingProcessingTime
from RandomNumberGenerator import RandomNumberGenerator
initialWIPrng=RandomNumberGenerator(self, **remainingProcessingTime)
return initialWIPrng.generateNumber()
return self.rng.generateNumber() # this is if we have a default processing time for all the entities
# =======================================================================
......
......@@ -1155,6 +1155,7 @@ def createWIP():
G.WipList.append(P)
G.EntityList.append(P)
object=Globals.findObjectById(element['id'])
P.remainingProcessingTime=entity.get('remainingProcessingTime', {})
P.currentStation=object
elif entityClass=='Dream.Batch':
......@@ -1166,6 +1167,7 @@ def createWIP():
G.WipList.append(B)
G.EntityList.append(B)
object=Globals.findObjectById(element['id'])
B.remainingProcessingTime=entity.get('remainingProcessingTime', {})
B.currentStation=object
elif entityClass=='Dream.SubBatch':
......@@ -1177,9 +1179,9 @@ def createWIP():
# check if the parent batch is already created. If not, then create it
batch=None
for entity in G.BatchList:
if entity.id==parentBatchId:
batch=entity
for b in G.BatchList:
if b.id==parentBatchId:
batch=b
if batch: #if the parent batch was found add the number of units of current sub-batch
batch.numberOfUnits+=numberOfUnits
else: #if the parent batch was not found create it
......@@ -1193,6 +1195,7 @@ def createWIP():
G.WipList.append(SB)
G.EntityList.append(SB)
object=Globals.findObjectById(element['id'])
SB.remainingProcessingTime=entity.get('remainingProcessingTime', {})
SB.currentStation=object
if entityClass=='Dream.Order':
......
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