Commit 7f4afb3c authored by Georgios Dagkakis's avatar Georgios Dagkakis

demand planning to keep the results for utilization graph

parent 19ecf7d2
......@@ -14,4 +14,8 @@ class PostProcessDemandPlanning(plugin.OutputPreparationPlugin):
'mime_type': 'application/vnd.ms-excel',
'data': G.reportResults.xlsx.encode('base64')
}
import json
utilisationString=json.dumps(G.Utilisation, indent=5)
outputJSONFile=open('Utilisation.json', mode='w')
outputJSONFile.write(utilisationString)
return data
......@@ -47,6 +47,7 @@ class G:
Lateness = {}
Excess = {}
weightFactor = [10.0,1.0,0,2]
Utilisation={}
# ACO parameters
ACO = 1
......
......@@ -40,7 +40,17 @@ def outputResults():
G.CapacityResults.append([bottleneck, 'Capa Pegging Resource Capacity (UoM)',]+initialCap)
G.CapacityResults.append(['', 'Capa Pegging Resource Total Load (UoM)',]+[G.Capacity[bottleneck][week]['OriginalCapacity']-G.CurrentCapacityDict[bottleneck][week] for week in G.WeekList])
G.CapacityResults.append(['', 'Capa Pegging Resource Total Util (Percent)',]+[float(G.Capacity[bottleneck][week]['OriginalCapacity']-G.CurrentCapacityDict[bottleneck][week])/G.Capacity[bottleneck][week]['OriginalCapacity']*100 for week in G.WeekList])
# utilisation results
for bottleneck in G.Bottlenecks:
G.Utilisation[bottleneck] = {}
for week in G.WeekList:
G.Utilisation[bottleneck][week] = {}
G.Utilisation[bottleneck][week]['averageUtilization'] = float(G.Capacity[bottleneck][week]['OriginalCapacity']-G.CurrentCapacityDict[bottleneck][week])/G.Capacity[bottleneck][week]['OriginalCapacity']
G.Utilisation[bottleneck][week]['minUtilization'] = G.Capacity[bottleneck][week]['minUtilisation']
G.Utilisation[bottleneck][week]['maxUtilization'] = G.Capacity[bottleneck][week]['targetUtilisation']
# report allocation results
head = ['PPOS', 'Demand_Items_Product_DCBNO - SP', 'Demand_Items_Product_DCBNO - MA', 'Demand_Type - Group', 'Priority','Values'] + G.WeekList
G.allocationResults.headers = head
......
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