time | Calls | line |
---|
| | 1 | function cellarayoftables = getneighborsof(Table, row)
|
| | 2 | %UNTITLED6 Summary of this function goes here
|
| | 3 | % Detailed explanation goes here
|
| | 4 |
|
| | 5 | % returns a cellarray of tables with swapped rows for the row with most
|
| | 6 | % cost.
|
| | 7 |
|
< 0.001 | 2 | 8 | rowmostcost = row;
|
| | 9 |
|
| | 10 | %mostcost = getmostcost(Table)
|
| | 11 |
|
| | 12 |
|
| | 13 | %todo: preallocate memory of cell
|
| | 14 |
|
< 0.001 | 2 | 15 | cellarayoftables = {};
|
| | 16 |
|
< 0.001 | 2 | 17 | for row = 1:height(Table)
|
< 0.001 | 360 | 18 | newTable = Table;
|
| | 19 | %skip the row with the most rowcost
|
| | 20 | %if conditions to check if we only swap same TTK(n) course
|
| | 21 |
|
0.075 | 360 | 22 | if (Table{row, 6} == Table{rowmostcost, 6})
|
| | 23 | %swap
|
0.076 | 184 | 24 | newTable(rowmostcost, 4:6) = Table(row, 4:6);
|
0.073 | 184 | 25 | newTable(row, 4:6) = Table(rowmostcost, 4:6);
|
| | 26 |
|
< 0.001 | 184 | 27 | cellarayoftables{end + 1} = newTable;
|
< 0.001 | 360 | 28 | end
|
< 0.001 | 360 | 29 | end
|
| | 30 |
|
< 0.001 | 2 | 31 | end
|
Other subfunctions in this file are not included in this listing.