Skip to content

Fix dimension broadcasting issue in particle random reset mechanism #1

@424635328

Description

@424635328

Hi @aliasgharheidaricom , thank you for sharing the code for FATA.

While studying the implementation, I noticed a potential issue in the particle reset mechanism (Line [89] in FATA.m).

The Issue:
The current code uses:

Flight(i,:) = (ub-lb).*rand+lb;

In MATLAB, rand returns a scalar. This causes the same random value to be broadcasted to all dimensions of Flight(i,:). As a result, the particle updates identically across all dimensions (moving diagonally), which severely restricts the exploration capability of the algorithm.

We can observe it from a two-dimensional perspective

case

snap1 (x=y)

Suggested Fix:
It should likely generate a random vector matching the dimension size:

Flight(i,:) = (ub-lb).*rand(1,dim)+lb;
case

snap2 (random)

Verification:
I tested both versions. The original code generates correlated coordinates, while the fixed version ensures independent randomization for each dimension.

Thanks again for your great work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions