edu.indiana.iucbrf.adaptation
Class Adaptation

java.lang.Object
  extended by edu.indiana.iucbrf.adaptation.Adaptation
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DistanceWeightedAdapter, NullAdapter, RealtorAdapter, WeightedAverageAdapter, WeightedMajorityAdapter

public abstract class Adaptation
extends java.lang.Object
implements java.io.Serializable

This abstract class is a super class to all adaptation classes. It describes, in a given domain, how to adapt a ArrayList of retrieved cases into a solution for a given problem.

See Also:
Serialized Form

Field Summary
protected  boolean debugMode
          When true, debugging information is printed to the screen.
protected  double[] wts
          An array of doubles, describing the weights (relative importance), starting with the most similar case retrieved.
 
Constructor Summary
Adaptation()
          Creates new Adaptation.
Adaptation(boolean debugMode)
          Creates new Adaptation
Adaptation(double[] wts, boolean debugMode)
          Creates new Adaptation
 
Method Summary
abstract  Solution adaptTo(RetrievalResults retrieved, Problem currentProblem, Domain domain)
          This abstract method adapts retrieved cases to solve the given problem.
 void setDebugMode(boolean debugMode)
          Set the debug mode to true to see debugging messages during program execution.
 void setWeights(double[] wts)
          Set the weights according to the provided array of doubles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wts

protected double[] wts
An array of doubles, describing the weights (relative importance), starting with the most similar case retrieved. If weights are not specified for the worst retrieved cases (that is, the Retrieved ArrayList has a larger size than the Wts ArrayList), then the weight is defined as 0. If more weights are specified than cases are retrieved, then the extra weights are ignored.


debugMode

protected boolean debugMode
When true, debugging information is printed to the screen. Default is false.

Constructor Detail

Adaptation

public Adaptation()
Creates new Adaptation. debugMode is set to false.


Adaptation

public Adaptation(boolean debugMode)
Creates new Adaptation

Parameters:
debugMode - Set to true to print debugging information, false otherwise.

Adaptation

public Adaptation(double[] wts,
                  boolean debugMode)
Creates new Adaptation

Parameters:
The - similarity weights to be used in adaptation.
debugMode - Set to true to print debugging information, false otherwise.
Method Detail

adaptTo

public abstract Solution adaptTo(RetrievalResults retrieved,
                                 Problem currentProblem,
                                 Domain domain)
This abstract method adapts retrieved cases to solve the given problem. It is assumed that if ranking knowledge of the Retrieved cases exists, then the cases appear in order from most applicable to least applicable in the Retrieved ArrayList.

Parameters:
retrieved - RetrievalResults of cases retrieved that are relevant to the solution.
currentProblem - The Problem object being adapted to. In some adaptation implementations, this parameter may be ignored.
domain - The domain in which the adaptation is taking place.
Returns:
Solution object of the adapted solution.

setWeights

public void setWeights(double[] wts)
Set the weights according to the provided array of doubles.


setDebugMode

public void setDebugMode(boolean debugMode)
Set the debug mode to true to see debugging messages during program execution.