jcreek.representation.cbr
Class Case

java.lang.Object
  extended byjcreek.representation.Entity
      extended byjcreek.representation.EntityType
          extended byjcreek.representation.cbr.Case
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class Case
extends EntityType

A case is a particular type of entity that represents a case (in the Case- Based Reasoning sense).

Version:
1.0
Author:
Frode Sørmo

Field Summary
static int PROCESSCASE
           
static int SOLVEDCASE
           
static int UNSOLVEDCASE
           
 
Constructor Summary
Case(Entity ent)
          Creates a Case from an existing Entity.
Case(KnowledgeModel model, java.lang.String name, java.lang.String description)
          Creates a new Case.
Case(KnowledgeModel model, java.lang.String name, java.lang.String description, Entity caseType)
          Creates a new Case.
 
Method Summary
 Relation addFinding(java.lang.String relationType, Entity value, double importance, double predictiveStrength)
          Adds a Relation for a Case.
 Entity getSolution()
          Returns the solution of this Case.
 int getStatus()
          Returns the solved status of this Case
 java.lang.String getStatusString()
          Returns the solved status of this Case as an english string
static boolean matches(Entity ent)
          An Entity is a RelationType if and only if and only if it is an (indirect) subclass of the Relation object.
 void setSolution(Entity solution)
          Sets the solution of the case.
 void setStatus(int status)
           
 
Methods inherited from class jcreek.representation.Entity
addConstraint, addRelation, addRelation, addRelation, addRelation, addRelation, addRelation, clone, compareTo, equals, getAllSubclasses, getAllSubclassesCollection, getAllSuperclasses, getAllSuperclassesCollection, getConstraints, getCreationTime, getCurrentPartition, getDescription, getEntityData, getEntityObject, getFrameString, getID, getImmediateSubclasses, getImmediateSubclassesCollection, getImmediateSuperclasses, getImmediateSuperclassesCollection, getInheritedConstraints, getKnowledgeModel, getLocalConstraints, getLocalRelation, getLocalRelation, getLocalRelation, getLocalRelation, getLocalRelation, getLocalRelation, getLocalRelations, getLocalRelations, getLocalRelations, getLocalRelations, getLocalRelations, getName, getRelation, getRelation, getRelation, getRelation, getRelationNames, getRelations, getRelations, getRelations, getRelations, getRelations, getRelations, getRelations, getRelationTypes, getValueString, hasEntityObject, hashCode, isAssignableFrom, remove, removeConstraint, removeEntityData, setDescription, setEntityObject, setName, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SOLVEDCASE

public static final int SOLVEDCASE
See Also:
Constant Field Values

PROCESSCASE

public static final int PROCESSCASE
See Also:
Constant Field Values

UNSOLVEDCASE

public static final int UNSOLVEDCASE
See Also:
Constant Field Values
Constructor Detail

Case

public Case(KnowledgeModel model,
            java.lang.String name,
            java.lang.String description)
     throws NameAlreadyExistException
Creates a new Case.

Parameters:
model - The KnowledgeModel to create the new entity in.
name - The name of the case to create.
description - The description of the entity.

Case

public Case(KnowledgeModel model,
            java.lang.String name,
            java.lang.String description,
            Entity caseType)
     throws NameAlreadyExistException
Creates a new Case.

Parameters:
model - The KnowledgeModel to create the new entity in.
name - The name of the case to create.
description - The description of the entity.
caseType - The entity representing the type of case this is.

Case

public Case(Entity ent)
     throws EntityTypeNotMatchedException
Creates a Case from an existing Entity.

Method Detail

getStatus

public int getStatus()
Returns the solved status of this Case


getStatusString

public java.lang.String getStatusString()
Returns the solved status of this Case as an english string


getSolution

public Entity getSolution()
Returns the solution of this Case. If the case is unsolved or no solution is registered, null is returned.

Returns:
Entity

setSolution

public void setSolution(Entity solution)
Sets the solution of the case. A case may only have one solution using this method.

Parameters:
solution - The entity representing the solution of the case.

setStatus

public void setStatus(int status)

addFinding

public Relation addFinding(java.lang.String relationType,
                           Entity value,
                           double importance,
                           double predictiveStrength)
                    throws NoSuchRelationTypeException
Adds a Relation for a Case.

Added in the Case class for the ability to set Explanation and Predictive Strength in an easy manner.

Stein L. Tomassen (30-05-2002)

Parameters:
relationType - the name of relationtype.
value - the reference to the entity to create relation to.
importance - the importance strength for this relation
predictiveStrength - the predictive strength for this relation
Throws:
NoSuchRelationTypeException

matches

public static boolean matches(Entity ent)
An Entity is a RelationType if and only if and only if it is an (indirect) subclass of the Relation object.



Created at IDI, NTNU by the Artificial Intelligence and Learning group