Hard constrained global optimization using SWARM.
The algorithm were applied to a set of global optimization problems of varying degree of difficulty and he has presented with a good robusteness.
Some functions or problems that were analyzed:
Branin, Goldprice, Quartic, Griewank2,Hartman3,Schubert3, Shekel5,
Shekel7, Schubert5, Hartman6.
Giovani Tonel (2021). Swarm Optimization (https://www.mathworks.com/matlabcentral/fileexchange/12820-swarm-optimization), MATLAB Central File Exchange. Retrieved .
The code cannot be runned.
Ok Mr. John D'Errico,
shortly I will add some examples, but firstly I have to translate them of the Portuguese language for the English language.
Thank you for your review.
This is an excellent example of a code that may have some value, but fails mainly because of poor help.
For example, the parameter R is the axis of the hyperellipse. What hyperellipse? The author does not choose to tell us.
The parameters c1 and c2 are designated as local and global search parameters (defaults are 1 for both.) How are they used? NO information is provided.
This code allows for plots. I wonder if they only work in 2-dimensions? No hints in the help.
Can we even gain some ideas of how they might be used from internal comments? Sorry, but no. There are essentially no internal comments that explain what the author has done.
Is there a convergence check? Or does this just run for the specified number of iterations? No hints.
A point of programming style - why force the user to provide an argument that specifies which parameters have bounds? If a parameter has no bounds, then use -inf and inf for its respective bounds. This way you use a format that is consistent with the optimization toolbox, and you make the user work less.
The defaults for the lower and upper bounds are defined in a way that makes no sense. A far better description is needed. Best is to not provide defaults for the bounds at all. Its a bad idea to surprise a user with bounds they do not expect.
The objective function should have much more explanation. For example, must it be vectorized?
I'd have liked to see an example of use. The author claims this has been applied to a variety of test cases. So why not provide an example in the help? Even better, supply HTML (using publish) that shows this code in action.
There is no error checking done for validity of arguments. For example, are the supplied lower bounds strictly less than the upper bounds? Are they all the same size as the parameter vector? These are things that make for good (user friendly) code.
A probable bug will result for unbounded problems, expecially if plots are generated.
What did I like about this code? Its has defaults for the parameters.
I think the author can do better here. Please try again.
No code commenting
Poor swarm implementation
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!