Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class CpModelView
Note: This documentation is automatically generated.
This class allows to query information about the current bounds of the loaded
cp_model.proto variables during the search. It is a "view" of the current
solver state using the indices of the proto.
TODO(user): For now it uses proto indices of the loaded model. We will need
to add a mapping to use proto indices of the non-presolved model to allow for
a client custom search with presolve. The main API shouldn't change though
and the change will be transparent.
If under a given partial assignment, the value of a variable has no impact,
this might returns true, and there is no point trying to branch on this
variable.
This might for example be the case for the start of an unperformed interval
which will not impact the rest of the problem in any way. Note that it is
still possible to branch on ignored variable, this will just not change
anything.
[[["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."],[[["The `CpModelView` class provides a way to access information about the current bounds of variables during the search of a CP-SAT model."],["It allows users to query the current state of variables, such as if a variable is fixed, its minimum and maximum values, and whether it's currently free."],["The class utilizes proto indices of the loaded model, with plans to add mapping for non-presolved models in the future for custom search with presolve."],["Helper functions like `GreaterOrEqual`, `LowerOrEqual`, and `MedianValue` are provided to generate decisions during the search process."],["It's important to note that branching on ignored variables, while possible, won't impact the problem's solution."]]],["The `CpModelView` class allows querying the current bounds of variables in a loaded `cp_model.proto`. Key actions include: checking if a variable `IsFixed` or `IsCurrentlyFree`, getting the `Min` and `Max` values of a variable's domain, and creating decisions with `GreaterOrEqual`, `LowerOrEqual`, and `MedianValue`. The class uses proto indices, with `NumVariables` providing the valid index range. Future plans involve adding a mapping to use non-presolved model indices.\n"]]