private static Multiset toMultiSet(HeuristicsNet net) { Multiset ms = new HashMultiset(); for (int i = 0; i < net.getDuplicatesMapping().length; i++) { if ((net.getInputSet(i).size() > 0) || (net.getOutputSet(i).size() > 0)) { ms.add(net.getLogEvents().getEvent(net.getDuplicatesMapping()[i])); } } return ms; }
/** * Creates an object of <code>DuplicatesEquivalent.</code> * * @param baseHN HeuristicsNet base heuristics net. The precision and recall consider this net as * the correct solution. * @param foundHN HeuristicsNet found heuristis net. The precision and recall compare this net to * the base heuristics net. */ public DuplicatesEquivalent(HeuristicsNet baseHN, HeuristicsNet foundHN) throws Exception { if (baseHN != null) { this.baseHN = baseHN; } else { throw new NullPointerException("Base heuristics net is null!"); } if (foundHN != null) { this.foundHN = foundHN; // making the foundHN and the baseHN work on the same indeces for // the tasks/elements... try { this.foundHN.setLogEvents(baseHN.getLogEvents()); } catch (ArrayIndexOutOfBoundsException aioexc) { throw new ArrayIndexOutOfBoundsException( "The baseHN does not have all the events in the 'foundHN'!"); } } else { throw new NullPointerException("Found heuristics net is null!"); } calculatePrecisionAndRecall(); }