edu.indiana.iucbrf.adaptation
Class WeightedMajorityAdapter

java.lang.Object
  extended by edu.indiana.iucbrf.adaptation.Adaptation
      extended by edu.indiana.iucbrf.adaptation.WeightedMajorityAdapter
All Implemented Interfaces:
java.io.Serializable

public class WeightedMajorityAdapter
extends Adaptation

This class adapts solutions based on a weighted majority vote of each feature. Values examined in the voting are those returned by the Solution class' doubleValue() method.

=== A note regarding weights in this framework ===
There are many different types of weights used in different parts of the framework:
- in adaptation.WeightedAverageAdapter and adaptation.WeightedMajorityAdapter - The adaptation weights in these classes determine how important each particular case is in the final adaptation.
- in adaptation.DistanceWeightedAdapter - Similar idea to WeightedAverageAdapter and WeightedMajorityAdapter, except that the weights change for each adaptation. The weight of a case is proportional to the similarity of that case to the current problem.
- in problem.Problem.weightedEuclideanDistance() - the weights sent to this method describe how important a particular feature is in determining similarity information.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.indiana.iucbrf.adaptation.Adaptation
debugMode, wts
 
Constructor Summary
WeightedMajorityAdapter()
          Construct a WeightedAverageAdapter without specifying the weights.
WeightedMajorityAdapter(double[] wts)
          Creates new WeightedMajorityAdapter
WeightedMajorityAdapter(double[] wts, boolean debugMode)
          Creates new WeightedMajorityAdapter
 
Method Summary
 Solution adaptTo(RetrievalResults retrieved, Problem currentProblem, Domain domain)
          Adapt retrieved solutions by taking a weighted majority vote.
 
Methods inherited from class edu.indiana.iucbrf.adaptation.Adaptation
setDebugMode, setWeights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeightedMajorityAdapter

public WeightedMajorityAdapter()
Construct a WeightedAverageAdapter without specifying the weights. The weights must be specified with setWeights() before the adapter is used.


WeightedMajorityAdapter

public WeightedMajorityAdapter(double[] wts)
Creates new WeightedMajorityAdapter

Parameters:
Wts - An array of doubles, of weights to be used by the majority adapter.

WeightedMajorityAdapter

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

Parameters:
Wts - An array of doubles, of weights to be used by the majority adapter.
debugMode - Set to true to print debugging information, false otherwise.
Method Detail

adaptTo

public Solution adaptTo(RetrievalResults retrieved,
                        Problem currentProblem,
                        Domain domain)
Adapt retrieved solutions by taking a weighted majority vote. The retrieved solutions may be any subclasses of Solution that define doubleValue().

Specified by:
adaptTo in class Adaptation
Parameters:
Retrieved - A RetrievalResults of Case objects deemed relevant to this problem
CurrentProblem - The Problem object being adapted to. In this implementation, this parameter is ignored.
Returns:
A Solution object of the adapted solution.