|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.washington.cs.supple.render.utility.FactorConstraint
| Field Summary | |
protected int[] |
factorIndices
|
protected java.util.ArrayList |
factorNames
|
protected java.util.Hashtable |
factors
|
protected double[] |
factorValues
|
protected java.lang.String |
lhsWidgetName
|
protected java.lang.String |
rhsWidgetName
|
| Constructor Summary | |
|
FactorConstraint(Solution bad,
Solution good,
FactoredCostFunction costFunction)
|
protected |
FactorConstraint(java.lang.String lhsFactorName,
double lhsFactorValue,
java.lang.String rhsFactorName,
double rhsFactorValue)
|
|
FactorConstraint(SuppleType type,
UiObject uiObject,
java.util.Collection lhsFactors,
WidgetDescriptor lhsWidget,
java.util.Collection rhsFactors,
WidgetDescriptor rhsWidget)
|
| Method Summary | |
protected void |
addFactor(java.lang.String name,
double value,
boolean isBad)
|
protected void |
addFactor(SuppleType type,
UiObject uiObject,
WidgetDescriptor descriptor,
Factor factor,
boolean isBad)
|
protected void |
addFactors(SuppleType type,
UiObject uiObject,
WidgetDescriptor descriptor,
FactoredCostFunction costFunction,
boolean isBad)
|
static int |
containsEquivalentConstraint(java.util.Vector constraints,
FactorConstraint c)
Checks if a constraint equivalent to c exist in vector constraints. |
protected void |
ensureFactorIndices(FactoredCostFunctionState state)
|
protected double |
getConstraintValue(FactoredCostFunctionState state)
|
protected double |
getFactorCoefficient(java.lang.String name)
|
java.util.ArrayList |
getFactorNames()
Returns a list of names of factors involved in this constraint |
double |
getLikelihood(FactoredCostFunctionState state)
Returns the likelihood of a given state given this constraint |
double |
getTransitionPointForFactorWeight(java.lang.String factorName,
FactoredCostFunctionState state)
This method looks for the value for the weight for a factor with a given name that lies on the boundry of this constraint being satisfied or unsatisfied; all that assuming that other weights have values as represented by the state |
int |
hashCode()
|
boolean |
isEmpty()
Checks if there are any non-zero factors in this constraint |
boolean |
isEquivalent(FactorConstraint c)
Two constraints are equivalent if they correspond to the same factor and factor values |
boolean |
isFactorUsed(java.lang.String factorName)
Checks if a factor with a given name is involved in this constraint |
boolean |
isSatisfied(FactoredCostFunctionState state)
Checks if the state satisfied this constraint |
protected void |
setupConstraint(Solution soln,
FactoredCostFunction costFunction,
boolean isBad)
|
protected void |
setupConstraint(Solution bad,
Solution good,
FactoredCostFunction costFunction)
|
protected void |
setupConstraint(SuppleType type,
UiObject uiObject,
java.util.Collection lhsFactors,
WidgetDescriptor lhsWidget,
java.util.Collection rhsFactors,
WidgetDescriptor rhsWidget)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected transient int[] factorIndices
protected double[] factorValues
protected java.util.Hashtable factors
protected java.util.ArrayList factorNames
protected java.lang.String lhsWidgetName
protected java.lang.String rhsWidgetName
| Constructor Detail |
public FactorConstraint(SuppleType type,
UiObject uiObject,
java.util.Collection lhsFactors,
WidgetDescriptor lhsWidget,
java.util.Collection rhsFactors,
WidgetDescriptor rhsWidget)
public FactorConstraint(Solution bad,
Solution good,
FactoredCostFunction costFunction)
protected FactorConstraint(java.lang.String lhsFactorName,
double lhsFactorValue,
java.lang.String rhsFactorName,
double rhsFactorValue)
| Method Detail |
protected void setupConstraint(SuppleType type,
UiObject uiObject,
java.util.Collection lhsFactors,
WidgetDescriptor lhsWidget,
java.util.Collection rhsFactors,
WidgetDescriptor rhsWidget)
protected void setupConstraint(Solution bad,
Solution good,
FactoredCostFunction costFunction)
protected void setupConstraint(Solution soln,
FactoredCostFunction costFunction,
boolean isBad)
protected void addFactors(SuppleType type,
UiObject uiObject,
WidgetDescriptor descriptor,
FactoredCostFunction costFunction,
boolean isBad)
protected void addFactor(SuppleType type,
UiObject uiObject,
WidgetDescriptor descriptor,
Factor factor,
boolean isBad)
protected void addFactor(java.lang.String name,
double value,
boolean isBad)
public boolean isEmpty()
public boolean isFactorUsed(java.lang.String factorName)
factorName - the name of the factor
protected double getFactorCoefficient(java.lang.String name)
public double getLikelihood(FactoredCostFunctionState state)
state - a complete state
public boolean isSatisfied(FactoredCostFunctionState state)
state - the state to be checked
public double getTransitionPointForFactorWeight(java.lang.String factorName,
FactoredCostFunctionState state)
factorName - name of the factor corresponding to the weight we are
investigatingstate - the state of all the other weights
protected double getConstraintValue(FactoredCostFunctionState state)
protected void ensureFactorIndices(FactoredCostFunctionState state)
public java.util.ArrayList getFactorNames()
public int hashCode()
public java.lang.String toString()
public boolean isEquivalent(FactorConstraint c)
c -
public static int containsEquivalentConstraint(java.util.Vector constraints,
FactorConstraint c)
constraints - a vector of existing constraintsc - a constraint to be checked
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||