README
- Generates random
numScores,partners,adjMatrix,itemWidths,allItems(numbering each item)
- Creates
populationof solutions, one usingFFD, the rest usingFFR
- Straight swap, no moveType
stripX= 2 items andstripY= 2 items
- moveType = 11
stripX= 2 items andstripY> 2 items, c and d adjacent
- moveType = 0
stripX= 2 items andstripY> 2 items, c and d not adjacent
- moveType = 12
stripY= 2 items andstripX> 2 items, a and b adjacent
- moveType = 0
stripY= 2 items andstripX> 2 items, a and b not adjacent
- moveType = 0;
stripX> 2 items andstripY> 2 items
- Straight swap, no moveType
stripX= 2 items andstripY= 1 item
- moveType = 21
stripX= 2 items andstripY> 1 item
- moveType = 22
stripY= 1 item andstripX> 2 items, a and b adjacent
- moveType = 0
stripY= 1 item andstripX> 2 items, a and b not adjacent
- moveType = 0;
stripX> 2 items andstripY> 1 item
- Straight swap, no moveType
stripX= 1 item andstripY= 1 item
- moveType = 31
stripX= 1 item andstripY> 1 item
- moveType = 32
stripY= 1 item andstripX> 1 item
- moveType = 0
stripX> 1 item andstripY> 1 item
- moveType = 41
stripY= 1 item
- moveType = 42
stripY= 2 items
- moveType = 0
stripY> 2 items
- Choose two solutions from
population, these will be parents (parent1=stripXandparent2=stripY) - Calculate fitness of each of these parent solutions (
parent1Costandparent2CostusingFitnessfunction) - Run
GGA/GPX - Go through strips in
offspring, find strips that have best fullness, add these toqualityStrips - Calculate fitness of
offspring(offspringCostusingFitnessfunction) - If
parent1has worst fitness, removeparent1from population and replace withoffspring - Else if
parent2has worst fitness, removeparent2from population and replace withoffspring - Else if
parent1andparent2have equal fitness, choose at random. - If fitness of
offspringis better thanbestFitness(current best fitness of a solution in the population), setbestFitness=offspringCost - End
EA
- Choose two strips
kandlfromstripYrandomly - Mark all items in strips between
kandl(includingkandl) aschecked - Go through
stripX, if a strip contains an item that is checked, delete entire strip fromstripX - Put strips between
kandl(includingkandl) fromstripYintostripX - Go through
stripX, mark all items aschecked - If all items are in
stripX,offspring = stripX, return toEAfunction. - If any items are not in
stripX(i.e.checked == 0), put these items inabsentItems - Clear
stripY, runPartialFFDonabsentItemsandstripY, then runLocalSearchusingstripXandstripY, return toEAfunction.
- Choose fullest strip out of all strips in
stripXandstripY(e.g. fullest strip is instripX) - Mark items in fullest strip as
checked, put this strip inoffspring, erase this strip from stripX` - Go through all strips in
stripY, if there is a strip that contains a marked item, delete entire strip fromstripY - Now go to
stripYand choose fullest strip - Repeat, alternate between
stripXandstripY - If all items are in
offspring, do nothing (i.e.absentItemsvector is empty), return toEAfunction - If any items are not in
offspring(i.e.checked == 0), put these items inabsentItems stripX = offspring, clearoffspring, clearstripY, runPartialFFDonabsentItemsandstripY, then runLocalSearchusingstripXandstripY, return toEAfunction.