Class IntervalVar
java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.PropagationBaseObject
com.google.ortools.constraintsolver.IntervalVar
Interval variables are often used in scheduling. The main characteristics
of an IntervalVar are the start position, duration, and end
date. All these characteristics can be queried and set, and demons can
be posted on their modifications.
An important aspect is optionality: an IntervalVar can be performed or not.
If unperformed, then it simply does not exist, and its characteristics
cannot be accessed any more. An interval var is automatically marked
as unperformed when it is not consistent anymore (start greater
than end, duration < 0...)
of an IntervalVar are the start position, duration, and end
date. All these characteristics can be queried and set, and demons can
be posted on their modifications.
An important aspect is optionality: an IntervalVar can be performed or not.
If unperformed, then it simply does not exist, and its characteristics
cannot be accessed any more. An interval var is automatically marked
as unperformed when it is not consistent anymore (start greater
than end, duration < 0...)
-
Field Summary
Fields inherited from class com.google.ortools.constraintsolver.BaseObject
swigCMemOwn
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ModelVisitor visitor) Accepts the given visitor.boolean
void
delete()
long
long
These methods query, set, and watch the duration of the interval var.endExpr()
long
endMax()
long
endMin()
These methods query, set, and watch the end position of the interval var.protected void
finalize()
static long
getCPtr
(IntervalVar obj) static long
The largest acceptable value to be returned by EndMax()static long
The smallest acceptable value to be returned by StartMin()boolean
boolean
boolean
These methods query, set, and watch the performed status of the
interval var.long
long
long
long
long
long
safeDurationExpr
(long unperformed_value) safeEndExpr
(long unperformed_value) safeStartExpr
(long unperformed_value) These methods create expressions encapsulating the start, end
and duration of the interval var.void
setDurationMax
(long m) void
setDurationMin
(long m) void
setDurationRange
(long mi, long ma) void
setEndMax
(long m) void
setEndMin
(long m) void
setEndRange
(long mi, long ma) void
setPerformed
(boolean val) void
setStartMax
(long m) void
setStartMin
(long m) void
setStartRange
(long mi, long ma) These methods create expressions encapsulating the start, end
and duration of the interval var.long
startMax()
long
startMin()
These methods query, set, and watch the start position of the
interval var.static long
swigRelease
(IntervalVar obj) boolean
void
Attaches a demon awakened when anything about this interval changes.void
whenAnything
(Runnable closure) Attaches a closure awakened when anything about this interval changes.void
void
whenDurationBound
(Runnable closure) void
void
whenDurationRange
(Runnable closure) void
void
whenEndBound
(Runnable closure) void
void
whenEndRange
(Runnable closure) void
void
whenPerformedBound
(Runnable closure) void
void
whenStartBound
(Runnable closure) void
void
whenStartRange
(Runnable closure) 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, toString, unfreezeQueue
Methods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, swigRelease
-
Constructor Details
-
IntervalVar
public IntervalVar(long cPtr, boolean cMemoryOwn)
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classPropagationBaseObject
-
delete
public void delete()- Overrides:
delete
in classPropagationBaseObject
-
getKMinValidValue
public static long getKMinValidValue()The smallest acceptable value to be returned by StartMin() -
getKMaxValidValue
public static long getKMaxValidValue()The largest acceptable value to be returned by EndMax() -
startMin
public long startMin()These methods query, set, and watch the start position of the
interval var. -
startMax
public long startMax() -
setStartMin
public void setStartMin(long m) -
setStartMax
public void setStartMax(long m) -
setStartRange
public void setStartRange(long mi, long ma) -
oldStartMin
public long oldStartMin() -
oldStartMax
public long oldStartMax() -
whenStartRange
-
whenStartRange
-
whenStartBound
-
whenStartBound
-
durationMin
public long durationMin()These methods query, set, and watch the duration of the interval var. -
durationMax
public long durationMax() -
setDurationMin
public void setDurationMin(long m) -
setDurationMax
public void setDurationMax(long m) -
setDurationRange
public void setDurationRange(long mi, long ma) -
oldDurationMin
public long oldDurationMin() -
oldDurationMax
public long oldDurationMax() -
whenDurationRange
-
whenDurationRange
-
whenDurationBound
-
whenDurationBound
-
endMin
public long endMin()These methods query, set, and watch the end position of the interval var. -
endMax
public long endMax() -
setEndMin
public void setEndMin(long m) -
setEndMax
public void setEndMax(long m) -
setEndRange
public void setEndRange(long mi, long ma) -
oldEndMin
public long oldEndMin() -
oldEndMax
public long oldEndMax() -
whenEndRange
-
whenEndRange
-
whenEndBound
-
whenEndBound
-
mustBePerformed
public boolean mustBePerformed()These methods query, set, and watch the performed status of the
interval var. -
mayBePerformed
public boolean mayBePerformed() -
cannotBePerformed
public boolean cannotBePerformed() -
isPerformedBound
public boolean isPerformedBound() -
setPerformed
public void setPerformed(boolean val) -
wasPerformedBound
public boolean wasPerformedBound() -
whenPerformedBound
-
whenPerformedBound
-
whenAnything
Attaches a demon awakened when anything about this interval changes. -
whenAnything
Attaches a closure awakened when anything about this interval changes. -
startExpr
These methods create expressions encapsulating the start, end
and duration of the interval var. Please note that these must not
be used if the interval var is unperformed. -
durationExpr
-
endExpr
-
performedExpr
-
safeStartExpr
These methods create expressions encapsulating the start, end
and duration of the interval var. If the interval var is
unperformed, they will return the unperformed_value. -
safeDurationExpr
-
safeEndExpr
-
accept
Accepts the given visitor.
-