Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I setup Matlab Genetic Algorithms Constraints?

I have problem on building the constraints matrices of genetic algorithms in Matlab. I want to import these matrices in GA function for a problem that has the following constraints:

a1<a2<a3...an-1<an , 0<ai<90, n=number of variables.

Matlab's documentation didn't help me because it refers only to simple equations and not to this kind of constraints.

I'm new to GA and every help would be acceptable!

like image 939
Nick Avatar asked Nov 05 '22 19:11

Nick


1 Answers

Default constraint provided by matlab will not suit for Your needs.

You may try to translate Your constrains and add a penalty condition, like this:

goalfunction value = Inf if conditions are not fulfilled

But this will fail to find the optimum, so what is my solution

You may also try to translate the problem, and instead of finding Your values, just find this:

b(1), b(2), ... b(n), where bi = a(i)-a(i-1) and b(i) > 0 for each i

So you will only find distances between each of your initial variables, and provided that they are positive you will find monotically icreasing sequence, and that's what You need. Tell me if it satisfies You.

PS. Constrains in optimiaztion are great thing to solve, and it's not always straightforward how we will translate each real-world constrain into aX > b :)

like image 195
Intelligent-Infrastructure Avatar answered Dec 02 '22 15:12

Intelligent-Infrastructure