public void calculateStatistics(){
        long maxRouteLength = 1;
        long minRouteLength = AntColony[0].getRouteLength();
        float avgRouteLength = 0;
        float avgTemp = 0;
        int successfulAnts = 0 ;
        long max = 0;
        long min = 0;

        for(int i = 0; i < AntColony.length; i ++){
            // Находим максимальную и минимальную длину
            if(AntColony[i].isSuccessful() && AntColony[i].getRouteLength() + 1 > max){
                maxRouteLength = AntColony[i].getRouteLength()+1; //+1 потому что начальной точки в массиве Route нет
            }
            if(AntColony[i].isSuccessful() && AntColony[i].getRouteLength() +1 < min){
                minRouteLength = AntColony[i].getRouteLength() + 1 ;
            }
            //Считаем среднюю длину пути
            if(AntColony[i].isSuccessful()){
                avgTemp+=AntColony[i].getRouteLength();
                successfulAnts++;
            }
        }

        try{
            avgRouteLength = avgTemp / (float)successfulAnts;
        }
        catch (ArithmeticException e){
            avgRouteLength = 0;
        }
        dataMax[iterationsNum][0]=String.valueOf(iterationsNum);
        dataMax[iterationsNum][1]=String.valueOf(maxRouteLength);

        dataMin[iterationsNum][0]=String.valueOf(iterationsNum);
        dataMin[iterationsNum][1]=String.valueOf(minRouteLength);

        dataAvg[iterationsNum][0]=String.valueOf(iterationsNum);
        dataAvg[iterationsNum][1]=String.valueOf(avgRouteLength);
    }