You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a student exercise session for a CP course. I'm using Choco through its Python interface to demonstrate to
the students how the chosen decision variable representation can impact the solver's performance (e.g. boolean vs integer decision variables, dependent on the problem and used constraints). I have access to the solving time as to show the impact on the performance, but ideally I would also like to be able to show the difference in the number of traversed search nodes.
I saw that the Java API makes this available through solver.getMeasures() via getNodeCount(). In the Python interface, I only found .show_statistics() and .show_short_statistics() as to enable the printing of these statistics after solving. They get directly printed to stdout (making them also invisible in a jupyter notebook). More ideal would be to have these metrics accessible through Choco's Python API, i.e. that we can also call .getMeasures() on the Python solver object as to access these fields.
I experimented a bit and got something working to get the .toString() representation of a Measures object back to Python. But I believe that it would be beneficial to have access to an actual Measures object in Python instead of only its string representation.
So this issue is more of a feature request. If you agree this would be a nice addition, I believe I understand enough of the code base to attempt an initial implementation myself (although I would probably have some questions along the way).
With kind regards,
Thomas
The text was updated successfully, but these errors were encountered:
Hi ! Indeed, that looks like a feature request :-) And you are right, it would be nice to have more access to measures in pychoco, I cannot guarantee any deadline to implement it, but we keep that on the list !
Hello,
I'm working on a student exercise session for a CP course. I'm using Choco through its Python interface to demonstrate to
the students how the chosen decision variable representation can impact the solver's performance (e.g. boolean vs integer decision variables, dependent on the problem and used constraints). I have access to the solving time as to show the impact on the performance, but ideally I would also like to be able to show the difference in the number of traversed search nodes.
I saw that the Java API makes this available through
solver.getMeasures()
viagetNodeCount()
. In the Python interface, I only found.show_statistics()
and.show_short_statistics()
as to enable the printing of these statistics after solving. They get directly printed to stdout (making them also invisible in a jupyter notebook). More ideal would be to have these metrics accessible through Choco's Python API, i.e. that we can also call.getMeasures()
on the Python solver object as to access these fields.I experimented a bit and got something working to get the
.toString()
representation of aMeasures
object back to Python. But I believe that it would be beneficial to have access to an actualMeasures
object in Python instead of only its string representation.So this issue is more of a feature request. If you agree this would be a nice addition, I believe I understand enough of the code base to attempt an initial implementation myself (although I would probably have some questions along the way).
With kind regards,
Thomas
The text was updated successfully, but these errors were encountered: