Feature/woa update feature #250
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
OriginalWOAto use per-dimension coefficients and a normalized progress schedule.Detailed Changes
OriginalWOA.evolvenow computes progress with(epoch - 1) / (self.epoch - 1)(safe forepoch=1), derivesa/a2from that schedule, and samplesr1/r2per dimension. This makesA/Cvectors and applies them per dimension inside the update loop, which aligns with the standard WOA formulation.OriginalWOAupdates each agent withupdate(solution, target)to keep the solution and fitness consistent.WOAmM, based on “WOA with Modified Mutualism”:X_bf, and updateXiand the worse of{Xm, Xn}using benefit factors (1–2) and random weights (scalar or vector).mutualism_snapshotto read from a snapshot while updating, avoiding in-place interference.g_bestbefore the WOA movement.A/ClikeOriginalWOA.stagnation_epochs, regenerate the worstrestart_ratiofraction of the population.boundary_mode(clip,reflect,random) usingamend_solution.WOAmM_Paper, a variant documented to follow the paper’s population replacement behavior while keeping the same two‑phase loop.New/Updated Parameters
mutualism_vector_rand: use per‑dimension random weights in mutualism updates.mutualism_snapshot: snapshot population for mutualism reads.stagnation_epochs: epochs without improvement before restart.restart_ratio: fraction of worst agents to restart on stagnation.boundary_mode:clip(default),reflect, orrandom.