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 TypeMethodDescriptionvoidaccept(ModelVisitor visitor) Accepts the given visitor.booleanvoiddelete()longlongThese methods query, set, and watch the duration of the interval var.endExpr()longendMax()longendMin()These methods query, set, and watch the end position of the interval var.protected voidfinalize()static longgetCPtr(IntervalVar obj) static longThe largest acceptable value to be returned by EndMax()static longThe smallest acceptable value to be returned by StartMin()booleanbooleanbooleanThese methods query, set, and watch the performed status of the
interval var.longlonglonglonglonglongsafeDurationExpr(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.voidsetDurationMax(long m) voidsetDurationMin(long m) voidsetDurationRange(long mi, long ma) voidsetEndMax(long m) voidsetEndMin(long m) voidsetEndRange(long mi, long ma) voidsetPerformed(boolean val) voidsetStartMax(long m) voidsetStartMin(long m) voidsetStartRange(long mi, long ma) These methods create expressions encapsulating the start, end
and duration of the interval var.longstartMax()longstartMin()These methods query, set, and watch the start position of the
interval var.static longswigRelease(IntervalVar obj) booleanvoidAttaches a demon awakened when anything about this interval changes.voidwhenAnything(Runnable closure) Attaches a closure awakened when anything about this interval changes.voidvoidwhenDurationBound(Runnable closure) voidvoidwhenDurationRange(Runnable closure) voidvoidwhenEndBound(Runnable closure) voidvoidwhenEndRange(Runnable closure) voidvoidwhenPerformedBound(Runnable closure) voidvoidwhenStartBound(Runnable closure) voidvoidwhenStartRange(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, unfreezeQueueMethods 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:
finalizein classPropagationBaseObject
-
delete
public void delete()- Overrides:
deletein 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.
-