Commit ca0c2bd3 authored by Georgios Dagkakis's avatar Georgios Dagkakis

demand planning general input to be read accordingly

parent 7fc955bb
...@@ -44,48 +44,35 @@ def my_split(s, seps): ...@@ -44,48 +44,35 @@ def my_split(s, seps):
return res return res
def ImportInput(input, algorithmAttributes): def ImportInput(input, algorithmAttributes):
# general simulation input # general simulation input
mime_type, attachement_data = input[len('data:'):].split(';base64,', 1) mime_type, attachement_data = input[len('data:'):].split(';base64,', 1)
attachement_data = attachement_data.decode('base64') attachement_data = attachement_data.decode('base64')
wbin = xlrd.open_workbook(file_contents=attachement_data) wbin = xlrd.open_workbook(file_contents=attachement_data)
sh = wbin.sheet_by_name('Scalar_Var') G.maxEarliness = algorithmAttributes.get('maxEarliness',None)
G.maxEarliness = withoutFormat(3,1,sh,1) G.maxLateness = algorithmAttributes.get('maxLateness',None)
G.maxLateness = withoutFormat(4,1,sh,1)
# utilisation calculation # utilisation calculation
if withoutFormat(9,1,sh,1) != '': G.minDeltaUt = algorithmAttributes.get('minDelta',None)
G.minDeltaUt = withoutFormat(9,1,sh,1)
# ACO parameters # ACO parameters
if withoutFormat(12,1,sh,1) != '': G.ACO = algorithmAttributes.get('ACO',None)
G.ACO = withoutFormat(12,1,sh,1) G.popSize=algorithmAttributes.get('ACOpopulationSize',None)
if withoutFormat(13,1,sh,1) != '': G.noGen=algorithmAttributes.get('ACOnumberOfGenerations',None)
G.popSize = withoutFormat(13,1,sh,1)
if withoutFormat(14,1,sh,1) != '':
G.noGen = withoutFormat(14,1,sh,1)
# optimisation weights for forecast IP method # optimisation weights for forecast IP method
if withoutFormat(18,1,sh,1) != '': G.weightFactor[0] = algorithmAttributes.get('maxAssignedQty',None)
G.weightFactor[0] = withoutFormat(18,1,sh,1) G.weightFactor[1] = algorithmAttributes.get('minUtilisation',None)
if withoutFormat(19,1,sh,1) != '': G.weightFactor[2] = algorithmAttributes.get('minDeltaTargetUtilisation',None)
G.weightFactor[1] = withoutFormat(19,1,sh,1) G.weightFactor[3] = algorithmAttributes.get('minTargetUtilisation',None)
if withoutFormat(20,1,sh,1) != '':
G.weightFactor[2] = withoutFormat(20,1,sh,1)
if withoutFormat(21,1,sh,1) != '':
G.weightFactor[3] = withoutFormat(21,1,sh,1)
# GA parameters # GA parameters
if withoutFormat(23,1,sh,1) != '': G.GA= algorithmAttributes.get('GA',None)
G.GA = withoutFormat(23,1,sh,1) G.popSizeGA =algorithmAttributes.get('GApopulationSize',None)
if withoutFormat(24,1,sh,1) != '': G.noGenGA =algorithmAttributes.get('GAnumberOfGenerations',None)
G.popSizeGA = withoutFormat(24,1,sh,1) G.probXover =algorithmAttributes.get('XOver',None)
if withoutFormat(25,1,sh,1) != '': G.probMutation =algorithmAttributes.get('mutationProbability',None)
G.noGenGA = withoutFormat(25,1,sh,1)
if withoutFormat(26,1,sh,1) != '':
G.probXover = withoutFormat(26,1,sh,1)
if withoutFormat(27,1,sh,1) != '':
G.probMutation = withoutFormat(27,1,sh,1)
# Import capacity information...capacity = {Resource: {week {'originalCapacity':, 'remainingCapacity', 'minUtilisation'} # Import capacity information...capacity = {Resource: {week {'originalCapacity':, 'remainingCapacity', 'minUtilisation'}
sh = wbin.sheet_by_name('BN_Capa') sh = wbin.sheet_by_name('BN_Capa')
......
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