How do I write inequality constraints within NSGA-II
조회 수: 2 (최근 30일)
이전 댓글 표시
i need to add the constraint 1<x< 3 to my objectve functinos but dont know how to write it
댓글 수: 0
답변 (1개)
Abhishek Gupta
2021년 6월 17일
Hi,
As per my understanding, you want to add a constraint to your function. You can do the same using "if, elseif, else" as follows: -
function my_objective()
...
if (1<=x) && (x<=3)
% <YOUR CODDE>
end
...
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Particle Swarm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!