edu.washington.cs.supple.render.utility
Class FactoredCostConstraintGenerator

java.lang.Object
  extended byedu.washington.cs.supple.render.utility.FactoredCostConstraintGenerator
All Implemented Interfaces:
CustomizationRequestListener, java.util.EventListener, LearningEventListener

public class FactoredCostConstraintGenerator
extends java.lang.Object
implements CustomizationRequestListener, LearningEventListener

Author:
kgajos

Field Summary
protected  java.lang.String[] colNames
           
protected  java.util.Vector constraints
           
protected  java.util.Hashtable count
           
protected  FactoredCostFunction factoredCostFunction
           
protected  java.util.Vector factors
           
protected  java.util.Hashtable scaledCount
           
protected  double slackPenalty
           
 
Constructor Summary
FactoredCostConstraintGenerator(CustomizationRequestEventDispatcher dispatcher)
           
FactoredCostConstraintGenerator(CustomizationRequestEventDispatcher dispatcher, LearningEventDispatcher learningDispatcher)
           
 
Method Summary
protected  void addConstraint(FactorConstraint newConstraint)
           
 java.lang.String constraintsToString()
           
 int containsEquivalentConstraint(FactorConstraint c)
          Checks if a constraint equivalent to c has been collected already.
 void customizationRequested(CustomizationEvent ev)
           
protected  void ensureFactoredCostFunction()
           
 java.util.Vector getConstraints()
           
 double getCount(java.lang.String factorName)
           
 double getScaledCount(java.lang.String factorName)
           
 void learningEventDetected(SuppleEvent event)
           
protected  void updateCounts(FactorConstraint newConstraint)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factoredCostFunction

protected FactoredCostFunction factoredCostFunction

constraints

protected java.util.Vector constraints

slackPenalty

protected double slackPenalty

factors

protected java.util.Vector factors

colNames

protected java.lang.String[] colNames

count

protected java.util.Hashtable count

scaledCount

protected java.util.Hashtable scaledCount
Constructor Detail

FactoredCostConstraintGenerator

public FactoredCostConstraintGenerator(CustomizationRequestEventDispatcher dispatcher)

FactoredCostConstraintGenerator

public FactoredCostConstraintGenerator(CustomizationRequestEventDispatcher dispatcher,
                                       LearningEventDispatcher learningDispatcher)
Method Detail

customizationRequested

public void customizationRequested(CustomizationEvent ev)
Specified by:
customizationRequested in interface CustomizationRequestListener

learningEventDetected

public void learningEventDetected(SuppleEvent event)
Specified by:
learningEventDetected in interface LearningEventListener

addConstraint

protected void addConstraint(FactorConstraint newConstraint)

updateCounts

protected void updateCounts(FactorConstraint newConstraint)

getConstraints

public java.util.Vector getConstraints()

getCount

public double getCount(java.lang.String factorName)

getScaledCount

public double getScaledCount(java.lang.String factorName)

containsEquivalentConstraint

public int containsEquivalentConstraint(FactorConstraint c)
Checks if a constraint equivalent to c has been collected already.

Parameters:
c -
Returns:
an integer indicating how many constraints ago this particular constraint (or one equivalent to it) was registered

ensureFactoredCostFunction

protected void ensureFactoredCostFunction()

constraintsToString

public java.lang.String constraintsToString()