Using ga to optimise a 9 input function.
显示 更早的评论
I'm using MATLAB to optimise a 9 input function. I've created my function and it outputs a fitness penalty value. When im running the function there are 2 main points it can fail at (by this i mean the selected inputs provide neither a good or bad solution, just straight up fail). I have two if statements at these points, if the inputs fail at the first stage they recieve a fitness penalty of -800, if they fail at the second stage they recieve a fitness penalty of -400 (picked these kind of randomly). If they pass through both if statements succesfully then they recieve a positive fitness penalty based on how well they performed. I've set up a genetic algorithim to optimise this (find the maximum fitness penalty) and I have provided MATLAB with initial points that i know provide a positive fitness penalty. I did a couple of test runs with the ga whilst i was tweaking penalties and my function and it did work. However, I'm now running it properly and I cannot get a positive fitness penalty. I've tried adjusting my population size and elite population to no success. I suspect it's just that the ga is yet to find a succesful input to use in the next generation but i don't know for sure. Any help/advice greatly appreciated.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!