|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.indiana.iucbrf.casebase.AbstractCaseBase edu.indiana.iucbrf.casebase.PartitionedCaseBase
public class PartitionedCaseBase
A partitioned case base is one in which the cases are partitioned into equivalence classes, for example as a result of k-medoid clustering.
Nested Class Summary | |
---|---|
protected class |
PartitionedCaseBase.CBArrayIterator
|
Field Summary | |
---|---|
protected CaseBase[] |
caseBases
|
protected ProblemDifferentiator |
differentiator
|
protected Case[] |
prototypes
|
Fields inherited from class edu.indiana.iucbrf.casebase.AbstractCaseBase |
---|
caseClass, debugMode, DEFAULT_INITIAL_CAPACITY, domain, listeners, prototype |
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable |
---|
TITLE_FONT |
Constructor Summary | |
---|---|
PartitionedCaseBase(CaseBase allCaseCB,
int k,
ProblemDifferentiator differentiator)
|
|
PartitionedCaseBase(CaseBase allCaseCB,
java.lang.String baseFilename,
int numEqClasses,
ProblemDifferentiator differentiator)
|
|
PartitionedCaseBase(Partition partition)
Creates a new instance of PartitionedCaseBase |
Method Summary | |
---|---|
protected long |
addCaseImpl(Case caseToAdd)
Implement this method to add a case to the case base, assuming that class and event issues are already handled by addCase(). |
protected double |
calcAvgDist(int classID,
Problem p)
Finds nearest eq class, not by simply comparing to prototypes, but by a Bayesian process. |
protected int |
calcNumConsistentInClass(int classID,
Problem p,
ProblemDifferentiator pd)
|
protected void |
customReadPartitionFromFile(CaseBase allCaseCB,
java.lang.String baseFilename,
int cbIndex)
|
void |
customWriteToFile(java.lang.String baseFilename)
The first entry in each file is the prototype |
void |
ensureCapacity(int minimumCapacity)
Prepare the case base to be able to hold at least minCapacity cases. |
int |
findBayesianNearestCaseEqClass(Case c,
ProblemDifferentiator pd)
Finds nearest eq class, not by simply comparing to prototypes, but by a Bayesian process. |
int |
findBayesianNearestCaseEqClass(Problem p,
ProblemDifferentiator pd)
Finds nearest eq class, not by simply comparing to prototypes, but by a Bayesian process. |
int |
findNearestCaseEqClass(Case c)
|
int |
findNearestCaseEqClass(Problem p)
|
int |
getCaseCount()
Gets the number of cases in this list |
CaseBase |
getCB(int classID)
|
ProblemDifferentiator |
getDifferentiator()
|
int |
getEqClassCount()
|
protected void |
initializeCB(int initialCapacity)
|
boolean |
isEmpty()
Returns true if this case base is empty, false otherwise. |
java.util.Iterator |
iterator()
Create an iterator on the case base. |
protected boolean |
removeCaseImpl(Case c)
|
java.lang.String |
toString()
Convert this case base to a string representation. |
Methods inherited from class edu.indiana.iucbrf.casebase.AbstractCaseBase |
---|
addCase, addCaseBaseListener, addCases, addCases, addCases, buildCaseJList, checkCaseType, classMemberIterator, clearAllEstimates, close, fireCaseAdded, fireCaseClassChanged, fireCaseRemoved, fireCaseReplaced, fireCasesCleared, getCaseClass, getCasesMatching, getDomain, getPrototype, removeCase, removeCaseBaseListener, setBaseFileName, setCaseClass, setDebugMode, setDomain, toSwing, toSwing, toVerboseString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ProblemDifferentiator differentiator
protected Case[] prototypes
protected CaseBase[] caseBases
Constructor Detail |
---|
public PartitionedCaseBase(CaseBase allCaseCB, java.lang.String baseFilename, int numEqClasses, ProblemDifferentiator differentiator)
public PartitionedCaseBase(CaseBase allCaseCB, int k, ProblemDifferentiator differentiator)
public PartitionedCaseBase(Partition partition)
Method Detail |
---|
public ProblemDifferentiator getDifferentiator()
public CaseBase getCB(int classID)
public int getEqClassCount()
protected long addCaseImpl(Case caseToAdd)
AbstractCaseBase
addCaseImpl
in class AbstractCaseBase
public void ensureCapacity(int minimumCapacity)
AbstractCaseBase
ensureCapacity
in interface CaseBase
ensureCapacity
in class AbstractCaseBase
public int getCaseCount()
protected void initializeCB(int initialCapacity)
initializeCB
in class AbstractCaseBase
public boolean isEmpty()
isEmpty
in interface CaseBase
isEmpty
in class AbstractCaseBase
protected boolean removeCaseImpl(Case c)
removeCaseImpl
in class AbstractCaseBase
public int findNearestCaseEqClass(Case c)
public int findNearestCaseEqClass(Problem p)
public int findBayesianNearestCaseEqClass(Case c, ProblemDifferentiator pd)
c
- Casepd
- ProblemDifferentiator The special pd to use for Bayesian calculations. Not forced to be same as this.differentiator.
public int findBayesianNearestCaseEqClass(Problem p, ProblemDifferentiator pd)
p
- Problempd
- ProblemDifferentiator The special pd to use for Bayesian calculations. Not forced to be same as this.differentiator.
protected double calcAvgDist(int classID, Problem p)
p
- Problempd
- ProblemDifferentiator The special pd to use for Bayesian calculations. Not forced to be same as this.differentiator.
protected int calcNumConsistentInClass(int classID, Problem p, ProblemDifferentiator pd)
public java.util.Iterator iterator() throws java.lang.UnsupportedOperationException
iterator
in interface CaseBase
iterator
in class AbstractCaseBase
java.lang.UnsupportedOperationException
public java.lang.String toString()
toString
in interface CaseBase
toString
in class AbstractCaseBase
public void customWriteToFile(java.lang.String baseFilename)
protected void customReadPartitionFromFile(CaseBase allCaseCB, java.lang.String baseFilename, int cbIndex)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |