edu.washington.cs.supple.render.utility
Class FactoredCostConstraintGenerator
java.lang.Object
edu.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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
FactoredCostConstraintGenerator
public FactoredCostConstraintGenerator(CustomizationRequestEventDispatcher dispatcher)
FactoredCostConstraintGenerator
public FactoredCostConstraintGenerator(CustomizationRequestEventDispatcher dispatcher,
LearningEventDispatcher learningDispatcher)
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()