public double getSimilarity() { List sims = new ArrayList(); Iterator qIt = querySet.iterator(); Iterator tIt = targetSet.iterator(); if (qIt.hasNext() && tIt.hasNext()) { Image target = (Image) tIt.next(); while (qIt.hasNext() && tIt.hasNext()) { Image query = (Image) qIt.next(); measure.setQuery(query); measure.setTarget(target); double prevSim = measure.getSimilarity(); double sim = prevSim; while (prevSim <= sim && tIt.hasNext()) { target = (Image) tIt.next(); measure.setTarget(target); prevSim = sim; sim = measure.getSimilarity(); } sims.add(new Double(prevSim)); } aggregator.clearValues(); Iterator it = sims.iterator(); while (it.hasNext()) aggregator.addValue(((Double)it.next()).doubleValue()); return aggregator.getAggregatedValue(); } else return 0;
public double getSimilarity() { double sim1 = calculateSimilarity(querySet, targetSet); double sim2 = calculateSimilarity(targetSet, querySet); return (sim1 + sim2) / 2;
	public double getSimilarity() {		List sims = new ArrayList();		Iterator qIt = querySet.iterator();		Iterator tIt = targetSet.iterator();		if (qIt.hasNext() && tIt.hasNext()) {			Image target = (Image) tIt.next();			while (qIt.hasNext() && tIt.hasNext()) {				Image query = (Image) qIt.next();				measure.setQuery(query);				measure.setTarget(target);				double prevSim = measure.getSimilarity();				double sim = prevSim;				while (prevSim <= sim && tIt.hasNext()) {					target = (Image) tIt.next();					measure.setTarget(target);					prevSim = sim;					sim = measure.getSimilarity();				}				sims.add(new Double(prevSim));			}			aggregator.clearValues();			Iterator it = sims.iterator();			while (it.hasNext())				aggregator.addValue(((Double)it.next()).doubleValue());			return aggregator.getAggregatedValue();		} else			return 0; 	}