Calculating number of operations during GA run

2 views (last 30 days)
I need to evaluate the performance of a genetic algorithm and one of the parameters I'm using for this evaluations is time that is needed for that algorithm to finish. However, I've realized that such an evaluation would then depend on the specs of the machine that is running the algorithm and I want to avouid that. What would be the optimal way to calculate the number of operations that happend during the algorithms run (cause that metric would be the same regardless of the machine taht is running the code right?)
Is there something like "tic" .... "toc" but not for time but rather number of operations or anything else that could be used?

Accepted Answer

Star Strider
Star Strider on 12 Nov 2022
A lot depends on the 'InitialPopulationMatrix' and how it is defined, parameter constraints, and other considerations.
If approximate ranges for the known parameters are defined in it, the the convergence will be faster and likely more accurate. In a different Answer I posted:
For example is R is in , L in , and C in (I have no idea what G woiuld be), it could be something like this:’
format shortE
IPM = randi(1E+4, 5, 4) .* [1 1E-9 1E-3 1E-15]
IPM = 5×4
1.0e+00 * 6.6430e+03 7.1140e-06 3.6990e+00 8.2250e-12 9.5090e+03 2.8500e-06 2.8540e+00 5.1500e-12 6.6540e+03 3.4510e-06 1.3550e+00 4.1210e-12 9.4250e+03 9.1510e-06 5.1200e+00 3.1650e-12 8.6400e+02 7.9140e-06 5.8840e+00 7.6200e-12
format shortG
That provides an illustration of scaling the 'InitialPopulationMatrix'.
Probably the best metric would be in the output result, specifically ‘funccount’, the number of times the fitness function is evaluated.
.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!