开发者

designing fitness function in genetic algorithm

开发者 https://www.devze.com 2023-01-14 21:38 出处:网络
I need to solve simultaneous linear equati开发者_如何转开发ons(5 equations with 7 unknowns i.e an under-determined problem) where the variables vary over a wide range of

I need to solve simultaneous linear equati开发者_如何转开发ons (5 equations with 7 unknowns i.e an under-determined problem) where the variables vary over a wide range of [0 - 1,00,000]. Can someone suggest what fitness function I should use?


I guess you are referring to a system of 5 linear equations with 7 variables.

This paper seems to show what you're looking for. You basically need to define a cost function and use the GA to minimize it. Search the pdf for "fitness function" to see exactly how to do this. The idea is to find some measure of how well your set of variable approximates the solution (or a solution in your case) for the system.


Assuming that your system is written in a form like this: e_1(x1, x2, ..., x7) = 0 e_2(x1, x2, ..., x7) = 0 ... e_5(x1, x2, ..., x7) = 0

then a fitness function F(x1, x2, ..., x7) = abs(e_1(x1, ..., x7)) + abs(e_2(x1, ..., x7) + ... + abs(e_5(x1, ..., x7) may do the trick. You can probably change the + with something else (such as multiplication or the maximum operator, as proposed in the article mentioned by @JohnIdol )

This will probably work in non-linear systems also.

0

精彩评论

暂无评论...
验证码 换一张
取 消