# C++ Reference: class NeighborhoodGenerator

Note: This documentation is automatically generated.

Base class for a CpModelProto neighborhood generator.Method | |
---|---|

`AddSolveData` | Return type: Arguments: |

`deterministic_limit` | Return type: The current time limit that the sub-solve should use on this generator. |

`deterministic_time` | Return type: The sum of the deterministic time spent in this generator. |

`difficulty` | Return type: The current difficulty of this generator |

`Generate` | Return type: Arguments: Generates a "local" subproblem for the given seed. The difficulty will be in [0, 1] and is related to the asked neighborhood size (and thus local problem difficulty). A difficulty of 0.0 means empty neighborhood and a difficulty of 1.0 means the full problem. The algorithm should try to generate a neighborhood according to this difficulty which will be dynamically adjusted depending on whether or not we can solve the subproblem in a given time limit. The given initial_solution should contain a feasible solution to the initial CpModelProto given to this class. Any solution to the returned CPModelProto should also be valid solution to the same initial model. This function should be thread-safe. |

`GetUCBScore` | Return type: Arguments: Uses UCB1 algorithm to compute the score (Multi armed bandit problem). Details are at https://lilianweng.github.io/lil-log/2018/01/23/the-multi-armed-bandit-problem-and-its-solutions.html. 'total_num_calls' should be the sum of calls across all generators part of the multi armed bandit problem. If the generator is called less than 10 times then the method returns infinity as score in order to get more data about the generator performance. |

`IsRelaxationGenerator` | Return type: Returns true if the neighborhood generator generates relaxation of the given problem. |

`name` | Return type: Returns a short description of the generator. |

`NeighborhoodGenerator` | Arguments: |

`~NeighborhoodGenerator` | Return type: |

`num_calls` | Return type: Number of times this generator was called. |

`num_fully_solved_calls` | Return type: Number of time the neighborhood was fully solved (OPTIMAL/INFEASIBLE). |

`ReadyToGenerate` | Return type: Returns true if the neighborhood generator can generate a neighborhood. |

`Synchronize` | Return type: Process all the recently added solve data and update this generator score and difficulty. |