Closed ShivKJ closed 4 years ago
If you look there: https://developers.google.com/protocol-buffers/docs/reference/python-generated#enum
There is supposed to be a Name() method on the enum.
@lperron Not sure it seem to comes from: https://github.com/google/or-tools/blob/45770b833997f827d322e929b1ed4781c4e60d44/ortools/linear_solver/linear_solver.h#L185-L236
We could use XMacro to generate std::string <=> enum convertion.
note: Please note, here we are using a regular enum and not a C++ enum class
so swig will usually convert it to int....
How to access it from python code?
I checked on Stack Overflow. Your code is the best proposed solution. Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53 00
Le lun. 6 juil. 2020 à 19:03, Shiv Krishna Jaiswal notifications@github.com a écrit :
How to access from python code?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/2092#issuecomment-654357202, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3PEMZ4IIJFVNAPSPZDR2H7VBANCNFSM4OQF7XSA .
I am using python language.
val is an integer.
I wanted the corresponding solver name for given val. So for example, in this case i am expecting 'CBC_MIXED_INTEGER_PROGRAMMING'
As of now, I am using the following method to get solver name from solve_type (int value)
Can we have a function in ortools which provides solver name for given Solver type? Also, OptimizationProblemType is not exposed in python ortools