Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class ChangeValue
Note: This documentation is automatically generated.
Defines operators which change the value of variables;
each neighbor corresponds to *one* modified variable.
Sub-classes have to define ModifyValue which determines what the new
variable value is going to be (given the current value and the variable).
[[["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\u003eChangeValue\u003c/code\u003e class defines operators that modify the values of variables.\u003c/p\u003e\n"],["\u003cp\u003eEach operator within this class focuses on changing a single variable.\u003c/p\u003e\n"],["\u003cp\u003eSubclasses need to implement the \u003ccode\u003eModifyValue\u003c/code\u003e method, which determines the new value of a variable based on its current value and index.\u003c/p\u003e\n"],["\u003cp\u003eThe class constructor takes a vector of \u003ccode\u003eIntVar\u003c/code\u003e pointers representing the variables to be modified.\u003c/p\u003e\n"]]],["The `ChangeValue` class defines operators that modify variable values, with each neighbor representing one modified variable. Subclasses must implement `ModifyValue` to specify how a variable's new value is determined based on its current value and index. The class provides a constructor `ChangeValue` which takes a vector of `IntVar*` as arguments and a virtual method `ModifyValue` that takes `index` and the `value` as arguments. The class also defines a destructor `~ChangeValue`.\n"],null,["# ChangeValue\n\nC++ Reference: class ChangeValue\n================================\n\n\nNote: This documentation is automatically generated.\nDefines operators which change the value of variables; each neighbor corresponds to \\*one\\* modified variable. Sub-classes have to define ModifyValue which determines what the new variable value is going to be (given the current value and the variable).\n\n| Method ||\n|---------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|\n| [`ChangeValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1286) | Return type: `explicit ` Arguments: `const std::vector\u003cIntVar*\u003e& vars` \u003cbr /\u003e |\n| [`~ChangeValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1287) | \u003cbr /\u003e |\n| [`ModifyValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L1288) | Return type: `virtual int64_t ` Arguments: `int64_t index, int64_t value` \u003cbr /\u003e |"]]