Class SumFloat

  • All Implemented Interfaces:
    SatisfiedPresent, StoreAware, UsesQueueVariable

    public class SumFloat
    extends LinearFloat
    SumFloat constraint implements the weighted summation over several Variable's . It provides the weighted sum from all Variable's on the list.

    This version works as argument to Reified and Xor constraints. For other constraints And, Or, Not, Eq, IfThen, IfThenElse it does not work currently.

    Version:
    4.7
    • Constructor Detail

      • SumFloat

        @Deprecated
        public SumFloat​(Store store,
                        FloatVar[] list,
                        java.lang.String rel,
                        FloatVar sum)
        Deprecated.
        SumFloat constraint does not use Store parameter any longer.
        Parameters:
        store - current store
        list - variables which are being multiplied by weights.
        rel - the relation, one of "==", "<", ">", "<=", ">=", "!="
        sum - variable containing the sum of weighted variables.
      • SumFloat

        public SumFloat​(FloatVar[] list,
                        java.lang.String rel,
                        FloatVar sum)
        Parameters:
        list - variables which are being multiplied by weights.
        rel - the relation, one of "==", "<", ">", "<=", ">=", "!="
        sum - variable containing the sum of weighted variables.
    • Method Detail

      • getFilledArray

        private static double[] getFilledArray​(int n)