Class LinearIntDom

  • All Implemented Interfaces:
    SatisfiedPresent, StoreAware

    public class LinearIntDom
    extends LinearInt
    LinearIntDom constraint implements the weighted summation over several variables.

    sum(i in 1..N)(ai*xi) = b

    It provides the weighted sum from all variables on the list. The weights are integers. Domain consistency is used.

    Version:
    4.8
    • Field Detail

      • idNumber

        static java.util.concurrent.atomic.AtomicInteger idNumber
      • support

        IntervalDomain[] support
        Defines support (valid values) for each variable
      • assignments

        int[] assignments
        Collects support (valid assignments) for variables
      • limitDomainPruning

        double limitDomainPruning
        Limit on the product of sizes of domains when domain consistency is carried out.
    • Constructor Detail

      • LinearIntDom

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

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

        @Deprecated
        public LinearIntDom​(Store store,
                            java.util.List<? extends IntVar> variables,
                            java.util.List<java.lang.Integer> weights,
                            java.lang.String rel,
                            int sum)
        Deprecated.
        LinearIntDom constraint does not use Store parameter any longer.
        It constructs the constraint LinearIntDom.
        Parameters:
        store - current store
        variables - variables which are being multiplied by weights.
        weights - weight for each variable.
        rel - the relation, one of "==", "<", ">", "<=", ">=", "!="
        sum - variable containing the sum of weighted variables.
      • LinearIntDom

        public LinearIntDom​(IntVar[] list,
                            int[] weights,
                            java.lang.String rel,
                            int sum)
        It constructs the constraint LinearIntDom.
        Parameters:
        list - variables which are being multiplied by weights.
        weights - weight for each variable.
        rel - the relation, one of "==", "<", ">", "<=", ">=", "!="
        sum - the sum of weighted variables.
      • LinearIntDom

        public LinearIntDom​(IntVar[] list,
                            int[] weights,
                            java.lang.String rel,
                            IntVar sum)
        It constructs the constraint LinearIntDom.
        Parameters:
        list - variables which are being multiplied by weights.
        weights - weight for each variable.
        rel - the relation, one of "==", "<", ">", "<=", ">=", "!="
        sum - variable containing the sum of weighted variables.
      • LinearIntDom

        public LinearIntDom​(java.util.List<? extends IntVar> variables,
                            java.util.List<java.lang.Integer> weights,
                            java.lang.String rel,
                            int sum)
        It constructs the constraint LinearIntDom.
        Parameters:
        variables - variables which are being multiplied by weights.
        weights - weight for each variable.
        rel - the relation, one of "==", "<", ">", "<=", ">=", "!="
        sum - variable containing the sum of weighted variables.
    • Method Detail

      • consistency

        public void consistency​(Store store)
        Description copied from class: Constraint
        It is a (most probably incomplete) consistency function which removes the values from variables domains. Only values which do not have any support in a solution space are removed.
        Overrides:
        consistency in class LinearInt
        Parameters:
        store - constraint store within which the constraint consistency is being checked.
      • notConsistency

        public void notConsistency​(Store store)
        Description copied from class: PrimitiveConstraint
        It makes pruning in such a way that constraint is notConsistent. It removes values which always belong to a solution.
        Overrides:
        notConsistency in class LinearInt
        Parameters:
        store - the constraint store in which context the notConsistency technique is evaluated.
      • propagate

        public void propagate​(int rel)
        Overrides:
        propagate in class LinearInt
      • domainSize

        double domainSize()
      • pruneEq

        void pruneEq()
      • findSupport

        void findSupport​(int index,
                         long sum)
      • findSupportPositive

        void findSupportPositive​(int index,
                                 long partialSum)
      • findSupportNegative

        void findSupportNegative​(int index,
                                 long partialSum)
      • toString

        public java.lang.String toString()
        Description copied from class: Constraint
        It produces a string representation of a constraint state.
        Overrides:
        toString in class LinearInt