Reputation: 3905
I'm using CBC on the Windows command line for solving a Mixed Integer Linear Programming problem which works out pretty well as it solves the problem in a reasonable amount of time.
However, I can't figure out how to get CBC to print the values of the variables that forms the optimal solution.
Upvotes: 1
Views: 1070
Reputation: 119
use
solu sol.txt
This will write the solution to a file named sol.txt. The variables that you don't see in the file take the value zero.
Upvotes: 0
Reputation: 15971
If I understand this example from the CBC User Guide correctly, you get the solution variables by using the const double * CbcModel::bestSolution()
function.
Additionally, you should be able to identify the context of each variable by using these functions:
bool isBinary(int colIndex) const
bool isContinuous(int colIndex) const
bool isInteger(int colIndex) const
Upvotes: 2