## Author: M. Turhan ÇOBAN
## Created: 2021-06-20
## set_genotype

function retval = set_genotype_b(fx,xmin,xmax,no,b)
  genotype.no=no;
  genotype.xmin=xmin;
  genotype.xmax=xmax;
  genotype.ngene=length(xmin);
  genotype.f=fx;
  for i=1:genotype.ngene 
    genotype.b(i,:)=b(i,:);
    xx=binary_to_double(genotype.b(i,:),genotype.xmin,genotype.xmax)
    genotype.x(1,i)=xx;
  endfor
  genotype.y=genotype.f(genotype.x);
  genotype.RFitness=genotype.y;
  genotype.RCFitness=genotype.y;
  retval =genotype;  
endfunction