How to configure Matlab Genetic Algorithms Constraints?

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

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

The Matlab documentation did not help me, because it applies only to simple equations, and not to these limitations.

I am new to GA and every help would be acceptable!

+5
source share
2 answers

The default restriction provided by Matlab is not suitable for your needs.

You can try to translate your restrictions and add a penalty condition, for example:

goalfunction value = Inf if conditions are not fulfilled

But it will not be possible to find the optimal one, so what is my solution

, , , :

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

, , , , . , .

PS. - , , aX > b:)

+1

, 5.

Aineq = [1 -1 0 0 0;  0 1 -1 0 0;  0 0 1 -1 0;  0 0 0 1 -1; ]

b = [0 0 0 0]

:

a1<a2
a2<a3
a3<a4
a4<a5

a1<a2<a3<a4<a5

+1

All Articles