Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class GreaterThanAtLeastOneOfPropagator
Note: This documentation is automatically generated.
If we have:
- selectors[i] => (target_var >= vars[i] + offset[i])
- and we known that at least one selectors[i] must be true
then we can propagate the fact that if no selectors is chosen yet, the lower
bound of target_var is greater than the min of the still possible
alternatives.
This constraint take care of this case when no selectors[i] is chosen yet.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGreaterThanAtLeastOneOfPropagator\u003c/code\u003e constraint in C++ enforces the condition that if at least one selector is true, the target variable's lower bound is greater than the minimum of the remaining possible alternatives.\u003c/p\u003e\n"],["\u003cp\u003eThis constraint specifically handles scenarios where none of the selectors have been chosen yet, ensuring the target variable's lower bound remains valid.\u003c/p\u003e\n"],["\u003cp\u003eIt supports duplicate selectors, allowing for flexibility in constraint modeling.\u003c/p\u003e\n"],["\u003cp\u003eThe constraint utilizes selectors, target variables, offsets, and enforcements to define the relationship between variables and their bounds.\u003c/p\u003e\n"]]],["The `GreaterThanAtLeastOneOfPropagator` class in C++ handles scenarios where at least one selector (selectors[i]) must be true, defined as `target_var \u003e= vars[i] + offset[i]`. When no selector is chosen, it propagates that `target_var`'s lower bound exceeds the minimum of remaining alternatives. It supports duplicate selectors. Key methods include `GreaterThanAtLeastOneOfPropagator` (constructor), `Propagate` (returns a boolean), and `RegisterWith` (registers a `GenericLiteralWatcher`). The constructor takes the target variable, variables, offsets, selectors, enforcements and the model as arguments.\n"],null,["# GreaterThanAtLeastOneOfPropagator\n\nC++ Reference: class GreaterThanAtLeastOneOfPropagator\n======================================================\n\n\nNote: This documentation is automatically generated.\nIf we have: \n- selectors\\[i\\] =\\\u003e (target_var \\\u003e= vars\\[i\\] + offset\\[i\\]) \n- and we known that at least one selectors\\[i\\] must be true \nthen we can propagate the fact that if no selectors is chosen yet, the lower bound of target_var is greater than the min of the still possible alternatives. \n\nThis constraint take care of this case when no selectors\\[i\\] is chosen yet. \n\nThis constraint support duplicate selectors.\n\n| Method ||\n|----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`GreaterThanAtLeastOneOfPropagator`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_constraints.h#L74) | \u003cbr /\u003e Arguments: ` IntegerVariable target_var, const absl::Span\u003cconst IntegerVariable\u003e vars, const absl::Span\u003cconst IntegerValue\u003e offsets, const absl::Span\u003cconst Literal\u003e selectors, const absl::Span\u003cconst Literal\u003e enforcements, Model* model` \u003cbr /\u003e |\n| [`Propagate`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_constraints.h#L80) | Return type: `bool ` \u003cbr /\u003e |\n| [`RegisterWith`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_constraints.h#L81) | Return type: `void ` Arguments: `GenericLiteralWatcher* watcher` \u003cbr /\u003e |"]]