How to use Genetic Algorithm (GA) for multi-objective function (Dynamic Optimization)?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
I need to optimize this multiobjective function using GA:
Z=min(2X+Y);
X= sum (a1+b1+c1-d1+(N1/S))
Y= sum (a2+b2+c2-d2+(N2/S))
All other variables are known (however, dynamically changed), excepted (b1,b2) which needed to optimized to get the optimal value of (Z)
댓글 수: 1
채택된 답변
Alan Weiss
2018년 1월 11일
This does not look like a multiobjective problem to me. You have a single scalar objective Z. Furthermore, it seems to be an unbounded problem, with no finite minimum (I mean it seems that b1 and b2 could take the values -Inf, and then Z would also have the value -Inf, which is the minimum).
If I misunderstand, feel free to clarify.
Alan Weiss
MATLAB mathematical toolbox documentation
댓글 수: 11
I am afraid that I find your comments unintelligible. Do you have just one objective, Z? If so, why do you want to maximize b1 and b2? How do X and Y depend on b1 and b2 other than through the linear expressions you already gave? And why does it matter, if all you ultimately want to do is minimize Z?
In order to make your problem clear, please give a concise statement of the objective or objectives (if different from what you already gave) and of any constraints that might exist.
Alan Weiss
MATLAB mathematical toolbox documentation
Sherif Shokry
2018년 1월 15일
편집: Walter Roberson
2018년 1월 15일
Mr.Alan Weiss, Regarding your 1st comment the objective function
Z=min(2X+Y);
X= sum (a1+b1+c1-d1+(N1/S)) b1 subject to (0,upper limit)
Y= sum (a2+b2+c2-d2+(N2/S)) b2 subject to (0,upper limit)
to ensure that b1 and b2 would not take the values -Inf,
That is not multi-objective. This is minimization of
2 * sum (a1+b1+c1-d1+(N1/S)) + sum (a2+b2+c2-d2+(N2/S))
with lower bound [0, 0] and upper bound whatever limits are appropriate.
Thank you for your quick response. If it's not a muti-objective function, could you please recommend me the best way to solve this fitness function. Note: this fitness function for dynamic iteration
function y = fitness(b, a, c, d, N, S)
a1 = a(1); a2 = a(2);
b1 = b(1); b2 = b(2);
c1 = c(1); c2 = c(2);
d1 = d(1); d2 = d(2);
y = 2 * sum(a1+b1+c1-d1+(N1./S)) + sum(a2+b2+c2-d2+(N2./S));
together with calling your favorite minimizer with
... define a1, a2, c1, c2, d1, d2, N, S. Then
fun = @(b) fitness(b, [a1,a2], [c1,c2], [d1,d2], N, S);
A = []; b = [];
Aeq = []; beq = [];
lb = [0 0]; ub = [appropriate upper bounds];
For example,
b0 = rand(1,2);
b = fmincon(fun, b0, A, b, Aeq, beq, lb, ub);
This assumes that a1, a2, c1, c2, d1, d2 are all scalars and that the vector is either N or S.
Thank you Mr.Roberson, I got this error when I tried to recall the dynamic variables for the fitness function from the main.m file. Please kindly find my fitness.m file
Please attach all of your code as individual files (posted the way you have, I cannot tell where the files begin and end.)
I do not understand what you mean by saying that you are trying to recall the dynamic variables for the fitness function from the main.m file? Variables you calculate in the fitness function are in the workspace of the fitness function and are not available to the main function.
Perhaps you should consider an arrangement such as:
function y = fitness(b, a, c, d, N, S)
[variable1, variable2, variable3...] = calculate_intermediate_variables(b, a, c, d, N, S);
y = some_function(variable1, variable2, variable3);
And then when you have found the best fit and need the temporary variables that would be calculated for it, call
[variable1, variable2, variable3...] = calculate_intermediate_variables(best_b, a, c, d, N, S);
This arrangement is a lot easier than arranging to have fitness store the variables where your main routine can find them.
Thank you for your kind response. I would like to attach here the main.m file named (VISSIM.COM1) and the fitness.m file named (extension). However, let me draw your attention it may not be working since this code is manipulating a simulation software via COM interface. Also, let me clarify the meaning of (recall the variables values), this process aims to input the variable values into the fitness function since this variables is in a dynamic iteration and the fitness function is done iteratively
I think the function (fmincon) is not appropriate to my case. In my case I'm seeking (b) variables which achieve the optimal (y). However, if I understood correctly (fmincon) finds (y) variables that achieve optimal (b).
"However, if I understood correctly (fmincon) finds (y) variables that achieve optimal (b)."
No, fmincon seeks the inputs that give the lowest outputs.
However, fmincon is a local minimizer -- it gets stuck in local minima.
"this process aims to input the variable values into the fitness function since this variables is in a dynamic iteration and the fitness function is done iteratively"
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
