Why crossover and mutation functions in GA was not considered while using integer variable indices (integer constrain)?

5 次查看(过去 30 天)
ga error.JPG

采纳的回答

Walter Roberson
Walter Roberson 2019-1-13
They are considered.
The way that integer constraints are enforced is that ga() puts in its own CrossoverFcn and MutationFcn that forces the constraints to be honored. User crossover and mutation functions have the risk of generating new entries that do not satisfy the integer constraints.
If you are certain that your crossover and mutation functions enforce your integer constraints, then leave your intcons empty, and set an initial population matrix that gives initial entries that are consistent with your integer constraints, and then count on your crossover and mutation functions to force the entries to continue to be integer.
  5 个评论
Yousuf Azimi
Yousuf Azimi 2020-9-13
Dear Walter
thank you for your answer to Shibu question.
I write for my self a simple form of NSGA II to solve an optimization problem with integer constraints. I use the ordinary crossover and mutation crossover and I use the "round" function to convert the new children into integer form before I call them in the cost function of the problem. But unfortunately, I didn't get good results. As my question is there a way that I can call these three functions "CreationFcn: @gaminlpcreationuniform" and "CrossoverFcn: @gaminlpcrossoverlaplace" and "MutationFcn: @gaminlpmutationpower" inside my NSGA II code. I would be so grateful if you could help me.
Thanks in advance.
Walter Roberson
Walter Roberson 2020-9-13
They are just MATLAB functions, and the interface to them is documented (it is the same as the interface for custom functions). So if NSGA II can call arbitrary functions then Yes.

请先登录,再进行评论。

更多回答(1 个)

Doanh Luong
Doanh Luong 2019-2-28
编辑:Doanh Luong 2019-2-28
Integer programming with ga involves several modifications of the basic algorithm (see How the Genetic Algorithm Works). For integer programming:
  • Special creation, crossover, and mutation functions enforce variables to be integers. For details, see Deep et al. [2].
[2] Deep, Kusum, Krishna Pratap Singh, M.L. Kansal, and C. Mohan. A real coded genetic algorithm for solving integer and mixed integer optimization problems. Applied Mathematics and Computation, 212(2), pp. 505–518, 2009.
From the paper, laplace crossover and power mutation are considered.

类别

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