package lt.ktu.gmj.tasks; import java.util.*; import java.lang.*; public class Genetic { private int num_of_Items; private int num_of_population; public int [][] Population; private Random rnd = new Random(); Genetic(int Items, int pop) { int i; num_of_population = pop; num_of_Items = Items; Population = new int[pop][]; for (i=0;i0&&prob<=(Wealth[i]/sum)) {pos = j; break;} } else { if(prob>present&&prob<=(present+Wealth[i]/sum)) {pos = j; break;} } present = present+ Wealth[i]/sum; } for (j=0;j