solver.SearchForAllSolutions(model, callback)

198 views
Skip to first unread message

Mohammad Arani

unread,
Oct 21, 2021, 4:26:56 PM10/21/21
to or-tools-discuss
Hi,

I am using sat solver. I was wondering how I can have a callback just for the values of objective function and the time that each values are found.

solver = ortools.sat.python.cp_model.CpSolver()
solver.SearchForAllSolutions(model, callback)

Thanks,
M

Laurent Perron

unread,
Oct 22, 2021, 1:58:40 AM10/22/21
to or-tools-discuss
solver.parameters.log_search_progress = True


Note that (1) SearchForAllSolutions is deprecated, and (2) it does not work if the model has an objective

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/4e437610-66f3-4713-82c4-216b71e4de1an%40googlegroups.com.

Mohammad Arani

unread,
Oct 22, 2021, 10:53:23 AM10/22/21
to or-tools-discuss
Laurent,

Thank you so much for your help. 

Reply all
Reply to author
Forward
0 new messages