def _BPCmaterialsCalculator(self, requiredRuns, blueprintItem): """determine modified manufacturing cost for N runs of one BPC""" baseCost = StaticData.baseManufacturingCost(blueprintItem.typeID) modMats = {} materialModifier = self._materialModifier(blueprintItem) for matID in baseCost: modmat = int( max( requiredRuns, math.ceil( round( baseCost[matID] * requiredRuns * materialModifier, 2) + 0.01))) modMats[matID] = modmat return modMats
def _componentsMaterialsCalculator(self, requiredRuns, BPO): """calculate materials required by components bpo""" baseCost = StaticData.baseManufacturingCost(BPO.typeID) modMats = {} materialModifier = self._materialModifier(BPO) for matID in baseCost: modmat = int( max( requiredRuns, math.ceil( round( baseCost[matID] * requiredRuns * materialModifier, 2) + 0.01))) modMats[matID] = modmat return modMats
def calculate(self): """""" totMats = {} ratios = self.calcVolumeRatio() BPOList = open("allBPOs.txt") for i in BPOList: i = i.strip() CopySize, manufSize, minMarketSize = StaticData.marketSize( StaticData.idName(i)) a = StaticData.baseManufacturingCost(StaticData.idName(i)) for mat in a: if mat in totMats: totMats[mat] += a[mat] * manufSize * ratios[ StaticData.idName(i)] else: totMats[mat] = a[mat] * manufSize * ratios[ StaticData.idName(i)] return totMats