Class SequenceVar


public class SequenceVar
extends PropagationBaseObject
A sequence variable is a variable whose domain is a set of possible
orderings of the interval variables. It allows ordering of tasks. It
has two sets of methods: ComputePossibleFirstsAndLasts(), which
returns the list of interval variables that can be ranked first or
last; and RankFirst/RankNotFirst/RankLast/RankNotLast, which can be
used to create the search decision.
  • Field Summary

    Fields inherited from class com.google.ortools.constraintsolver.BaseObject

    swigCMemOwn
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected SequenceVar​(long cPtr, boolean cMemoryOwn)  
      SequenceVar​(Solver s, IntervalVar[] intervals, IntVar[] nexts, java.lang.String name)  
  • Method Summary

    Modifier and Type Method Description
    void accept​(ModelVisitor visitor)
    Accepts the given visitor.
    void delete()  
    protected void finalize()  
    protected static long getCPtr​(SequenceVar obj)  
    IntervalVar interval​(int index)
    Returns the index_th interval of the sequence.
    IntVar next​(int index)
    Returns the next of the index_th interval of the sequence.
    void rankFirst​(int index)
    Ranks the index_th interval var first of all unranked interval
    vars.
    void rankLast​(int index)
    Ranks the index_th interval var first of all unranked interval
    vars.
    void rankNotFirst​(int index)
    Indicates that the index_th interval var will not be ranked first
    of all currently unranked interval vars.
    void rankNotLast​(int index)
    Indicates that the index_th interval var will not be ranked first
    of all currently unranked interval vars.
    void rankSequence​(int[] rank_first, int[] rank_last, int[] unperformed)
    Applies the following sequence of ranks, ranks first, then rank
    last.
    long size()
    Returns the number of interval vars in the sequence.
    java.lang.String toString()  

    Methods inherited from class com.google.ortools.constraintsolver.BaseObject

    getCPtr

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SequenceVar

      protected SequenceVar​(long cPtr, boolean cMemoryOwn)
    • SequenceVar

      public SequenceVar​(Solver s, IntervalVar[] intervals, IntVar[] nexts, java.lang.String name)
  • Method Details

    • getCPtr

      protected static long getCPtr​(SequenceVar obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class PropagationBaseObject
    • delete

      public void delete()
      Overrides:
      delete in class PropagationBaseObject
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class PropagationBaseObject
    • rankFirst

      public void rankFirst​(int index)
      Ranks the index_th interval var first of all unranked interval
      vars. After that, it will no longer be considered ranked.
    • rankNotFirst

      public void rankNotFirst​(int index)
      Indicates that the index_th interval var will not be ranked first
      of all currently unranked interval vars.
    • rankLast

      public void rankLast​(int index)
      Ranks the index_th interval var first of all unranked interval
      vars. After that, it will no longer be considered ranked.
    • rankNotLast

      public void rankNotLast​(int index)
      Indicates that the index_th interval var will not be ranked first
      of all currently unranked interval vars.
    • rankSequence

      public void rankSequence​(int[] rank_first, int[] rank_last, int[] unperformed)
      Applies the following sequence of ranks, ranks first, then rank
      last. rank_first and rank_last represents different directions.
      rank_first[0] corresponds to the first interval of the sequence.
      rank_last[0] corresponds to the last interval of the sequence.
      All intervals in the unperformed vector will be marked as such.
    • interval

      public IntervalVar interval​(int index)
      Returns the index_th interval of the sequence.
    • next

      public IntVar next​(int index)
      Returns the next of the index_th interval of the sequence.
    • size

      public long size()
      Returns the number of interval vars in the sequence.
    • accept

      public void accept​(ModelVisitor visitor)
      Accepts the given visitor.