Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnebro committed Dec 5, 2024
1 parent 4c068dc commit 9ca33c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions examples/MOEADAsAnEvolutionaryAlgorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ function main()
solver::EvolutionaryAlgorithm = EvolutionaryAlgorithm()
solver.name = "MOEA/D"

populationSize = 91
populationSize = 100
neighborhoodSize = 20
offspringPopulationSize = 1
maximumNumberOfReplacedSolutions = 2
normalizeObjectives = false
normalizeObjectives = true

solver.solutionsCreation = DefaultSolutionsCreation(problem, populationSize)
solver.evaluation = SequentialEvaluation(problem)
Expand All @@ -32,10 +32,12 @@ function main()
neighborhood = WeightVectorNeighborhood(populationSize, neighborhoodSize)

sequenceGenerator = IntegerPermutationGenerator(populationSize)

solver.selection = PopulationAndNeighborhoodSelection(solver.variation.matingPoolSize, sequenceGenerator, neighborhood, 0.9, true)

aggregationFunction = PenaltyBoundaryIntersection(5.0, false)
selectCurrentSolution = true
solver.selection = PopulationAndNeighborhoodSelection(solver.variation.matingPoolSize, sequenceGenerator, neighborhood, 0.9, selectCurrentSolution)

aggregationFunction = PenaltyBoundaryIntersection(5.0, normalizeObjectives)
#aggregationFunction = Tschebyscheff()

solver.replacement = MOEADReplacement(solver.selection, neighborhood, aggregationFunction, sequenceGenerator, maximumNumberOfReplacedSolutions, normalizeObjectives)

Expand Down
2 changes: 1 addition & 1 deletion examples/NSGAIIAsAnEvolutionaryAlgorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ function main()

println("Variables stored in file ", variablesFileName)
printVariablesToCSVFile(variablesFileName, foundSolutions)
end
end

0 comments on commit 9ca33c9

Please sign in to comment.