public static int getMaxNumInQueue(String qType) {
        if (maxNumInQueue.containsKey(qType))
            return maxNumInQueue.get(qType);
        ArrayList<QueueInfo> list = queuesInfoMap.get(qType);
        int max = 0;
        int timeAvg = 0;
        int maxTime = 0;
        Iterator<QueueInfo> it = list.iterator();
        while (it.hasNext()) {
            QueueInfo info = it.next();
            if (info.to > info.from) {
                if (info.count > max)
                    max = info.count;
                if (info.to > maxTime)
                    maxTime = info.to;
                timeAvg += info.count * (info.to - info.from);
            }
        }
        maxNumInQueue.put(qType, max);
        if (maxTime > 0)
            timeAvgNumInQueue.put(qType, (double) timeAvg / maxTime);
        else
            timeAvgNumInQueue.put(qType, 0.0);
        return maxNumInQueue.get(qType);
    }