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

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