setting-up input variable in genetic algorithm
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ful0
am 6 Feb. 2021
Kommentiert: Walter Roberson
am 17 Feb. 2021
How can I set up an input variable in my ga that varies from 1 to 2 with steps of 0,1?
The results of my ga has too many significant digits after comma ( precisely 4).
Thank you
1 Kommentar
Walter Roberson
am 17 Feb. 2021
If you are seeing exactly 4 significant digits, chances are that you have
format short
in effect, and that you would see more digits if you used
format long g
Akzeptierte Antwort
Alan Weiss
am 17 Feb. 2021
- Internally to your objective function, change your integer variable x to x/10. Or,
- Make a list of allowable values in a variable indexvar. Have your objective function evaluate indexvar(x), where x is your integer-valued variable. This is more flexible, in that you can have any list of allowable values.
See Solving a Mixed Integer Engineering Design Problem Using the Genetic Algorithm and in particular the section Add Discrete Non-Integer Variable Constraints.
Alan Weiss
MATLAB mathematical toolbox documentation
0 Kommentare
Weitere Antworten (1)
Shiva Kalyan Diwakaruni
am 10 Feb. 2021
Hi,
You can try using optimoptions for genetic algorithm where you can many options for passing extra parameters either in form of variables or a user defined function.
please refer the below link for more information on optimoptions for ga function
below is the link to see how we can pass extra paramters for customization of ga function
hope it helps,
thanks
Siehe auch
Kategorien
Mehr zu Genetic Algorithm finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!