### Author: M. Turhan ÇOBAN
## Created: 2021-11-07
## set_integer_random_genotype

function retval = set_integer_genotype(x,y,id1,no)
  int_genotype.no=no;
  int_genotype.x=x;
  int_genotype.y=y;
  n=length(x);
  int_genotype.id=id1;
  int_genotype.z=distance();
  int_genotype.RFitness=0.0;
  retval =int_genotype; 
       function total=distance()
       total=0.0;
       n=length(x);
         for i=1:n-1
           x1=x(int_genotype.id(i+1))-x(int_genotype.id(i));
           y1=y(int_genotype.id(i+1))-y(int_genotype.id(i));
           total=total+sqrt(x1*x1+y1*y1);
         endfor
       endfunction 
endfunction