Skip to content

Commit

Permalink
Fix a bug in ParticleSwarmOptimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnebro committed Dec 17, 2024
1 parent eee7c85 commit d24f80f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/SMPSOWithObserver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function main()
solver = ParticleSwarmOptimization()
solver.name = "SMPSO"

problem = ZDT6()
problem = ZDT2()
swarmSize = 100

solver.solutionsCreation = DefaultSolutionsCreation(problem, swarmSize)
Expand Down Expand Up @@ -40,7 +40,7 @@ function main()
solver.velocityUpdate = ConstrainedVelocityUpdate(c1Min, c1Max, c2Min, c2Max, problem)
#solver.velocityUpdate = DefaultVelocityUpdate(c1Min, c1Max, c2Min, c2Max)

observer = FrontPlotObserver(5000, name(problem), readFrontFromCSVFile("data/referenceFronts/ZDT6.csv"))
observer = FrontPlotObserver(1000, name(problem), readFrontFromCSVFile("data/referenceFronts/ZDT2.csv"))
register!(observable(solver), observer)

optimize!(solver)
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm/particleSwarmOptimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mutable struct ParticleSwarmOptimization <: Algorithm
end
end

function getObservable(algorithm::ParticleSwarmOptimization)
function observable(algorithm::ParticleSwarmOptimization)
return algorithm.observable
end

Expand Down

0 comments on commit d24f80f

Please sign in to comment.