return infiniteIntervalProbability.computeIntervalProbability(durationInMins);
double pr = infiniteIntervalProbability.computeIntervalProbability(durationInMins); if (logger.isDebugEnabled()) { logger.debug("Infinite interval, called infiniteIntervalProbability.computeIntervalProbability(). Prob = "+pr); } return pr;
    public double computeIntervalProbability(long start, long end) throws NegativeIntervalException {                 if (intervals.size() == 0) { return 0.0; } // no probability                //break interval up into minutes        long interval = end - start;        if (interval < 0) {            throw new NegativeIntervalException();        } else if (interval == 0) {            return 0.0; //zero length interval        }        //Convert millisecond interval to minutes, round up, & cast to int.        int durationInMins = (int) java.lang.Math.ceil( (interval / 60000) );                        //See if there is an infinite interval probability. If so, we don't need to break up        //the entire interval into sub-intervals.        if (infiniteIntervalProbability != null) {            return infiniteIntervalProbability.computeIntervalProbability(durationInMins);        }                GregorianCalendar startTime = new GregorianCalendar(TimeZone.getTimeZone("GMT"));        startTime.setTimeInMillis(start);        GregorianCalendar endTime = (GregorianCalendar)startTime.clone();        endTime.add(Calendar.MINUTE, durationInMins); // find ending time        int durHrs = durationInMins / 60;        ClockInterval[] clockIntervals = ClockInterval.generateIntervals(startTime, endTime, durHrs);                //Otherwise figure out how many interval probabilities will be used.        EventProbabilityInterval epi;        double cumulativeProb = 1.0;        Iterator i = intervals.iterator();        while (i.hasNext()) {                        epi = (EventProbabilityInterval) i.next();            int minutes = ClockInterval.computeOverlap(clockIntervals, epi.getClockIntervals() );            cumulativeProb = cumulativeProb * epi.computeIntervalProbability(minutes);        }                return 1.0 - cumulativeProb;    }