Hi Xavier,
Thanks for the reply.
1) Except the last link you sent, the rest of the links seem broken. I am receiving the following error even if I change the browser that I use.
```
The requested page does not exist or might have moved.
If you accessed this page by using a bookmark or external URL, the bookmark or links might need to be updated. In this case, use the Table of Contents or the Search bar to find the content.
If you accessed this page from the Table of Contents or Search Bar, please report the broken link to IBM Knowledge Center Support who will alert the appropriate content group.
```
2) Yes, I am aware of that
ThreadUp and ThreadDown have nothing to do with the solutions. . Since I was referring the example of
BendersATSP2, I just wanted to stick to the original code sample to make more question clearer. 3) I guess the example that you mention corresponds to AdMIPex9 in Java folder. So looking at the example, all I need to do is somehow arranging my code to be able to use
context.postHeuristicSolution inside the
invoke method. I can just attach
IloCplex.Callback.Context.Id.Candidate as an incumbent solution to my
contextmask. Then, I can go ahead and generate a Benders cut and use
context.postHeuristicSolution after it. Is my understanding correct? If so, could you please give me a small example how I can insert solutions for two sets of variables. For the sake of simplicity let's call them X[] and Y[]. If I produce a set of solutions as x and y, how can I use these solutions as
context.postHeuristicSolution(_vars, x, 0, cols, objrel, IloCplex.Callback.Context.SolutionStrategy.CheckFeasible);------------------------------
Ser Giovio
------------------------------
Original Message:
Sent: Wed October 07, 2020 04:14 AM
From: Xavier Nodet
Subject: Insert a heuristic solution within the callback function
Here are a number of things you may want to know:
- General documentation about what can be done with a Generic callback is at https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/progr_adv/callbacks/whatToDoCallbacks.html.
- ThreadUp and ThreadDown are not meant to be used a contexts to actually influence CPLEX behavior, but to setup the datastructures that you may need in your callback because it will be called in a multi-threading setup. Please refer to https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/progr_adv/callbacks/contextCallbacks.html.
- That page specifically mentions that injecting solutions is not supported in these two contexts. So you should probably make sure that separate is not called with these contexts.
- Example iloadmipex9, available in your CPLEX installation, uses the method postHeuristicSolution (https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/refcppcplex/html/classes/Callback_Context.html#method_postHeuristicSolution) and will probably be interesting for you to look at.
------------------------------
Xavier
------------------------------