C++ Reference: class GenericLiteralWatcher
Note: This documentation is automatically generated.
This class allows registering Propagator that will be called if a watched Literal or LbVar changes.TODO(user): Move this to its own file. Add unit tests!
Method | |
---|---|
AlwaysCallAtLevelZero | Return type: Arguments: Whether we call a propagator even if its watched variables didn't change. This is only used when we are back to level zero. This was introduced for the LP propagator where we might need to continue an interrupted solve or add extra cuts at level zero. |
GenericLiteralWatcher | Return type: Arguments: |
~GenericLiteralWatcher | |
GetCurrentId | Return type: Returns the id of the propagator we are currently calling. This is meant to be used from inside Propagate() in case a propagator was registered more than once at different priority for instance. |
NotifyThatPropagatorMayNotReachFixedPointInOnePass | Return type: Arguments: The default behavior is to assume that a propagator does not need to be called twice in a row. However, propagators on which this is called will be called again if they change one of their own watched variables. |
NumPropagators | Return type: Returns the number of registered propagators. |
Propagate | Return type: Arguments: On propagate, the registered propagators will be called if they need to until a fixed point is reached. Propagators with low ids will tend to be called first, but it ultimately depends on their "waking" order. |
Register | Return type: Arguments: Registers a propagator and returns its unique ids. |
RegisterLevelZeroModifiedVariablesCallback | Return type: Arguments: Set a callback for new variable bounds at level 0. This will be called (only at level zero) with the list of IntegerVariable with changed lower bounds. Note that it might be called more than once during the same propagation cycle if we fix variables in "stages". Also note that this will be called if some BooleanVariable where fixed even if no IntegerVariable are changed, so the passed vector to the function might be empty. |
RegisterReversibleClass | Return type: Arguments: Registers a reversible class with a given propagator. This class will be changed to the correct state just before the propagator is called. Doing it just before should minimize cache-misses and bundle as much as possible the "backtracking" together. Many propagators only watches a few variables and will not be called at each decision levels. |
RegisterReversibleInt | Return type: Arguments: Registers a reversible int with a given propagator. The int will be changed
to its correct value just before Propagate() is called.
Note that this will work in O(num_rev_int_of_propagator_id) per call to
Propagate() and happens at most once per decision level. As such this is
meant for classes that have just a few reversible ints or that will have a
similar complexity anyway.
Alternatively, one can directly get the underlying RevRepository |
SetPropagatorPriority | Return type: Arguments: Changes the priority of the propagator with given id. The priority is a non-negative integer. Propagators with a lower priority will always be run before the ones with a higher one. The default priority is one. |
SetStopPropagationCallback | Return type: Arguments: This will be called not too often during propagation (when we finish propagating one priority). If it returns true, we will stop propagation there. It is used by LbTreeSearch as we can stop as soon as the objective lower bound crossed a threshold and do not need to call expensive propagator when this is the case. |
Untrail | Return type: Arguments: |
WatchAffineExpression | Return type: Arguments: |
WatchIntegerVariable | Return type: Arguments: |
WatchIntegerVariable | Return type: Arguments: |
WatchLiteral | Return type: Arguments: Watches the corresponding quantity. The propagator with given id will be called if it changes. Note that WatchLiteral() only trigger when the literal becomes true. If watch_index is specified, it is associated with the watched literal. Doing this will cause IncrementalPropagate() to be called (see the documentation of this interface for more detail). |
WatchLowerBound | Return type: Arguments: |
WatchLowerBound | Return type: Arguments: Because the coeff is always positive, whatching an affine expression is the same as watching its var. |
WatchLowerBound | Return type: Arguments: No-op overload for "constant" IntegerVariable that are sometimes templated as an IntegerValue. |
WatchUpperBound | Return type: Arguments: |
WatchUpperBound | Return type: Arguments: |
WatchUpperBound | Return type: Arguments: |