Commit 93b606e8 authored by Georgios Dagkakis's avatar Georgios Dagkakis

port to new version of demand planned

parent 375387dc
...@@ -77,6 +77,9 @@ def AllocManagement_Hybrid2(): ...@@ -77,6 +77,9 @@ def AllocManagement_Hybrid2():
if week in G.sortedOrders['order'][priority]: if week in G.sortedOrders['order'][priority]:
print 'order week', week print 'order week', week
if G.ACO: if G.ACO:
if G.ACOdefault:
G.popSize = int(0.75*len(G.sortedOrders['order'][priority][week]) - 0.75*len(G.sortedOrders['order'][priority][week])%2)
G.noGen = 20*G.popSize
ACOresults = Allocation_ACO(week, G.sortedOrders['order'][priority][week],'order',ACOresults) ACOresults = Allocation_ACO(week, G.sortedOrders['order'][priority][week],'order',ACOresults)
else: else:
AllocationRoutine2(week, G.sortedOrders['order'][priority][week],'order') AllocationRoutine2(week, G.sortedOrders['order'][priority][week],'order')
...@@ -99,6 +102,10 @@ def AllocManagement_Hybrid2(): ...@@ -99,6 +102,10 @@ def AllocManagement_Hybrid2():
# if GA is required perform order sequence optimisation combined with internal LP optimisation # if GA is required perform order sequence optimisation combined with internal LP optimisation
if G.GA: if G.GA:
if G.GAdefault:
G.popSizeGA = int(0.75*len(G.sortedOrders['forecast'][priority][week]) - 0.75*len(G.sortedOrders['forecast'][priority][week])%2)
G.noGenGA = 20*G.popSizeGA
GAresults = Allocation_GA(week,itemList,'forecast',GAresults) GAresults = Allocation_GA(week,itemList,'forecast',GAresults)
# if GA is not require perform allocation with internal LP optimisation # if GA is not require perform allocation with internal LP optimisation
......
...@@ -46,13 +46,14 @@ class G: ...@@ -46,13 +46,14 @@ class G:
Earliness = {} Earliness = {}
Lateness = {} Lateness = {}
Excess = {} Excess = {}
weightFactor = [10.0,1.0,0,2] weightFactor = [10.0,1.0,0,2,0.5]
Utilisation={} Utilisation={}
# ACO parameters # ACO parameters
ACO = 1 ACO = 1
noGen = 5 noGen = 5
popSize = 10 popSize = 10
ACOdefault = 0
# GA parameters # GA parameters
GA = 0 # suggests whether application of GA to forecast diseggragation is required GA = 0 # suggests whether application of GA to forecast diseggragation is required
...@@ -62,6 +63,7 @@ class G: ...@@ -62,6 +63,7 @@ class G:
probMutation = 0.1 probMutation = 0.1
elitistSelection = 1 elitistSelection = 1
terminationGA = 4 terminationGA = 4
GAdefault = 0
# utilisation calculation # utilisation calculation
minDeltaUt = 0 minDeltaUt = 0
......
...@@ -57,6 +57,8 @@ def ImportInput(input, algorithmAttributes): ...@@ -57,6 +57,8 @@ def ImportInput(input, algorithmAttributes):
# ACO parameters # ACO parameters
G.ACO = algorithmAttributes.get('ACO',None) G.ACO = algorithmAttributes.get('ACO',None)
G.popSize=algorithmAttributes.get('ACOpopulationSize',None) G.popSize=algorithmAttributes.get('ACOpopulationSize',None)
if (not G.popSize) and G.ACO:
G.ACOdefault = 1
G.noGen=algorithmAttributes.get('ACOnumberOfGenerations',None) G.noGen=algorithmAttributes.get('ACOnumberOfGenerations',None)
# optimisation weights for forecast IP method # optimisation weights for forecast IP method
...@@ -64,12 +66,13 @@ def ImportInput(input, algorithmAttributes): ...@@ -64,12 +66,13 @@ def ImportInput(input, algorithmAttributes):
G.weightFactor[1] = algorithmAttributes.get('minUtilisation',None) G.weightFactor[1] = algorithmAttributes.get('minUtilisation',None)
G.weightFactor[2] = algorithmAttributes.get('minDeltaTargetUtilisation',None) G.weightFactor[2] = algorithmAttributes.get('minDeltaTargetUtilisation',None)
G.weightFactor[3] = algorithmAttributes.get('minTargetUtilisation',None) G.weightFactor[3] = algorithmAttributes.get('minTargetUtilisation',None)
G.weightFactor[4] = algorithmAttributes.get('MAProportionality',None)
# GA parameters # GA parameters
G.GA= algorithmAttributes.get('GA',None) G.GA= algorithmAttributes.get('GA',None)
G.popSizeGA =algorithmAttributes.get('GApopulationSize',None) G.popSizeGA =algorithmAttributes.get('GApopulationSize',None)
if (not G.popSizeGA) and G.GA:
G.GAdefault = 1
G.noGenGA =algorithmAttributes.get('GAnumberOfGenerations',None) G.noGenGA =algorithmAttributes.get('GAnumberOfGenerations',None)
G.probXover =algorithmAttributes.get('XOver',None) G.probXover =algorithmAttributes.get('XOver',None)
G.probMutation =algorithmAttributes.get('mutationProbability',None) G.probMutation =algorithmAttributes.get('mutationProbability',None)
......
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