Open electronsandstuff opened 1 year ago
Another note on the issue: I also get a similar problem when evaluating REMO on ZDT2 with the same settings. It looks like it uses the same function LastSelection
.
Just a quick update on this problem.
I was able to track it down to the following lines of code in CSEA/RadarGrid.m
.
[N,M] = size(P);
%% Calculate the radar coordinate of each solution
theta = 0 : 2*pi/M : 2*pi/M*(M-1);
RLoc(:,1) = sum(P.*repmat(cos(theta),N,1),2)./sum(P,2);
RLoc(:,2) = sum(P.*repmat(sin(theta),N,1),2)./sum(P,2); % Note: Should be zero for two objective problem.
RLoc = (RLoc+1)/2;
YL = min(RLoc,[],1); % Lower bounary of the transferred points
YU = max(RLoc,[],1); % Upper bounary of the transferred points
NRLoc = (RLoc-repmat(YL,N,1))./repmat(YU-YL,N,1); % Normalized points
For a two objective problem, the values of theta
are 0 and pi. This makes the value of RLoc(:,2)
0.5 for the whole population. Then, when RLoc
is normalized by its minimum and maximum values you get a divide by zero on the last line. This propagates through the algorithm and results in the indexing issue later. It looks like the reason it wasn't failing on other two objective problems was only because of numerical error in calculating RLoc. The same problem exists in REMO/RefSelect.m
.
I don't know if anyone can offer advice on solving the issue. I could add some some small value to the normalization code to prevent it from dividing by zero (ie (RLoc-repmat(YL,N,1))./repmat(YU-YL+epsilon,N,1)
), however I am not sure if that changes the function of the code or not.
Hey folks, I am running into some errors evaluating CSEA on ZDT2. Here are the specific settings:
Probably one out of every ten runs I get the error:
I was able to print the indices in temp and the result was access at index zero: