Class CumulativePrimary


  • class CumulativePrimary
    extends Constraint
    CumulativePrimary implements the cumulative constraint using time tabling algorithm.
    Version:
    4.7
    • Field Detail

      • idNumber

        private static java.util.concurrent.atomic.AtomicInteger idNumber
      • start

        private final IntVar[] start
        start times of tasks
      • dur

        private final int[] dur
        All durations and resources of the constraint
      • res

        private final int[] res
      • activeMap

        private int[] activeMap
      • activePnt

        private TimeStamp<java.lang.Integer> activePnt
      • limit

        public final IntVar limit
        It specifies the limit of the profile of cumulative use of resources.
    • Constructor Detail

      • CumulativePrimary

        public CumulativePrimary​(IntVar[] starts,
                                 int[] durations,
                                 int[] resources,
                                 IntVar limit)
        It creates a cumulative constraint.
        Parameters:
        starts - variables denoting starts of the tasks.
        durations - variables denoting durations of the tasks.
        resources - variables denoting resource usage of the tasks.
        limit - the overall limit of resources which has to be used.
      • CumulativePrimary

        public CumulativePrimary​(java.util.List<? extends IntVar> starts,
                                 java.util.List<? extends java.lang.Integer> durations,
                                 java.util.List<? extends java.lang.Integer> resources,
                                 IntVar limit)
        It creates a cumulative constraint.
        Parameters:
        starts - variables denoting starts of the tasks.
        durations - variables denoting durations of the tasks.
        resources - variables denoting resource usage of the tasks.
        limit - the overall limit of resources which has to be used.
    • 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.
        Specified by:
        consistency in class Constraint
        Parameters:
        store - constraint store within which the constraint consistency is being checked.
      • toString

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

        void sweepPruning​(Store store)
      • removeNotUsedProfleTasks

        private void removeNotUsedProfleTasks()
      • swap

        private void swap​(int i,
                          int j)