function mutp=mutsel_cerveza(t,pop,ind_str,prob_muttemp,prob_muttime)

% MUTSEL_CERVEZA	Select genes to change in the beer problem.
%
% MUTP=MUTSEL_CERVEZA(T,POP,IND_STR,PROB_MUTTEMP,PROB_MUTTIME)
%
%
% PROB_MUTTEMP,probability for mutating temperature genes, in the interval [0,1] (if 0 no genes will mutate, if 1, all of them)
% PROB_MUTTIME,probability for mutating time genes, in the interval [0,1] (if 0 no genes will mutate, if 1, all of them)
%
% See also GA_MUT, IS_NEW, 

% APRENDIZAJE AUTOMÁTICO (G. Pajares y J. M. de la Cruz, Eds.)
% Editorial: RA-MA
% Capítulo 9: El Aprendizaje con Algoritmos Genéticos
% Autores: Bonifacio de Andres y Toro


[r,c]=size(pop);
mutp=cell(r,1);
l=size([pop{:}],2);
mutpauxtemp=rand(1,l)<=prob_muttemp;
mutpauxtime=rand(1,l)<=prob_muttime;

a=1;
for i=1:r
   l=size(pop{i},2);
   mutp{i}=[mutpauxtemp(a:a+l-1);mutpauxtime(a:a+l-2),0];
   a=l+a;
end

