you have to extend the ProgressListener class or the SolutionListener and add it to the model with model.add_progress_listener
Look at
https://github.com/IBMDecisionOptimization/docplex/blob/master/docplex/mp/progress.py , for example how the
TextProgressListener is implemented if you want to write the solution to a file as soon as it is found, or at SolutionListener, which will collect all the solutions, which you will write to a file all at once.
Note that the CPLEX callback do not ensure to get all the solutions. In most MIPs, all of them are collected, but in some extreme cases, the callback may not be triggered.------------------------------
Vincent Beraudier
------------------------------
Original Message:
Sent: Mon November 28, 2022 12:29 PM
From: Daniela Cantarino
Subject: Export all feasible solutions in txt file (docplex.mp)
Hello All,
I am trying to export all feasible solutions for my MIP problem (docplex.mp) in a txt file. What is the most efficient way to do this? Thank you!
------------------------------
Daniela Cantarino
------------------------------
#DecisionOptimization