필터 지우기
필터 지우기

both real and integer variables ga optimization

조회 수: 6 (최근 30일)
andrea84
andrea84 2013년 2월 8일
How can i perform an optimization with the gamultiobj function using both real and integer variables ?

채택된 답변

Shashank Prasanna
Shashank Prasanna 2013년 2월 8일
Andrea, integers are real, however I think you are referring to solving a mixed integer problem. Here is an example of how it can be done using GA:
  댓글 수: 4
Walter Roberson
Walter Roberson 2013년 2월 10일
R2011a did not support constraining to integer.
I don't think you can (even with R2012b) constrain to arbitrary sets of values. However, you can (in versions that support it) constrain to integer values, with a range of 1 to the number of different values, and then in the function you provide, use that variable as an index into the table of actual values.
andrea84
andrea84 2013년 2월 10일
Thanks for the explanation!
I'm thinking to use a function to "map" the values obtained from the ga, e.g. [1 2 3 4 5] to the range i need: [20 40 60 80 100].

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Alan Weiss
Alan Weiss 2013년 2월 11일
As Benji said, you cannot perform mixed integer optimization automatically in GA unless you have MATLAB R2011b or later. However, you can write custom population functions for this purpose; see this explanation. You might also want to see this example on mapping integer variables to a finite set of choices.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

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