Class CumulativeUnary


  • public class CumulativeUnary
    extends Cumulative
    CumulativeUnary implements the scheduling constraint for unary resources using

    overload, not-first-not-last and detectable algorithms based on

    Petr Vilim, "O(n log n) Filtering Algorithms for Unary Resource Constraints", Proceedings of CP-AI-OR 2004,

    Version:
    4.8
    • Field Detail

      • doProfile

        private boolean doProfile
      • tvn

        private final TaskView[] tvn
        Local copies of tasks in normal and reserved views
      • taskIncLctComparator

        private java.util.Comparator<TaskView> taskIncLctComparator
      • taskIncLstComparator

        private java.util.Comparator<TaskView> taskIncLstComparator
      • taskIncEctComparator

        private java.util.Comparator<TaskView> taskIncEctComparator
    • Constructor Detail

      • CumulativeUnary

        public CumulativeUnary​(IntVar[] starts,
                               IntVar[] durations,
                               IntVar[] 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.
      • CumulativeUnary

        public CumulativeUnary​(IntVar[] starts,
                               IntVar[] durations,
                               IntVar[] resources,
                               IntVar limit,
                               boolean doProfile)
        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.
        doProfile - defines whether to do profile-based propagation (true) or not (false); default is false
      • CumulativeUnary

        public CumulativeUnary​(java.util.List<? extends IntVar> starts,
                               java.util.List<? extends IntVar> durations,
                               java.util.List<? extends IntVar> 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.
      • CumulativeUnary

        public CumulativeUnary​(java.util.List<? extends IntVar> starts,
                               java.util.List<? extends IntVar> durations,
                               java.util.List<? extends IntVar> resources,
                               IntVar limit,
                               boolean doProfile)
        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.
        doProfile - defines whether to do profile-based propagation (true) or not (false); default is false
    • 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 Cumulative
        Parameters:
        store - constraint store within which the constraint consistency is being checked.
      • overload

        private void overload​(TaskView[] ts)
      • notFirstNotLastPhase

        private void notFirstNotLastPhase​(Store store,
                                          TaskView[] tc)
      • detectablePhase

        private void detectablePhase​(Store store,
                                     TaskView[] tc)
      • edgeFindPhase

        private void edgeFindPhase​(Store store,
                                   TaskView[] tc)
      • toString

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