public static void testGeneticAlgorithmDouble()
    {
        IMyRandomDataFunction<Double> rFunc = new IMyRandomDataFunction()
            {
            private final Random r = new Random();
                @Override
                public Double getRandom()
                {
                    return Math.random();
                }
            };
            IMyFitnessTestFunction<Double> tFunc = new IMyFitnessTestFunction<Double>()
            {
                @Override
                public int testFitness(List<Double> list) 
                {
                //System.out.println("list size:"+list.size());
                    return (int)list.stream().mapToInt(i->evaluate(i)).sum()/list.size();
                }
                private int evaluate(double given)
                {
                    //System.out.println("g"+given);
                    if(given>0.333&&given<0.666)
                    {
                        return 100;
                    }
                    else
                    {
                        return 0;
                    }
                }
            };
            
            try
            {
            MyDrawableGraph dg= new MyDrawableGraph(MyDrawableGraph.SortByAxis.xAxis, MyDrawableGraph.SortDirection.asc, 800, 600);
            MyCanvasWindow graphWindow = new MyCanvasWindow(800, 600, dg);
            graphWindow.startWindow();
            MyPopulation<Double> pop = new MyPopulation(50, 10, tFunc, rFunc,false);
            for(int i=0;i<1000; i++)
            {
            try 
            {
            pop.nextGeneration();
            int avgFitness =pop.getAverageFitness();
            List<MyGraphPoint<Integer,Integer>> graphPoints=pop.getPopulation().stream().map(p->new MyGraphPoint<>(pop.getGenerationCount(),avgFitness)).collect(Collectors.toList());
            
            graphPoints.stream().forEach(si->{try {
            dg.addGraphItem(si);
            } catch (Exception ex) {
            Logger.getLogger(MyStartClass.class.getName()).log(Level.SEVERE, null, ex);
            }
            });
            System.out.println("Population #"+i);
            System.out.println("-average fitnes:"+avgFitness);
            if(avgFitness>=99)
            {
            break;
            }
            //Thread.sleep(100);
            }
            catch (Exception ex)
            {
            Logger.getLogger(MyStartClass.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            }
            pop.getMostFitIndividual().getData().forEach(i->{System.out.println(""+i);});
            }
            catch (Exception ex)
            {
            Logger.getLogger(MyStartClass.class.getName()).log(Level.SEVERE, null, ex);
            }
    }