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.
Method
CpModelView

Return type: explicit

Arguments: Model* model

GreaterOrEqual

Return type: BooleanOrIntegerLiteral

Arguments: int var, int64_t value

Helpers to generate a decision.

IsCurrentlyFree

Return type: bool

Arguments: int var

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.

IsFixed

Return type: bool

Arguments: int var

Getters about the current domain of the given variable.

LowerOrEqual

Return type: BooleanOrIntegerLiteral

Arguments: int var, int64_t value

Max

Return type: int64_t

Arguments: int var

MedianValue

Return type: BooleanOrIntegerLiteral

Arguments: int var

Min

Return type: int64_t

Arguments: int var

NumVariables

Return type: int

The valid indices for the calls below are in [0, num_variables).