Sim Cache Monitor

Similarity Cache Monitor #

This page contains the following content:

GUI Overview #

indexquerycaseSimilaritycomp. timeaddedhitslast time read
col 0col 1col 2col 3col 4col 5col 6col 7
Integer.classString.classString.classSimilarity.classLong.classString.classInteger.classString.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();