Matrix array in ga
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Leonid Medvedev
el 30 de Mzo. de 2021
Respondida: Alan Weiss
el 31 de Mzo. de 2021
Tell me please, I used GA to optimize the antenna array matrix,but I ran into a problem. I can't figure out how to limit the number of units in the optimized matrix.When I tried to impose restrictions, matlab said that I should switch the data type to doubleVector, however, using doubleVector, the algorithm simply does not run.In general, the algorithm works as I need, but I need the number of ones
in the matrix to not exceed 80 (matrix 16x16). I hope you can tell me something.
1 comentario
Alan Weiss
el 30 de Mzo. de 2021
Sorry, we will need more detail. Are you trying to run a custom data type? A bitstring data type? Can we please see your ga options and your ga call?
Alan Weiss
MATLAB mathematical toolbox documentation
Respuesta aceptada
Alan Weiss
el 31 de Mzo. de 2021
I think that you are making a mistake by choosing the bitstring data type. Doing so loses the possibility of having constraints enforced automatically; you have to ensure that your mutation and crossover functions cause the constraints to be satisfied at each iteration.
If you will not use the recommended data type, you have to have custom creation, crossover, and mutation functions that enforce all linear constraints at each iteration. It is easy to create a random population that satisfies the linear equality constraint. Each individual can be created by the command
p = randperm(N); % p is an individual, N is the number of dimensions
p = double(p <= beq); % Gives sum(p) = beq
Making good crossover and mutation functions is a bit harder. For mutation, ensure that any new individual has the same number of 1 entries as the previous. For crossover, the same. I don't know what other constraints you are trying to enforce, but you can do it in your custom functions.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!