|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.reasoning.CBRReasoningStep
jcreek.reasoning.RetrieveResult
Title: RetriveResult
Description: Runs the first step (activate) of the CBR Retrive process. When a new instance of this class is created, it creates an instance of CaseComparison between the input case (problem case) and the cases we want to compare this case to.
Field Summary | |
protected java.util.Vector |
caseComparisons
Vector with a list of all the CaseComparisons. |
protected int |
caseComparisonSize
The explain() and focus() steps operate on a subset of the caseComparisons vector. |
static int |
DEFAULT_EXPLAIN_MAX_CASES
DEFAULT_EXPLAIN_MAX_CASES - the default value of how many cases are explained. |
static double |
DEFAULT_EXPLAIN_THRESHOLD
DEFAULT_EXPLAIN_THRESHOLD - the default value of the activation strength threshold used by the explain() method to call the explain(int maxExplain, int explainThreshold) method, using this value as the value of explainThreshold. |
static int |
DEFAULT_FOCUS_MAX_CASES
DEFAULT_FOCUS_MAX_CASES - the default value for how many case-comparisons are kept after the focus() method is run. |
static double |
DEFAULT_FOCUS_THRESHOLD
DEFAULT_FOCUS_THRESHOLD - the default minimum strength a case-comparison must have in order to be kept when the focus() method is run. |
protected Entity[] |
findingList
|
protected Case |
inputCase
The input case (the problem case description). |
protected int |
lastExplainMax
|
protected double |
lastExplainThreshold
|
protected int |
lastFocusMax
|
protected double |
lastFocusThreshold
|
static int |
RETRIEVE_STEP
The ID for the Retrieve step. |
Fields inherited from class jcreek.reasoning.CBRReasoningStep |
ACTIVATED_STATE, counter, counterMax, EXPLAINED_STATE, FOCUSED_STATE, INITIAL_STATE, km, state, updateListeners |
Constructor Summary | |
RetrieveResult(Case input)
Creates a RetrieveResult comparing the input case to all the solved cases in the casebase, and automatically runs activate(), explain() and focus(). |
|
RetrieveResult(Case input,
boolean auto)
Creates a RetriveResult comparing the input case to all the solved cases in the casebase. |
|
RetrieveResult(Case input,
Case[] compares,
boolean auto)
Creates a new RetriveResult, comparing the input case to the set of cases given in the compares set. |
Method Summary | |
void |
activate()
Runs the activate step of the Retrieve. |
void |
explain()
Runs the explain step using default values for max cases and threshold. |
void |
explain(int maxExplain,
double explainThreshold)
Runs the activate step of the Retrieve. |
void |
focus()
Shrinks the number of case-comparisons, using default values for the maximum number of cases to keep and for case-comparison threshold strength. |
void |
focus(int noCases,
double threshold)
Shrinks the number of case-comparisons. |
CaseComparison[] |
getAllComparisons()
Gives all case-comparisons, including those comparisons which has not been through the explain and focus steps. |
Case |
getBestCase()
Returns the case that is the best match for the input case. |
CaseComparison |
getBestComparison()
Gives the CaseComparison object that represents the best match with a solved case. |
CaseComparison |
getComparison(int i)
Gives the CaseComparison at the place specified. |
CaseComparison[] |
getComparisons()
Gives the set of CaseComparisons for the current reasoning step. |
Case |
getInputCase()
Returns the input case (problem case). |
int |
realsize()
Returns the number of case-comparisons created originally - i.e. before the numbers are reduced by explain() and focus(). |
void |
reset()
Resets the state of this RetrieveResult to the initial state. |
int |
size()
Returns the number of case-comparisons at this step in the Retrieve process. |
protected void |
sortComparisons()
Sorts the caseComparisons vector. |
java.lang.String |
toString()
Displays the RetrieveResult as a string. |
void |
update()
Updates the CaseComparisons if any changes are done in the knowledgemodel. |
Methods inherited from class jcreek.reasoning.CBRReasoningStep |
abort, addReasoningUpdateListener, getIteration, getIterationMax, getKnowledgeModel, getState, isAborted, isActivated, isExplained, isFocused, removeReasoningUpdateListener, setState |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Case inputCase
protected java.util.Vector caseComparisons
protected int caseComparisonSize
protected int lastExplainMax
protected double lastExplainThreshold
protected int lastFocusMax
protected double lastFocusThreshold
protected Entity[] findingList
public static final int RETRIEVE_STEP
public static int DEFAULT_EXPLAIN_MAX_CASES
public static double DEFAULT_EXPLAIN_THRESHOLD
public static int DEFAULT_FOCUS_MAX_CASES
public static double DEFAULT_FOCUS_THRESHOLD
Constructor Detail |
public RetrieveResult(Case input, Case[] compares, boolean auto)
input
- The input case (the new problem case description).compares
- The set of cases to compare the input case to.auto
- If true, the activate(), explain() and focus() methods are automatically run with default values.public RetrieveResult(Case input, boolean auto)
input
- The input case (the new problem case description).auto
- If true, the activate(), explain() and focus() methods are automatically run with default values.public RetrieveResult(Case input)
Method Detail |
public void reset()
reset
in class CBRReasoningStep
public void update()
update
in class CBRReasoningStep
protected void sortComparisons()
public void activate()
activate
in class CBRReasoningStep
public void explain(int maxExplain, double explainThreshold)
maxExplain
- The maximum number of case-comparisons to run the explain step on.
The case-comparisons with the highest strengths from the activate step is preferred.public void explain()
explain
in class CBRReasoningStep
public void focus(int noCases, double threshold)
noCases
- Max number of case-comparisons to keep.threshold
- All kept case-comparisons must have a strength of at least this value.public void focus()
focus
in class CBRReasoningStep
public CaseComparison[] getComparisons()
public CaseComparison[] getAllComparisons()
public CaseComparison getBestComparison()
public CaseComparison getComparison(int i)
public Case getInputCase()
public Case getBestCase()
public int size()
public int realsize()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |