cbr.framework
Class Reasoner

java.lang.Object
  extended by cbr.framework.Reasoner

public class Reasoner
extends Object

Reasoner provides a collection of static, utility methods to access a case base and perform reasoning tasks such as comparing a target case to source cases.


Constructor Summary
Reasoner()
           
 
Method Summary
static List<Case> getCasesOverSimilarityThreshold(double threshold, Case targetCase, CaseBase caseBase)
          Retrieves the cases from the case base that are over (or equal to) a specified similarity threshold, when compared to the targetCase.
static Case getMostSimilarCase(Case targetCase, CaseBase caseBase)
          Retrieves the case from the case base that most resembles the target case.
static List<Case> getNMostSimilarCases(int n, Case targetCase, CaseBase caseBase)
          Given a novel scenario represented as a case find the N most similar cases in the caseBase provided.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reasoner

public Reasoner()
Method Detail

getNMostSimilarCases

public static List<Case> getNMostSimilarCases(int n,
                                              Case targetCase,
                                              CaseBase caseBase)
Given a novel scenario represented as a case find the N most similar cases in the caseBase provided.

Parameters:
n - the number of similar cases to return
targetCase - the novel scenario
caseBase - the collection of cases to test against
Returns:
the n most similar cases as a list

getMostSimilarCase

public static Case getMostSimilarCase(Case targetCase,
                                      CaseBase caseBase)
Retrieves the case from the case base that most resembles the target case.

Parameters:
targetCase - the novel case
caseBase - the source cases
Returns:
the most similar source case

getCasesOverSimilarityThreshold

public static List<Case> getCasesOverSimilarityThreshold(double threshold,
                                                         Case targetCase,
                                                         CaseBase caseBase)
Retrieves the cases from the case base that are over (or equal to) a specified similarity threshold, when compared to the targetCase.

Parameters:
threshold - the similarity threshold
targetCase - the novel case
caseBase - the source cases
Returns:
the cases that are greater than or equal to the similarity threshold