Opened 7 months ago

Closed 4 months ago

#2748 closed defect (obsolete)

PSO doesn't update the PersonalBest

Reported by: abeham Owned by: abeham
Priority: medium Milestone:
Component: Algorithms.ParticleSwarmOptimization Version: 3.3.14
Keywords: Cc:

Description

It can be seen in the DebugEngine that the personal best solution is never updated, but the PersonalBestQuality is.

The culprit is probably line 318 in the RealVectorSwarmUpdater. The line only sets the solution in the array that is extracted from the scopes. But the change is not written back into the scopes.

Attachments (1)

RealVectorSwarmUpdater.cs.patch (9.9 KB) - added by abeham 7 months ago.

Download all attachments as: .zip

Change History (11)

Changed 7 months ago by abeham

comment:1 Changed 7 months ago by abeham

I created a patch that fixes the operator. But actually, we'd have to up the version number of the real vector encoding plugin to 3.4 since PSO behavior has changed significantly.

The observed algorithm behavior is now much more consistent and understandable.

comment:2 Changed 7 months ago by abeham

  • Owner set to architects
  • Status changed from new to assigned

comment:3 Changed 4 months ago by abeham

  • Owner changed from architects to abeham
  • Status changed from assigned to accepted

In agreement with maffenze it was decided to break backwards-compatibility and instead fix PSO.

comment:4 Changed 4 months ago by abeham

  • Owner changed from abeham to pfleck
  • Status changed from accepted to reviewing

r15071: fixed personal best tracking in RealVectorSwarmUpdater

comment:5 Changed 4 months ago by pfleck

  • Owner changed from pfleck to abeham
  • Status changed from reviewing to assigned

reviewed r15071:

Changes look good.

I am just not sure about one thing: If the PersonalBest (old line 318) was not correctly updated in the scope, the same issue should also be true for the PersonalBestQuality (line 317). I think, the PersonalBestQuality should also be updated in the same way the PersonalBest was (new line 273).

comment:6 Changed 4 months ago by abeham

  • Status changed from assigned to reviewing

comment:7 Changed 4 months ago by abeham

  • Status changed from reviewing to readytorelease

I am just not sure about one thing: If the PersonalBest (old line 318) was not correctly updated in the scope, the same issue should also be true for the PersonalBestQuality (line 317). I think, the PersonalBestQuality should also be updated in the same way the PersonalBest was (new line 273).

As discussed: PersonalBestQuality is a DoubleValue and only the Value property of it is modified which is okay as the DoubleValue reference is the same in the scope as well as in the method the change gets propagated to the scope. On the other hand, the real vector is not correctly updated because the index in the array is replaced by a whole new real vector and that array is not synchronized with the scopes.

comment:8 Changed 4 months ago by abeham

r15076: fixed unit test

comment:9 Changed 4 months ago by abeham

  • Status changed from readytorelease to assigned

comment:10 Changed 4 months ago by abeham

  • Milestone HeuristicLab 3.3.15 deleted
  • Resolution set to obsolete
  • Status changed from assigned to closed

The change (and many more) are covered in #2797 in a manner that retains backwards compatibility (which this ticket alone would break).

Note: See TracTickets for help on using tickets.