Induviduals dissapearing after some iterations using GA algorithm and parsim.

3 views (last 30 days)
Hi!
When using the built in GA algorithm optimising on a simulink model using parsim the number of simulations ran each iterations seem to reduce by two after one or two iterations. What can the explaination be for this.
options2 = optimoptions('ga',...
'Display','diagnose',...
'MaxTime',5000,...
'MaxStallGenerations',10,...
'PopulationSize',population,...
'MaxGenerations',10,...
'FunctionTolerance',0.001,...
'UseVectorized',true,...
'PlotFcn',{@gaplotbestf,@gaplotstopping, @gaplotbestindiv});
x = ga(@CostFunction3,nvars,A,B,[],[],lb,ub,[],options2);
In function
results = parsim(SimIn,'TransferBaseWorkspaceVariables','on','ShowProgress','on','UseFastRestart','on','StopOnError','on');
I thought as long as I dont use non linear constraint i would get as many simulation runs as population size. In this case the population was 40, but already on the second iteration I got only 38 simulation runs.
Thanks!

Answers (1)

Sugandhi
Sugandhi on 23 Aug 2023
Hi Jesper Ramsberg,
I understand that when you are using the built in GA algorithm optimising on a Simulink model using parsim, individuals disappearing after some iterations.
Few of the possible workarounds could be:
  1. Check the Simulink model and ensure that it is configured correctly, without any errors or issues that could cause simulations to fail.
  2. Review the output and error messages from the parsim function to identify any specific simulation failures or errors that may be occurring.
  3. Verify the constraints in your optimization problem and ensure that they are correctly defined and feasible for the given parameter bounds.
  4. Monitor the parallel computing environment and check if there are any limitations or resource constraints that could affect the number of available workers.

Categories

Find more on Manual Performance Optimization in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!