How can i bound initial guess during optimization

i have initial Guess
A= [ 0 30 0 30 30 30 30 30];
i don't want compiler take other values than 0 or 30. It should change only sequence.

7 comentarios

Walter Roberson
Walter Roberson el 19 de Dic. de 2015
Editada: Walter Roberson el 19 de Dic. de 2015
Which optimization routine are you using?
When you say that it should change only the sequence, do you mean that you want only permutations of A ?
Matt J
Matt J el 19 de Dic. de 2015
Since there are only 2^8 possible values for A, an exhaustive combinatoric search might be easiest.
Triveni
Triveni el 19 de Dic. de 2015
yes.....actually i want to generate combination and optimize...but things should be by algorithm..not by manual combination
If it is permutations of A, then only 28 of them are distinguishable.
Triveni
Triveni el 19 de Dic. de 2015
Actually i putting A= [ 0 30 0 30 30 30 30 30]; as initial guess....and solver generates A= [754.31 45.21, 31.23...] but i want to change only sequence. i want to bound it to 0 or 30.
Do you need the solutions to be permutations of A, so that in theory you could just try all the permutations and take the best one? Or do you need the upper bound to be 30 and the lower bound to be 0 and you accept all values between those two?
Which optimization routine are you calling?
Triveni
Triveni el 20 de Dic. de 2015
Editada: Triveni el 20 de Dic. de 2015
Just try all the permutations and take the best one.. you got right. I want only 0 and 30. don't want values between 0 and 30. I'm calling Genetic Algorithm. Please suggest...which one should be best.

Iniciar sesión para comentar.

Respuestas (1)

Which input to ga() does this represent? If this is your x vector that is not explicitly passed in or initialized for ga(), then you would not use ga() at all: you would just call your objective function with all of the permutations .
A = [ 0 30 0 30 30 30 30 30];
Aperm = unique(perms(A),'rows');
best_perm = Aperm(1,:);
best_val = YourObjectiveFunction(best_perm);
for K = 2 : size(Aperm,1)
this_perm = Aperm(K,:);
this_val = YourObjectiveFunction(this_perm);
if this_val < best_val
best_perm = this_perm;
best_val = this_val;
end
end

Preguntada:

el 19 de Dic. de 2015

Comentada:

el 29 de Dic. de 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by