Class AFCMin<T extends Var>

  • Type Parameters:
    T - type of variable being compared.
    All Implemented Interfaces:
    ComparatorVariable<T>

    public class AFCMin<T extends Var>
    extends java.lang.Object
    implements ComparatorVariable<T>
    Defines a AccumulatedFailureCount comparator (afc) for variables. Every time a constraint failure is encountered the constraint afc_weight is increased by one. All other constraints afc weight value is recalculated as afc_weight * decay. The comparator will choose the variable with the lowest afc_weight.
    Version:
    4.7
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private AFCMin()  
        AFCMin​(Store store)  
        AFCMin​(Store store, float decay)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) float afcValue​(Var v)  
      int compare​(float left, T var)
      It compares the baseline metric to the variable metric.
      int compare​(T leftVar, T rightVar)
      It compares the metric of the left variable against the right one.
      float metric​(T var)
      It returns the metric of the variable given according to the comparator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AFCMin

        private AFCMin()
      • AFCMin

        public AFCMin​(Store store)
      • AFCMin

        public AFCMin​(Store store,
                      float decay)
    • Method Detail

      • compare

        public int compare​(float left,
                           T var)
        Description copied from interface: ComparatorVariable
        It compares the baseline metric to the variable metric.
        Specified by:
        compare in interface ComparatorVariable<T extends Var>
        Parameters:
        left - the baseline for comparison.
        var - variable which is compared to baseline.
        Returns:
        1 if metric is larger than variable, 0 if equal, -1 if baseline is smaller.
      • compare

        public int compare​(T leftVar,
                           T rightVar)
        Description copied from interface: ComparatorVariable
        It compares the metric of the left variable against the right one.
        Specified by:
        compare in interface ComparatorVariable<T extends Var>
        Parameters:
        leftVar - left variable
        rightVar - right variable
        Returns:
        1 if metric for left variable is greater, 0 is they are equal, -1 if smaller.
      • metric

        public float metric​(T var)
        Description copied from interface: ComparatorVariable
        It returns the metric of the variable given according to the comparator.
        Specified by:
        metric in interface ComparatorVariable<T extends Var>
        Parameters:
        var - variable for which metric is computed.
        Returns:
        the metric of the variable according to the comparator.
      • afcValue

        float afcValue​(Var v)