edu.indiana.iucbrf.maintenance
Class Maintenance

java.lang.Object
  extended by edu.indiana.iucbrf.maintenance.Maintenance
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AlwaysAddMaintenance, NullMaintenance, ThresholdBasedAdditionMaintenance, UnusedRemovedMaintenance

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

The base Maintenance class, which can be extended to provide details of maintenance.

See Also:
Serialized Form

Field Summary
protected  int checkRemoveFrequency
           
 
Constructor Summary
Maintenance()
          Creates new Maintenance
 
Method Summary
 int getCheckRemoveFrequency()
          Get the frequency of the checks for case removal.
 void removeUnneededCases(CaseBase CB, PerformanceMonitor monitor)
          Remove unneeded cases from the case base, if shouldRemoveCase() returns true for that case.
 void setCheckRemoveFrequency(int checkRemoveFrequency)
           
abstract  boolean shouldAddCase(Case currentCase, SolutionQuality quality, RetrievalResults retrieved, CaseBase CB, PerformanceMonitor monitor)
          Determine whether or not a case should be added to the case base.
abstract  boolean shouldRemoveCase(Case currentCase, CaseBase CB, PerformanceMonitor monitor)
          Determine whether or not a case should be removed from the case base.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkRemoveFrequency

protected int checkRemoveFrequency
Constructor Detail

Maintenance

public Maintenance()
Creates new Maintenance

Method Detail

removeUnneededCases

public void removeUnneededCases(CaseBase CB,
                                PerformanceMonitor monitor)
Remove unneeded cases from the case base, if shouldRemoveCase() returns true for that case. If it is known that the system will never need to remove cases in regular periodic intervals, then for efficiency reasons this method should be overridden to do nothing.

Parameters:
CB - The case base which is scheduled for maintenance.

shouldRemoveCase

public abstract boolean shouldRemoveCase(Case currentCase,
                                         CaseBase CB,
                                         PerformanceMonitor monitor)
Determine whether or not a case should be removed from the case base.


shouldAddCase

public abstract boolean shouldAddCase(Case currentCase,
                                      SolutionQuality quality,
                                      RetrievalResults retrieved,
                                      CaseBase CB,
                                      PerformanceMonitor monitor)
Determine whether or not a case should be added to the case base.


setCheckRemoveFrequency

public void setCheckRemoveFrequency(int checkRemoveFrequency)

getCheckRemoveFrequency

public int getCheckRemoveFrequency()
Get the frequency of the checks for case removal. For frequency f, cases are tested for removal after solving every fth problem.