// Get a SortedSet with the loaded queries
SortedSet queries = new TreeSet();
queries = TestCollection.getInstance().getQueries();
Query query;
Map result = new HashMap();
SortedSet set = new TreeSet();
// Run through the set of queries and match them one by one
current = 1;
for(Iterator iter = queries.iterator(); iter.hasNext();current++) {
query = (Query) iter.next();
System.out.println("MatchmakerInterface: Matching query: " + query.getURI().toString() + ", " + current + "/" + queries.size());
set = MatchmakerInterface.getInstance().matchRequest(query.getURI(),GUIState.getInstance().getMinDegree(), GUIState.getInstance().getTreshold());
result.put(query,set);
}
/*
* Show the results of the matchmaking
*
* 0 - Exact match
* 1 - Plug-in match
* 2 - Subsumes match
* 3 - Subsumed-by match
* 4 - Nearest Neighbour match
*/
System.out.println("***************************");
System.out.println("Results:\n");
// System.out.println(result.toString());
// Extra output
// System.out.println("Some extra output:\n**********************");
double max_SynSim, min_SynSim;
max_SynSim = 0;
min_SynSim = 10;
String uri, s_uri, result_count;
String write;
int counter = 1;
int rqueries = 1;
Iterator answerSet;
HybridServiceItem item;
Set ioset;
for(Iterator iter = result.keySet().iterator();iter.hasNext();){
query = (Query) iter.next();
uri = query.getURI().toString();
if (uri.contains("/"))
uri = uri.substring(uri.lastIndexOf("/")+1);
write = "Query " + rqueries + " " + uri;
//write = write.replaceAll("[\\r\\f]","");
System.out.println(write);
System.out.println("Inputs:");
ioset = query.getInputs();
for(Object input : ioset){
System.out.println(" " + input.toString());
}
System.out.println("Outputs:");
ioset = query.getOutputs();
for(Object input : ioset){
System.out.println(" " + input.toString());
}
for (answerSet = ((SortedSet) result.get(query)).iterator();answerSet.hasNext();) {