|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.reasoning.CBRReasoningStep
jcreek.reasoning.ReuseResult
Title: ReuseResult
Description: Uses the cases retrieved by a RetrieveResult object to select a solultion. This class uses the kNN algorithm, using the distance as votes for k nearest neighbours.
Field Summary | |
protected boolean |
defaultK
|
protected int |
k
|
protected RetrieveResult |
retrieve
|
static int |
REUSE_STEP
The ID for the Reuse step. |
protected Entity[] |
solutions
|
protected java.util.Hashtable |
solutionStrength
|
Fields inherited from class jcreek.reasoning.CBRReasoningStep |
ACTIVATED_STATE, counter, counterMax, EXPLAINED_STATE, FOCUSED_STATE, INITIAL_STATE, km, state, updateListeners |
Constructor Summary | |
ReuseResult(RetrieveResult retrieve)
Creates a new ReuseResult object, using the the focused cases of the RetrieveResult to vote on a solution. |
|
ReuseResult(RetrieveResult retrieve,
int k)
Creates a new ReuseResult object, using k first cases of the RetrieveResult to vote on a solution. |
|
ReuseResult(RetrieveResult retrieve,
int k,
boolean automatic)
Creates a new ReuseResult object, using k first cases of the RetrieveResult to vote on a solution. |
Method Summary | |
void |
activate()
Activate: Retrieves the solution of the k best cases and vote |
void |
explain()
Explain step: Currently does nothing. |
void |
focus()
Focus step: Currently does nothing. |
Case |
getCase(int i)
Returns the matched cases used to vote on the solution. |
Case[] |
getCasesForSolution(int solutionNumber)
Returns the cases supporting the given solution. |
double |
getCaseStrength(int i)
|
SubModel |
getCausalModel(int solutionNumber)
Returns a SubModel that contains all findings of the input case and all relations that is included in an explanation path for any inherited causal relation to the solution, as well as the solution itself. |
Case |
getInputCase()
Returns the input case (problem description). |
int |
getK()
Returns how many of the cases are used to vote on the solution. |
RetrieveResult |
getRetrieveResult()
Returns the RetrieveResult object used as a prerequisite for this ReuseResult object. |
Entity |
getSolution()
Returns the solution selected. |
Entity |
getSolution(int i)
Returns the i best solution found. |
double |
getSolutionStrength(Entity ent)
Returns the (non-normalized) strength of the votes solution ent have recieved. |
double |
getSolutionStrength(int i)
Returns the (non-normalized) strength of the votes solution no i have recieved. |
void |
reset()
Resets to the initial state. |
int |
size()
|
java.lang.String |
toString()
Returns a string saying what solution is chosen. |
void |
update()
Updates the solutions (e.g. 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 RetrieveResult retrieve
protected int k
protected boolean defaultK
protected java.util.Hashtable solutionStrength
protected Entity[] solutions
public static final int REUSE_STEP
Constructor Detail |
public ReuseResult(RetrieveResult retrieve, int k, boolean automatic)
retrieve
- The retrieved set of cases to reuse.k
- How many of the best retrieved cases to use when selecting a solution.automatic
- If true, activate, explain and focus is automatically run when constructed.public ReuseResult(RetrieveResult retrieve, int k)
retrieve
- The retrieved set of cases to reuse.k
- How many of the best retrieved cases to use when selecting a solution.public ReuseResult(RetrieveResult retrieve)
Method Detail |
public RetrieveResult getRetrieveResult()
public int getK()
public Case getInputCase()
public Case getCase(int i)
public double getCaseStrength(int i)
public void reset()
reset
in class CBRReasoningStep
public void activate()
activate
in class CBRReasoningStep
public void explain()
explain
in class CBRReasoningStep
public void focus()
focus
in class CBRReasoningStep
public void update()
update
in class CBRReasoningStep
public Case[] getCasesForSolution(int solutionNumber)
solutionNumber
- The solution number
public Entity getSolution()
public Entity getSolution(int i)
i
- The number solution (i.e. no 1 is the best, 2 is second best etc.)
public double getSolutionStrength(int i)
i
- The ith solution (from the best to the worst).
public double getSolutionStrength(Entity ent)
ent
- The Entity representing the solution.
public int size()
public SubModel getCausalModel(int solutionNumber)
solutionNumber
- The solution number to provide a causal model for
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |