GA algorithm toolbox (define constraint)

1 次查看(过去 30 天)
Hi
I have objective function with 5 variable which I have implemented in the genetic algorithm to optimize it .
I have trouble defining its constraint in the genetic algorithm.
The constraint I want to define:
  • X1 & x2 & x4 is integer
  • If I assume a is integer
  • Then x1=A*x4 & x1=A*x5
  • X2=A*x4 & X2=A*X5
Can someone guide me to define this constraint to GA toolbox matlba?

采纳的回答

Walter Roberson
Walter Roberson 2020-9-25
This kind of system can be programmed by introducing up to 4 new integer variables, with the logical conditions
x1 == x6 * x4
x1 == x7 * x5
x2 == x8 * x4
x2 == x9 * x5
You would then follow that by reducing the original equations, replacing each x1 by x6 * x4 and each x2 by x8 * x4 everywhere the equations,
Then you would add the nonlinear equality constraints
x6 * x4 - x7 * x5
x8 * x4 - x9 * x5
The list of variables would be x3, x4, x5, x6, x7, x8, x9 with x4 through x9 all integer variables (so x3 is the only non-integer variable.)
I know your original list did not require x5 to be integer, but your integer constraints on the other variables require that x5 be integer, I figure.
  1 个评论
hamed feizmohamadi
hamed feizmohamadi 2020-9-26
Thanks for the reply
Another question is to define the integer of the variables in the fitness function part?
Also this constraint
x1 == x6 * x4
x1 == x7 * x5
x2 == x8 * x4
x2 == x9 * x5
define In fitness function?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by