C++ Reference: class SharedSolutionRepository

This documentation is automatically generated.

Thread-safe. Keeps a set of n unique best solution found so far.

TODO(user): Maybe add some criteria to only keep solution with an objective really close to the best solution.

Return type: void

Arguments: const Solution& solution

Add a new solution. Note that it will not be added to the pool of solution right away. One must call Synchronize for this to happen. Works in O(num_solutions_to_keep_).


Return type: Solution

Arguments: random_engine_t* random

Returns a random solution biased towards good solutions.


Return type: Solution

Arguments: int index

Returns the solution #i where i must be smaller than NumSolutions().


Return type: int

Returns the number of current solution in the pool. This will never decrease.


Return type: explicit

Arguments: int num_solutions_to_keep


Return type: void

Updates the current pool of solution with the one recently added. Note that we use a stable ordering of solutions, so the final pool will be independent on the order of the calls to AddSolution() provided that the set of added solutions is the same. Works in O(num_solutions_to_keep_).