Similarity Cache Monitor #
This page contains the following content:
GUI Overview #
index | query | case | Similarity | comp. time | added | hits | last time read |
---|---|---|---|---|---|---|---|
col 0 | col 1 | col 2 | col 3 | col 4 | col 5 | col 6 | col 7 |
Integer.class | String.class | String.class | Similarity.class | Long.class | String.class | Integer.class | String.class |
Similarity View #
TODO
Usage #
Changes in the similarityCache are visualized by the SimilarityCacheMonitor GUI. Therefore to use the Monitor you must supply the Constructor of SimilarityCacheMonitor.java with the similarityCache.
SimilarityCacheMonitor similarityCacheMonitor = new SimilarityCacheMonitor(cache);
The constructor of the monitor takes one parameter, of type similarityCache.
WriteableObjectPool<NESTWorkflowObject> pool =
CakeInstance.start(
ResourcePaths.PATH_TEST_COMPOSITION,
ResourcePaths.PATH_MODEL_RECIPES,
ResourcePaths.PATH_SIM_MODEL_RECIPES,
ResourcePaths.PATH_CASEBASE_RECIPES);
SimpleSimilarityCache similarityCache = new SimpleSimilarityCache();
similarityCache.setRecordStats(true);
SimilarityCacheMonitor similarityCacheMonitor = new SimilarityCacheMonitor(similarityCache);
Retriever<NESTWorkflowObject, Query> retriever = (Retriever<NESTWorkflowObject, Query>) RetrievalFactory
.newRetriever(SystemRetrievers.LINEAR_RETRIEVER);
retriever.setObjectPool(pool);
retriever.getValuator().setSimilarityCache(similarityCache);
retriever.getValuator().setComputationTimeThresholdForCaching(-1);
Query query = retriever.newQuery();
query.setQueryObject(pool.iterator().next());
query.setRetrieveCases(true);
retriever.perform(query);
similarityCacheMonitor.waitUntilWindowClosed();