Class SequenceVar
java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.PropagationBaseObject
com.google.ortools.constraintsolver.SequenceVar
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.
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
ConstructorsConstructorDescriptionSequenceVar(long cPtr, boolean cMemoryOwn) SequenceVar(Solver s, IntervalVar[] intervals, IntVar[] nexts, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ModelVisitor visitor) Accepts the given visitor.voiddelete()protected voidfinalize()static longgetCPtr(SequenceVar obj) interval(int index) Returns the index_th interval of the sequence.next(int index) Returns the next of the index_th interval of the sequence.voidrankFirst(int index) Ranks the index_th interval var first of all unranked interval
vars.voidrankLast(int index) Ranks the index_th interval var first of all unranked interval
vars.voidrankNotFirst(int index) Indicates that the index_th interval var will not be ranked first
of all currently unranked interval vars.voidrankNotLast(int index) Indicates that the index_th interval var will not be ranked first
of all currently unranked interval vars.voidrankSequence(int[] rank_first, int[] rank_last, int[] unperformed) Applies the following sequence of ranks, ranks first, then rank
last.longsize()Returns the number of interval vars in the sequence.static longswigRelease(SequenceVar obj) toString()Methods inherited from class com.google.ortools.constraintsolver.PropagationBaseObject
baseName, enqueueDelayedDemon, enqueueVar, freezeQueue, getCPtr, hasName, name, reset_action_on_fail, set_variable_to_clean_on_fail, setName, solver, swigRelease, unfreezeQueueMethods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, swigRelease
-
Constructor Details
-
SequenceVar
public SequenceVar(long cPtr, boolean cMemoryOwn) -
SequenceVar
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalizein classPropagationBaseObject
-
delete
public void delete()- Overrides:
deletein classPropagationBaseObject
-
toString
- Overrides:
toStringin classPropagationBaseObject
-
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
Returns the index_th interval of the sequence. -
next
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
Accepts the given visitor.
-