Genetic Algorithm forming a Fitness Function
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sam
el 5 de En. de 2014
Comentada: gagandeep khajuria
el 21 de Abr. de 2016
Hi.. i am new to Optimization Problems and specifically Genetic Algorithm.. I have read through all the given literature and have tried some simple practice functions which now seem too simple and straight forward..
My current task is to model a optimization problem with a Fitness Function which has a couple of summations within it. Is there an alternative to write the function without using long for loops? I have attached an example within.
Or where else can i look on guides to write such Fitness Functions?
This is still practice for me to get started on my work ahead.. your help will be much appreciated.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154617/image.png)
1 comentario
gagandeep khajuria
el 21 de Abr. de 2016
could u tell me the procedure of writing , say five equations of five variables but each equation has its own value(means it can't be taken as any variable) for GA toolbox... will be waiting for ur kind rplyy...thanking u
Respuesta aceptada
Matt J
el 5 de En. de 2014
Editada: Matt J
el 5 de En. de 2014
I'm assuming the unknowns are X(k,i,t).
Weighted summations are just matrix-vector multiplications or dot products, which MATLAB is good at, once you've built the relevant matrices. For example, the first summation term you've shown is dot(Q(:), X(:)) where
[D,I,T]=size(X);
Q=kron(P(1,1:D), tril(ones(I,T),-1));
I wonder, though, whether GA is the appropriate tool here. Since the whole objective function is linear in X, you should probably be using LINPROG, unless you have weird constraints that you haven't mentioned.
9 comentarios
Joseph Petinrin
el 4 de Mzo. de 2014
Pls can you assist in writing the function code so as to use it in GA optimization Toolbox. Tnx.
Joseph
Joseph Petinrin
el 4 de Mzo. de 2014
I am having similar problem. That is sum*sum from i=1 to 24. but I need assistance on how to write the function code. That is,
function y=objective_function(x) Y=........; end
Pls, can anyone assist in writing this code. So I can apply it in solving my problem which is similar to above.
Tnx. Joseph
Más respuestas (0)
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!