Java Reference

Java Reference

IntervalVar

Detailed Description

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...)

Definition at line 14 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

Public Member Functions

synchronized void delete ()
 
long startMin ()
 These methods query, set, and watch the start position of the interval var. More...
 
long startMax ()
 
void setStartMin (long m)
 
void setStartMax (long m)
 
void setStartRange (long mi, long ma)
 
long oldStartMin ()
 
long oldStartMax ()
 
void whenStartRange (Demon d)
 
void whenStartRange (Runnable closure)
 
void whenStartBound (Demon d)
 
void whenStartBound (Runnable closure)
 
long durationMin ()
 These methods query, set, and watch the duration of the interval var. More...
 
long durationMax ()
 
void setDurationMin (long m)
 
void setDurationMax (long m)
 
void setDurationRange (long mi, long ma)
 
long oldDurationMin ()
 
long oldDurationMax ()
 
void whenDurationRange (Demon d)
 
void whenDurationRange (Runnable closure)
 
void whenDurationBound (Demon d)
 
void whenDurationBound (Runnable closure)
 
long endMin ()
 These methods query, set, and watch the end position of the interval var. More...
 
long endMax ()
 
void setEndMin (long m)
 
void setEndMax (long m)
 
void setEndRange (long mi, long ma)
 
long oldEndMin ()
 
long oldEndMax ()
 
void whenEndRange (Demon d)
 
void whenEndRange (Runnable closure)
 
void whenEndBound (Demon d)
 
void whenEndBound (Runnable closure)
 
boolean mustBePerformed ()
 These methods query, set, and watch the performed status of the interval var. More...
 
boolean mayBePerformed ()
 
boolean cannotBePerformed ()
 
boolean isPerformedBound ()
 
void setPerformed (boolean val)
 
boolean wasPerformedBound ()
 
void whenPerformedBound (Demon d)
 
void whenPerformedBound (Runnable closure)
 
void whenAnything (Demon d)
 Attaches a demon awakened when anything about this interval changes. More...
 
void whenAnything (Runnable closure)
 Attaches a closure awakened when anything about this interval changes. More...
 
IntExpr startExpr ()
 These methods create expressions encapsulating the start, end and duration of the interval var. More...
 
IntExpr durationExpr ()
 
IntExpr endExpr ()
 
IntExpr performedExpr ()
 
IntExpr safeStartExpr (long unperformed_value)
 These methods create expressions encapsulating the start, end and duration of the interval var. More...
 
IntExpr safeDurationExpr (long unperformed_value)
 
IntExpr safeEndExpr (long unperformed_value)
 
void accept (ModelVisitor visitor)
 Accepts the given visitor. More...
 
String toString ()
 
Solver solver ()
 
void freezeQueue ()
 This method freezes the propagation queue. More...
 
void unfreezeQueue ()
 This method unfreezes the propagation queue. More...
 
void enqueueDelayedDemon (Demon d)
 This method pushes the demon onto the propagation queue. More...
 
void enqueueVar (Demon d)
 
void reset_action_on_fail ()
 This method clears the failure callback. More...
 
void set_variable_to_clean_on_fail (IntVar v)
 Shortcut for variable cleaner. More...
 
String name ()
 Object naming. More...
 
void setName (String name)
 
boolean hasName ()
 Returns whether the object has been named or not. More...
 
String baseName ()
 Returns a base name for automatic naming. More...
 

Static Public Member Functions

static long getKMinValidValue ()
 The smallest acceptable value to be returned by StartMin() More...
 
static long getKMaxValidValue ()
 The largest acceptable value to be returned by EndMax() More...
 

Protected Member Functions

 IntervalVar (long cPtr, boolean cMemoryOwn)
 

Constructor & Destructor Documentation

◆ IntervalVar()

IntervalVar ( long  cPtr,
boolean  cMemoryOwn 
)
inlineprotected

Member Function Documentation

◆ accept()

void accept ( ModelVisitor  visitor)
inline

Accepts the given visitor.

Definition at line 290 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ baseName()

String baseName ( )
inlineinherited

Returns a base name for automatic naming.

Reimplemented in BooleanVar.

Definition at line 115 of file PropagationBaseObject.java.

◆ cannotBePerformed()

boolean cannotBePerformed ( )
inline

◆ delete()

synchronized void delete ( )
inline

◆ durationExpr()

IntExpr durationExpr ( )
inline

◆ durationMax()

long durationMax ( )
inline

◆ durationMin()

long durationMin ( )
inline

These methods query, set, and watch the duration of the interval var.

Definition at line 106 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ endExpr()

IntExpr endExpr ( )
inline

◆ endMax()

long endMax ( )
inline

◆ endMin()

long endMin ( )
inline

These methods query, set, and watch the end position of the interval var.

Definition at line 153 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ enqueueDelayedDemon()

void enqueueDelayedDemon ( Demon  d)
inlineinherited

This method pushes the demon onto the propagation queue.

It will be processed directly if the queue is empty. It will be enqueued according to its priority otherwise.

Definition at line 72 of file PropagationBaseObject.java.

◆ enqueueVar()

void enqueueVar ( Demon  d)
inlineinherited

Definition at line 76 of file PropagationBaseObject.java.

◆ freezeQueue()

void freezeQueue ( )
inlineinherited

This method freezes the propagation queue.

It is useful when you need to apply multiple modifications at once.

Definition at line 58 of file PropagationBaseObject.java.

◆ getKMaxValidValue()

static long getKMaxValidValue ( )
inlinestatic

The largest acceptable value to be returned by EndMax()

Definition at line 52 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ getKMinValidValue()

static long getKMinValidValue ( )
inlinestatic

The smallest acceptable value to be returned by StartMin()

Definition at line 45 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ hasName()

boolean hasName ( )
inlineinherited

Returns whether the object has been named or not.

Definition at line 108 of file PropagationBaseObject.java.

◆ isPerformedBound()

boolean isPerformedBound ( )
inline

◆ mayBePerformed()

boolean mayBePerformed ( )
inline

◆ mustBePerformed()

boolean mustBePerformed ( )
inline

These methods query, set, and watch the performed status of the interval var.

Definition at line 200 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ name()

String name ( )
inlineinherited

Object naming.

Definition at line 97 of file PropagationBaseObject.java.

◆ oldDurationMax()

long oldDurationMax ( )
inline

◆ oldDurationMin()

long oldDurationMin ( )
inline

◆ oldEndMax()

long oldEndMax ( )
inline

◆ oldEndMin()

long oldEndMin ( )
inline

◆ oldStartMax()

long oldStartMax ( )
inline

◆ oldStartMin()

long oldStartMin ( )
inline

◆ performedExpr()

IntExpr performedExpr ( )
inline

◆ reset_action_on_fail()

void reset_action_on_fail ( )
inlineinherited

This method clears the failure callback.

Definition at line 83 of file PropagationBaseObject.java.

◆ safeDurationExpr()

IntExpr safeDurationExpr ( long  unperformed_value)
inline

◆ safeEndExpr()

IntExpr safeEndExpr ( long  unperformed_value)
inline

◆ safeStartExpr()

IntExpr safeStartExpr ( long  unperformed_value)
inline

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.

Definition at line 272 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ set_variable_to_clean_on_fail()

void set_variable_to_clean_on_fail ( IntVar  v)
inlineinherited

Shortcut for variable cleaner.

Definition at line 90 of file PropagationBaseObject.java.

◆ setDurationMax()

void setDurationMax ( long  m)
inline

◆ setDurationMin()

void setDurationMin ( long  m)
inline

◆ setDurationRange()

void setDurationRange ( long  mi,
long  ma 
)
inline

◆ setEndMax()

void setEndMax ( long  m)
inline

◆ setEndMin()

void setEndMin ( long  m)
inline

◆ setEndRange()

void setEndRange ( long  mi,
long  ma 
)
inline

◆ setName()

void setName ( String  name)
inlineinherited

Definition at line 101 of file PropagationBaseObject.java.

◆ setPerformed()

void setPerformed ( boolean  val)
inline

◆ setStartMax()

void setStartMax ( long  m)
inline

◆ setStartMin()

void setStartMin ( long  m)
inline

◆ setStartRange()

void setStartRange ( long  mi,
long  ma 
)
inline

◆ solver()

Solver solver ( )
inlineinherited

Definition at line 50 of file PropagationBaseObject.java.

◆ startExpr()

IntExpr startExpr ( )
inline

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.

Definition at line 249 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ startMax()

long startMax ( )
inline

◆ startMin()

long startMin ( )
inline

These methods query, set, and watch the start position of the interval var.

Definition at line 59 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ toString()

String toString ( )
inlineinherited

Reimplemented from BaseObject.

Reimplemented in Assignment, Pack, BooleanVar, Constraint, GlobalVehicleBreaksConstraint, and SequenceVar.

Definition at line 46 of file PropagationBaseObject.java.

◆ unfreezeQueue()

void unfreezeQueue ( )
inlineinherited

This method unfreezes the propagation queue.

All modifications that happened when the queue was frozen will be processed.

Definition at line 65 of file PropagationBaseObject.java.

◆ wasPerformedBound()

boolean wasPerformedBound ( )
inline

◆ whenAnything() [1/2]

void whenAnything ( Demon  d)
inline

Attaches a demon awakened when anything about this interval changes.

Definition at line 235 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ whenAnything() [2/2]

void whenAnything ( Runnable  closure)
inline

Attaches a closure awakened when anything about this interval changes.

Definition at line 242 of file gen/java/com/google/ortools/constraintsolver/IntervalVar.java.

◆ whenDurationBound() [1/2]

void whenDurationBound ( Demon  d)
inline

◆ whenDurationBound() [2/2]

void whenDurationBound ( Runnable  closure)
inline

◆ whenDurationRange() [1/2]

void whenDurationRange ( Demon  d)
inline

◆ whenDurationRange() [2/2]

void whenDurationRange ( Runnable  closure)
inline

◆ whenEndBound() [1/2]

void whenEndBound ( Demon  d)
inline

◆ whenEndBound() [2/2]

void whenEndBound ( Runnable  closure)
inline

◆ whenEndRange() [1/2]

void whenEndRange ( Demon  d)
inline

◆ whenEndRange() [2/2]

void whenEndRange ( Runnable  closure)
inline

◆ whenPerformedBound() [1/2]

void whenPerformedBound ( Demon  d)
inline

◆ whenPerformedBound() [2/2]

void whenPerformedBound ( Runnable  closure)
inline

◆ whenStartBound() [1/2]

void whenStartBound ( Demon  d)
inline

◆ whenStartBound() [2/2]

void whenStartBound ( Runnable  closure)
inline

◆ whenStartRange() [1/2]

void whenStartRange ( Demon  d)
inline

◆ whenStartRange() [2/2]

void whenStartRange ( Runnable  closure)
inline

The documentation for this class was generated from the following file: