|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.kpro.algorithm.CBR
public class CBR
Case based reason. This is a working CBR class that handles process flow between init and shutdown. Should be easy to extend and overload various features, but should work for most cases as is.
Field Summary | |
---|---|
protected ConclusionAlgorithm |
conclusAlg
|
protected LearnAlgorithm |
learnAlg
|
protected ReductionAlgorithm |
reduceAlg
|
protected Gio |
theIO
|
protected java.util.Properties |
weightsConfig
|
Constructor Summary | |
---|---|
CBR(Gio theIO)
constructor that so we can call cbr.parse(string) |
|
CBR(Gio theIO,
java.util.Properties weightsConfig,
ReductionAlgorithm reduceAlg,
ConclusionAlgorithm conclusAlg,
LearnAlgorithm learnAlg)
Our generic constructor. |
Method Summary | |
---|---|
private ConclusionAlgorithm |
getConclusionAlgorihm(java.lang.String algorithm,
DistanceMetric dm)
Parse the conclusion algorithm substring into a ConclusionAlgorithm obejct with the right attributes and values. |
private DistanceMetric |
getDistanceMetricAlgorithm(java.lang.String algorithm,
java.util.Properties weightsConfig)
Parse the distance metric substring into a DistanceMetric object with the right attributes and values. |
private LearnAlgorithm |
getLearnAlgorihm(java.lang.String algorithm,
java.util.Properties weightsConfig)
Parse the learning algorithm substring into a LearningAlgorithm obejct with the right attributes and values. |
private ReductionAlgorithm |
getReductionAlgorithm(java.lang.String algorithm,
DistanceMetric dm,
PolicyDatabase pdb)
Parse the reduction algorithm substring into a ReductionAlgorithm object with the right attributes and values. |
CBR |
parse(java.lang.String string)
Parses the CBR option to create the class and instantiate correct algorithms. |
private PolicyObject |
process(PolicyObject newPO)
Accepts a parsed PolicyObject that needs a action attached to it, and returns with the same object with an action in it. |
void |
run(PolicyObject newpol)
runs through CBR with selected algorithms |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Gio theIO
protected java.util.Properties weightsConfig
protected ReductionAlgorithm reduceAlg
protected ConclusionAlgorithm conclusAlg
protected LearnAlgorithm learnAlg
Constructor Detail |
---|
public CBR(Gio theIO, java.util.Properties weightsConfig, ReductionAlgorithm reduceAlg, ConclusionAlgorithm conclusAlg, LearnAlgorithm learnAlg)
theIO
- the GIO instanceweightsConfig
- the weights to use for distance metric & learning algorithmreduceAlg
- the retrival algorithm- produce relevent cases from historyconclusAlg
- the 'reuse' algorithm- produces a solution from relevant caseslearnAlg
- the retain algorithm- modifies the 'weightsConfig' so the distance metric is more accuratepublic CBR(Gio theIO)
the
- io class/object/messMethod Detail |
---|
private PolicyObject process(PolicyObject newPO)
newPO
- the new policy to be processed
public void run(PolicyObject newpol)
newPolicy
- public CBR parse(java.lang.String string) throws java.lang.Exception
string
- the string from either configuration file or commandline
java.lang.Exception
private DistanceMetric getDistanceMetricAlgorithm(java.lang.String algorithm, java.util.Properties weightsConfig) throws java.lang.ClassNotFoundException
algorithm
- the string specifying which distancemetric algorithm to useweightsConfig
- the weightsConfiguration file (load this from Gio)
java.lang.ClassNotFoundException
private ReductionAlgorithm getReductionAlgorithm(java.lang.String algorithm, DistanceMetric dm, PolicyDatabase pdb) throws java.lang.ClassNotFoundException
algorithm
- the string specifying which reduction algorithm to use and number of relevant policies to include in format "algorithmName:k" where k is an integerdm
- the distance metric to usepdb
- the policy database to run on
java.lang.ClassNotFoundException
private ConclusionAlgorithm getConclusionAlgorihm(java.lang.String algorithm, DistanceMetric dm) throws java.lang.ClassNotFoundException
algorithm
- the string specifying which conclusion algorithm to usedm
- the distance metric to use
java.lang.ClassNotFoundException
private LearnAlgorithm getLearnAlgorihm(java.lang.String algorithm, java.util.Properties weightsConfig) throws java.lang.ClassNotFoundException
algorithm
- the string specifying which learning algorithm to useweightsConfig
- the weightsConfiguration file (load this from Gio)
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |