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.10
  • Field Details

    • idNumber

      static 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 Details

    • LinearIntDom

      @Deprecated public LinearIntDom(Store store, IntVar[] list, int[] weights, 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, 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, List<? extends IntVar> variables, List<Integer> weights, 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, 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, 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(List<? extends IntVar> variables, List<Integer> weights, 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 Details

    • 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()
    • pruneNeq

      void pruneNeq()
      Overrides:
      pruneNeq in class LinearInt
    • findSupport

      void findSupport(int index, long sum)
    • findSupportPositive

      void findSupportPositive(int index, long partialSum)
    • findSupportNegative

      void findSupportNegative(int index, long partialSum)
    • getDefaultNestedConsistencyPruningEvent

      protected int getDefaultNestedConsistencyPruningEvent()
      Overrides:
      getDefaultNestedConsistencyPruningEvent in class LinearInt
    • getDefaultNestedNotConsistencyPruningEvent

      protected int getDefaultNestedNotConsistencyPruningEvent()
      Overrides:
      getDefaultNestedNotConsistencyPruningEvent in class LinearInt
    • getDefaultConsistencyPruningEvent

      public int getDefaultConsistencyPruningEvent()
      Overrides:
      getDefaultConsistencyPruningEvent in class LinearInt
    • getDefaultNotConsistencyPruningEvent

      protected int getDefaultNotConsistencyPruningEvent()
      Overrides:
      getDefaultNotConsistencyPruningEvent in class LinearInt
    • toString

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