Commit ae851e09 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Merge branch 'normalizeLastAssignment'

parents 6fd5856b bd746b47
...@@ -35,19 +35,27 @@ class BatchesACO(ACO): ...@@ -35,19 +35,27 @@ class BatchesACO(ACO):
# of options collated into a dictionary for ease of referencing in ManPy # of options collated into a dictionary for ease of referencing in ManPy
def createCollatedScenarios(self,data): def createCollatedScenarios(self,data):
collated = dict() collated = dict()
# fill sub-line deactivated (default to zero)
collated["4"]=[0.0]
weightData=data['input'].get('ACO_weights_spreadsheet', None) weightData=data['input'].get('ACO_weights_spreadsheet', None)
for i in range(1,7): for i in range(1,6):
# to deactivate fill sub-line the index of 4 is surpassed
if i<4:
index=str(i)
else:
index=str(i+1)
minValue=weightData[1][i] minValue=weightData[1][i]
maxValue=weightData[2][i] maxValue=weightData[2][i]
stepValue=weightData[3][i] stepValue=weightData[3][i]
staticValue=weightData[4][i] staticValue=weightData[4][i]
if staticValue: if staticValue:
collated[str(i)]=[float(staticValue)] collated[index]=[float(staticValue)]
else: else:
collated[str(i)]=[] collated[index]=[]
value=float(minValue) value=float(minValue)
while 1: while 1:
collated[str(i)].append(round(float(value),2)) collated[index].append(round(float(value),2))
value+=float(stepValue) value+=float(stepValue)
if value>float(maxValue): if value>float(maxValue):
break break
......
...@@ -247,10 +247,6 @@ ...@@ -247,10 +247,6 @@
"name": "Min assignment variations", "name": "Min assignment variations",
"type": "string" "type": "string"
}, },
{
"name": "Fill sub-line",
"type": "string"
},
{ {
"name": "Machines with furthest last assignment time", "name": "Machines with furthest last assignment time",
"type": "string" "type": "string"
......
...@@ -112,10 +112,6 @@ ...@@ -112,10 +112,6 @@
"name": "Min assignment variations", "name": "Min assignment variations",
"type": "string" "type": "string"
}, },
{
"name": "Fill sub-line",
"type": "string"
},
{ {
"name": "Machines with furthest last assignment time", "name": "Machines with furthest last assignment time",
"type": "string" "type": "string"
...@@ -2104,7 +2100,6 @@ ...@@ -2104,7 +2100,6 @@
"Assignment to machines with higher WIPB", "Assignment to machines with higher WIPB",
"Uniform assignment across stations", "Uniform assignment across stations",
"Min assignment variations", "Min assignment variations",
"Fill sub-line",
"Machines with furthest last assignment time", "Machines with furthest last assignment time",
"Max number of assigned PB" "Max number of assigned PB"
], ],
...@@ -2114,7 +2109,6 @@ ...@@ -2114,7 +2109,6 @@
null, null,
null, null,
null, null,
null,
null null
] ]
], ],
......
...@@ -112,10 +112,6 @@ ...@@ -112,10 +112,6 @@
"name": "Min assignment variations", "name": "Min assignment variations",
"type": "string" "type": "string"
}, },
{
"name": "Fill sub-line",
"type": "string"
},
{ {
"name": "Machines with furthest last assignment time", "name": "Machines with furthest last assignment time",
"type": "string" "type": "string"
...@@ -2140,7 +2136,6 @@ ...@@ -2140,7 +2136,6 @@
"Assignment to machines with higher WIP", "Assignment to machines with higher WIP",
"Uniform assignment across stations", "Uniform assignment across stations",
"Min assignment variations", "Min assignment variations",
"Fill sub-line",
"Machines with furthest last assignment time", "Machines with furthest last assignment time",
"Max number of assigned PB" "Max number of assigned PB"
], ],
...@@ -2149,7 +2144,6 @@ ...@@ -2149,7 +2144,6 @@
1.5, 1.5,
0.5, 0.5,
0, 0,
1,
0.5, 0.5,
0.5 0.5
], ],
...@@ -2158,7 +2152,6 @@ ...@@ -2158,7 +2152,6 @@
2.5, 2.5,
1.5, 1.5,
1, 1,
2,
1.5, 1.5,
1.5 1.5
], ],
...@@ -2168,7 +2161,6 @@ ...@@ -2168,7 +2161,6 @@
0.1, 0.1,
0.1, 0.1,
0.1, 0.1,
0.1,
0.1 0.1
], ],
[ [
...@@ -2176,7 +2168,6 @@ ...@@ -2176,7 +2168,6 @@
"1.6", "1.6",
"1.3", "1.3",
"0", "0",
"1.4",
"0.6", "0.6",
"0.7" "0.7"
], ],
...@@ -2186,7 +2177,6 @@ ...@@ -2186,7 +2177,6 @@
null, null,
null, null,
null, null,
null,
null null
] ]
], ],
......
...@@ -112,10 +112,6 @@ ...@@ -112,10 +112,6 @@
"name": "Min assignment variations", "name": "Min assignment variations",
"type": "string" "type": "string"
}, },
{
"name": "Fill sub-line",
"type": "string"
},
{ {
"name": "Machines with furthest last assignment time", "name": "Machines with furthest last assignment time",
"type": "string" "type": "string"
...@@ -2140,7 +2136,6 @@ ...@@ -2140,7 +2136,6 @@
"Assignment to machines with higher WIP", "Assignment to machines with higher WIP",
"Uniform assignment across stations", "Uniform assignment across stations",
"Min assignment variations", "Min assignment variations",
"Fill sub-line",
"Machines with furthest last assignment time", "Machines with furthest last assignment time",
"Max number of assigned PB" "Max number of assigned PB"
], ],
...@@ -2149,7 +2144,6 @@ ...@@ -2149,7 +2144,6 @@
1.5, 1.5,
0.5, 0.5,
0, 0,
1,
0.5, 0.5,
0.5 0.5
], ],
...@@ -2158,7 +2152,6 @@ ...@@ -2158,7 +2152,6 @@
2.5, 2.5,
1.5, 1.5,
1, 1,
2,
1.5, 1.5,
1.5 1.5
], ],
...@@ -2168,7 +2161,6 @@ ...@@ -2168,7 +2161,6 @@
0.1, 0.1,
0.1, 0.1,
0.1, 0.1,
0.1,
0.1 0.1
], ],
[ [
...@@ -2176,7 +2168,6 @@ ...@@ -2176,7 +2168,6 @@
"2.1", "2.1",
"1.4", "1.4",
"0.0", "0.0",
"1.3",
"1.0", "1.0",
"1.2" "1.2"
], ],
...@@ -2186,7 +2177,6 @@ ...@@ -2186,7 +2177,6 @@
null, null,
null, null,
null, null,
null,
null null
] ]
], ],
......
...@@ -112,10 +112,6 @@ ...@@ -112,10 +112,6 @@
"name": "Min assignment variations", "name": "Min assignment variations",
"type": "string" "type": "string"
}, },
{
"name": "Fill sub-line",
"type": "string"
},
{ {
"name": "Machines with furthest last assignment time", "name": "Machines with furthest last assignment time",
"type": "string" "type": "string"
...@@ -2117,7 +2113,6 @@ ...@@ -2117,7 +2113,6 @@
"Assignment to machines with higher WIP", "Assignment to machines with higher WIP",
"Uniform assignment across stations", "Uniform assignment across stations",
"Min assignment variations", "Min assignment variations",
"Fill sub-line",
"Machines with furthest last assignment time", "Machines with furthest last assignment time",
"Max number of assigned PB" "Max number of assigned PB"
], ],
...@@ -2126,7 +2121,6 @@ ...@@ -2126,7 +2121,6 @@
1.5, 1.5,
0.5, 0.5,
0, 0,
1,
0.5, 0.5,
0.5 0.5
], ],
...@@ -2135,7 +2129,6 @@ ...@@ -2135,7 +2129,6 @@
2.5, 2.5,
1.5, 1.5,
1, 1,
2,
1.5, 1.5,
1.5 1.5
], ],
...@@ -2145,7 +2138,6 @@ ...@@ -2145,7 +2138,6 @@
0.1, 0.1,
0.1, 0.1,
0.1, 0.1,
0.1,
0.1 0.1
], ],
[ [
...@@ -2153,7 +2145,6 @@ ...@@ -2153,7 +2145,6 @@
"1.6", "1.6",
"1.3", "1.3",
"0", "0",
"1.4",
"0.6", "0.6",
"0.7" "0.7"
], ],
...@@ -2163,7 +2154,6 @@ ...@@ -2163,7 +2154,6 @@
null, null,
null, null,
null, null,
null,
null null
] ]
], ],
......
...@@ -144,12 +144,24 @@ class SkilledRouter(Router): ...@@ -144,12 +144,24 @@ class SkilledRouter(Router):
# # stations of the line and their corresponding WIP # # stations of the line and their corresponding WIP
# TODO: the WIP of the stations must be normalised to the max WIP possible on that station # TODO: the WIP of the stations must be normalised to the max WIP possible on that station
#=================================================================== #===================================================================
# identify the last time that there was an assignment
maxLastAssignment=0
for record in self.solutionList:
if record:
maxLastAssignment=record["time"]
self.availableStationsDict={} self.availableStationsDict={}
for station in self.availableStations: for station in self.availableStations:
lastAssignmentTime=0 lastAssignmentTime=0
for record in self.solutionList: for record in self.solutionList:
if station.id in record["allocation"].values(): if station.id in record["allocation"].values():
lastAssignmentTime=record["time"] lastAssignmentTime=record["time"]
# normalise the lastAssignmentTime based on the maxLastAssignment.
if maxLastAssignment:
lastAssignmentTime=1.0-float(lastAssignmentTime/float(maxLastAssignment))
# it there is definition of 'technology' to group machines add this # it there is definition of 'technology' to group machines add this
if station.technology: if station.technology:
self.availableStationsDict[str(station.id)]={'stationID':station.technology,'machineID':station.id, self.availableStationsDict[str(station.id)]={'stationID':station.technology,'machineID':station.id,
......
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