//,SimilarityMatchingEngine engine
public static void performTest(SimilarityMatchingEngine engine, String service_number, short similarity_measure, boolean isM0) throws Exception {
engine.setSimilarityMeasure(similarity_measure);
ArrayList relevant;
RecallPrecision recall = new RecallPrecision();
List list;
Vector results = new Vector();
Vector queryVector = getQueryURIsFromDirectory();
URI queryURI;
long query = System.currentTimeMillis();
int max =min(queries, queryVector.size());
for (int i=0;i<max;i++) {
queryURI = (URI) queryVector.get(i);
// if (queryURI.toString().indexOf("bookpersoncreditcardaccount__service.owls")>=0)
// i++;
System.out.println("Query " + (i+1) +"/" + max + ": " + queryURI.toString());
log("Query " + (i+1) +"/" + max + ": " + queryURI.toString());
relevant=getRelevantForQuery((URI) queryVector.get(i));
list = query(engine,queryURI,i,isM0);
// getMemory();
logDoubleArray(recall.processRecallPrecision(list,relevant));
}
query = System.currentTimeMillis()-query;
long querytime = query/queries;
long memory_queries = getMemory();
log("Total:");
log("");
log("Total Query processing time " + query + "ms");
log("Average Query processing time " + querytime + "ms");
log("Memory consumption after querying " + memory_queries + "bytes");
log("");
log("RP-New");
logRecallResult(recall.getMicroAveragePrecisions());
log("");
log("RP-Old");
logDoubleArray(recall.getAveragePrecisionAtElevenPoints());
printMap(getAveragePrecisionFromRPVector(results),false);
}