Skip to content
Snippets Groups Projects

Minor update of some of the optimisation functions

Merged Imported Achilles Kappis requested to merge TopolOptimUpdate into main
4 files
+ 14
6
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -3,7 +3,7 @@
% Author: Achilles Kappis
% e-mail: axilleaz@protonmail.com
%
% Date: 05/12/2023 (DD/MM/YYYY)
% Date: 21/11/2024 (DD/MM/YYYY)
%
% Copyright: MIT
% --------------------------------------------------
@@ -182,7 +182,7 @@ function muts = mutPop(pop, mutPerc, mutProb, mutVals, uniqueMuts)
% ====================================================
% Create probabilities for the variables to be mutated
if isscalar(mutProb)
for mutIdx = nMuts:-1:1
parfor mutIdx = 1:nMuts
if mutProb < 0
% Make sure the number of mutated variables will be exactly that asked
[~, varIdx] = maxk(rand(size(pop, 2), 1), abs(mutProb));
Loading