Called by Start() after synchronizing the operator with the current
assignment. Should be overridden instead of Start() to avoid calling
VarLocalSearchOperator::Start explicitly.
[[["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\u003e\u003ccode\u003eVarLocalSearchOperator\u003c/code\u003e is a C++ class in Google's OR-Tools library used for implementing local search operators that work on a set of variables.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to access and modify the values of these variables during the search process, such as \u003ccode\u003eValue\u003c/code\u003e, \u003ccode\u003eSetValue\u003c/code\u003e, \u003ccode\u003eOldValue\u003c/code\u003e, and \u003ccode\u003eVar\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes functionalities for managing the activation state of the operator (\u003ccode\u003eActivate\u003c/code\u003e, \u003ccode\u003eDeactivate\u003c/code\u003e, \u003ccode\u003eActivated\u003c/code\u003e) and applying/reverting changes to the assignment (\u003ccode\u003eApplyChanges\u003c/code\u003e, \u003ccode\u003eRevertChanges\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eOnStart\u003c/code\u003e is a virtual method intended for user implementation to define the operator's behavior, while methods like \u003ccode\u003eStart\u003c/code\u003e, \u003ccode\u003eIsIncremental\u003c/code\u003e, \u003ccode\u003eHoldsDelta\u003c/code\u003e, and \u003ccode\u003eSkipUnchanged\u003c/code\u003e contribute to the operator's interaction within the local search framework.\u003c/p\u003e\n"]]],["The `VarLocalSearchOperator` class in C++ provides methods for managing variables in local search algorithms. Key actions include: activating/deactivating variables (`Activate`, `Deactivate`), adding variables (`AddVars`), applying/reverting changes (`ApplyChanges`, `RevertChanges`), and setting/getting values (`SetValue`, `Value`, `OldValue`). It allows checking if changes are tracked (`HoldsDelta`) and if the operator is incremental (`IsIncremental`). Additional actions are implemented for getting the size of variables (`Size`) and skipping unchanged variables (`SkipUnchanged`). It has a `OnStart` method that gets called once the operator has been started.\n"],null,["# VarLocalSearchOperator\n\nC++ Reference: class VarLocalSearchOperator\n===========================================\n\n\nNote: This documentation is automatically generated.\n\n| Method ||\n|-------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`Activate`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L850) | Return type: `void ` Arguments: `int64_t index` \u003cbr /\u003e |\n| [`Activated`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L849) | Return type: `bool ` Arguments: `int64_t index` \u003cbr /\u003e |\n| [`AddVars`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L895) | Return type: `void ` Arguments: `const std::vector\u003cV*\u003e& vars` \u003cbr /\u003e |\n| [`ApplyChanges`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L858) | Return type: `bool ` Arguments: `Assignment* delta, Assignment* deltadelta` \u003cbr /\u003e |\n| [`Deactivate`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L854) | Return type: `void ` Arguments: `int64_t index` \u003cbr /\u003e |\n| [`HoldsDelta`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L817) | Return type: `bool ` \u003cbr /\u003e |\n| [`IsIncremental`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L833) | Return type: `virtual bool ` \u003cbr /\u003e |\n| [`OldValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L844) | Return type: `const Val& ` Arguments: `int64_t index` \u003cbr /\u003e |\n| [`OnStart`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L914) | Return type: `virtual void ` Called by Start() after synchronizing the operator with the current assignment. Should be overridden instead of Start() to avoid calling VarLocalSearchOperator::Start explicitly. |\n| [`RevertChanges`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L882) | Return type: `void ` Arguments: `bool incremental` \u003cbr /\u003e |\n| [`SetValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L845) | Return type: `void ` Arguments: `int64_t index, const Val& value` \u003cbr /\u003e |\n| [`Size`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L834) | Return type: `int ` \u003cbr /\u003e |\n| [`SkipUnchanged`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L843) | Return type: `virtual bool ` Arguments: `int index` \u003cbr /\u003e |\n| [`Start`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L820) | Return type: `void ` Arguments: `const Assignment* assignment` This method should not be overridden. Override OnStart() instead which is called before exiting this method. |\n| [`Value`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L837) | Return type: `const Val& ` Arguments: `int64_t index` Returns the value in the current assignment of the variable of given index. |\n| [`Var`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L842) | Return type: `V* ` Arguments: `int64_t index` Returns the variable of given index. |\n| [`VarLocalSearchOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L810) | \u003cbr /\u003e |\n| [`VarLocalSearchOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L811) | Return type: `explicit ` Arguments: `Handler var_handler` \u003cbr /\u003e |\n| [`~VarLocalSearchOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L816) | \u003cbr /\u003e |"]]