Commit 37e0ee5c authored by Georgios Dagkakis's avatar Georgios Dagkakis

new version in ImportInput

parent aa1877e0
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
''' '''
Created on 24 Nov 2014 Created on 24 Nov 2014
@author: Anna @author: Anna
''' '''
from Globals import G from Globals import G
import xlrd import xlrd
from copy import deepcopy
def withoutFormat(row,col,sheet,integer): def withoutFormat(row,col,sheet,integer):
...@@ -181,6 +181,7 @@ def ImportInput(input, algorithmAttributes): ...@@ -181,6 +181,7 @@ def ImportInput(input, algorithmAttributes):
G.sortedOrders['order'][priority][week].append(G.orders[orderID]) G.sortedOrders['order'][priority][week].append(G.orders[orderID])
orderID += 1 orderID += 1
print 'sorted orders keys', G.sortedOrders['order'].keys()
# Import forecast # Import forecast
sh = wbin.sheet_by_name('FC_Summary') sh = wbin.sheet_by_name('FC_Summary')
rows = sh.nrows rows = sh.nrows
...@@ -238,15 +239,27 @@ def ImportInput(input, algorithmAttributes): ...@@ -238,15 +239,27 @@ def ImportInput(input, algorithmAttributes):
# set # set
for sp in G.SPlist.keys(): for sp in G.SPlist.keys():
G.globalMAAllocationIW[sp] = {}
for week in G.WeekList:
G.globalMAAllocationIW[sp][week] = {'order':{}, 'forecast':{}}
for priority in G.priorityList['order']:
G.globalMAAllocationIW[sp][week]['order'][priority] = 0
for priority in G.priorityList['forecast']:
G.globalMAAllocationIW[sp][week]['forecast'][priority] = 0
for ma in G.SPlist[sp]: for ma in G.SPlist[sp]:
G.globalMAAllocation[ma] = {} G.globalMAAllocation[ma] = {}
G.globalMAAllocationIW[ma] = {}
for week in G.WeekList: for week in G.WeekList:
G.globalMAAllocation[ma][week] = {'order':{}} G.globalMAAllocation[ma][week] = {'order':{}}
G.globalMAAllocationIW[ma][week] = {'order':{}}
for priority in G.priorityList['order']: for priority in G.priorityList['order']:
G.globalMAAllocation[ma][week]['order'][priority] = 0 G.globalMAAllocation[ma][week]['order'][priority] = 0
G.globalMAAllocationIW[ma][week]['order'][priority] = 0
G.globalMAAllocation[ma][week]['forecast'] = {} G.globalMAAllocation[ma][week]['forecast'] = {}
G.globalMAAllocationIW[ma][week]['forecast'] = {}
for priority in G.priorityList['forecast']: for priority in G.priorityList['forecast']:
G.globalMAAllocation[ma][week]['forecast'][priority] = 0 G.globalMAAllocation[ma][week]['forecast'][priority] = 0
G.globalMAAllocationIW[ma][week]['forecast'][priority] = 0
# set lateness and earliness results # set lateness and earliness results
for week in G.WeekList: for week in G.WeekList:
...@@ -263,17 +276,9 @@ def ImportInput(input, algorithmAttributes): ...@@ -263,17 +276,9 @@ def ImportInput(input, algorithmAttributes):
for week in G.WeekList: for week in G.WeekList:
G.Excess[sp][week] = 0 G.Excess[sp][week] = 0
G.ordersOrig = deepcopy(G.orders)
G.sortedOrdersOrig = deepcopy(G.sortedOrders)
if __name__ == '__main__': if __name__ == '__main__':
ImportInput() ImportInput()
\ No newline at end of file
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