Commit 82c748bf authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

change so that scrapping mean etc can be read as float

parent 022a0ba9
......@@ -75,7 +75,7 @@ class BatchScrapMachine(Machine):
def removeEntity(self, entity=None):
activeEntity = Machine.removeEntity(self, entity)
scrapQuantity=self.scrapRng.generateNumber()
activeEntity.numberOfUnits-=scrapQuantity
activeEntity.numberOfUnits-=int(scrapQuantity) # the scrapQuantity should be integer at whatever case
if activeEntity.numberOfUnits<0:
activeEntity.numberOfUnits==0
return activeEntity
......
......@@ -356,10 +356,10 @@ def createObjects():
processingTime=element.get('processingTime',{})
scrapQuantity=element.get('scrapQuantity', {})
scrapDistributionType=scrapQuantity.get('distributionType', 'not found')
scrMean=int(scrapQuantity.get('mean') or 0)
scrMean=float(scrapQuantity.get('mean') or 0)
scrStdev=float(scrapQuantity.get('stdev') or 0)
scrMin=int(scrapQuantity.get('min') or 0)
scrMax=int(scrapQuantity.get('max') or scrMean+5*scrStdev)
scrMin=float(scrapQuantity.get('min') or 0)
scrMax=float(scrapQuantity.get('max') or scrMean+5*scrStdev)
failures=element.get('failures', {})
failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF') or 0)
......@@ -386,10 +386,10 @@ def createObjects():
processingTime=element.get('processingTime', {})
scrapQuantity=element.get('scrapQuantity', {})
scrapDistributionType=scrapQuantity.get('distributionType', 'not found')
scrMean=int(scrapQuantity.get('mean') or 0)
scrMean=float(scrapQuantity.get('mean') or 0)
scrStdev=float(scrapQuantity.get('stdev') or 0)
scrMin=int(scrapQuantity.get('min') or 0)
scrMax=int(scrapQuantity.get('max') or scrMean+5*scrStdev)
scrMin=float(scrapQuantity.get('min') or 0)
scrMax=float(scrapQuantity.get('max') or scrMean+5*scrStdev)
failures=element.get('failures', {})
failureDistribution=failures.get('distributionType', 'not found')
MTTF=float(failures.get('MTTF') or 0)
......
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