Simple implementation of genetic algorithm in java