How can I add multiple constraints to multiple variables for a GA optimization?

7 vues (au cours des 30 derniers jours)
Hi, I am having difficulty implementing constraints into my genetic algorithm optimization model. I am able to impose the necessary boundaries but am unable to determine how to impose multiple constraints on each variable. All documentation I have found has very simplified constraints and only have one constraint per variable. To give an idea of the problem at hand, it can be simplified by having a square divided into 9 'tiles'. The position of a single 'o' on each tile is optimized and can lie anywhere on each tile, however it must maintain a given distance 'd' from any other 'o' [d < tile dimensions]. Each 'o' has an x and y coordinate so that [sqrt((x(1)-x(2))^2 + (y(1)-y(2))^2) > d] for each 'o' in a neighboring tile. Therefor for the central tile there are 8 constraints (8 neighbors) like this that must be imposed. How can I implement these constraints into my GA so that I can meet these requirements?
Thanks in advance!

Réponse acceptée

Alan Weiss
Alan Weiss le 19 Juil 2018
Modifié(e) : Alan Weiss le 19 Juil 2018
The documentation for writing nonlinear constraints shows an example with two nonlinear constraints. As does this example. You can, of course, have any number.
This example has ten nonlinear inequality constraints, but it might be hard to parse, as it is mainly showing how to include symbolic objective, constraints, and gradients and Hessians.
Alan Weiss
MATLAB mathematical toolbox documentation

Plus de réponses (0)

Produits


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by