public Operator greedyChoose(){
        double r;
        synchronized (rng){
            r = rng.nextDouble();
        }
        if (r < EPS){
            synchronized (rng){
                choosen = rng.nextInt(operators.size());
            }
            return operators.get(choosen);
        }
        double qMax= q.get(0);
        int count = 1;
        for (int i = 1; i < q.size(); ++i){
            if (q.get(i) == qMax){
                ++count;
            } else if (q.get(i) > qMax){
                count = 1;
                qMax = q.get(i);
            }
        }
        int number;
        synchronized (rng){
            number = rng.nextInt(count);
        }
        for (int i = 0; i < q.size(); ++i){
            if (q.get(i) == qMax){
                if (number == 0){
                    choosen = i;
                    break;
                } else {
                    --number;
                }
            }
        }
        return operators.get(choosen);
    }