Genetic Algorithm for points External To a Specific Volume
1 view (last 30 days)
Show older comments
ADSW121365 on 10 Aug 2022
Commented: ADSW121365 on 11 Aug 2022
I'm using the GA to select measurement points in a three-dimensional physics problem.
I can tell GA to select only N_points inside some specified plane above my problem simply as:
X.min = -10; X.max = 10; Y.min = -10; Y.max = 10; Z.min = 0; Z.max = 2;
lb = repmat([X.min Y.min Z.min],[1 N_points]);
ub = repmat([X.max Y.max Z.max],[1 N_points]); %Lower/Upper Boundaries [X,Y,Z]
Is it possible to instead set up constraints so points are only selected outside of some cube? For clarity, a physical example would be there exists volume which a measurement device cannot enter, so the problem searches for points external to that region.
Ideally, I would select points only within a hollow-cube: External to a specific volume, but extending to reasonable limits - thereby minimising the possible search space.
Matt J on 10 Aug 2022
Edited: Matt J on 10 Aug 2022
You would have to use a non-linear constraint function for that:
x=reshape(x,3,); %reshape to 3xN_points
cineq(1,:)=vecnorm(x./[Xmax;Ymax;Zmax],inf)-1; %inside box of dimensions Xmax x Ymax x Zmax
cineq(2,:)=1-vecnorm(x./[Xmin;Ymin;Zmin],inf); %outside box of dimensions Xmin x Ymin x Zmin
More Answers (0)
Find more on Image Segmentation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!