ortools Debug

1,520 views
Skip to first unread message

Sonia Almodóvar

unread,
Sep 9, 2016, 3:40:36 AM9/9/16
to or-tools-discuss
Hello, 

I have two questions. I am using or-tools python library. 
- Is there any way to debug what happen when solver is executed? For example, which branches are visited, which one was failed a why?. ... 
- Could I add a constraint after an IntervalVar was performed? 

Thank you

Driss Lahlou

unread,
Sep 9, 2016, 10:25:08 AM9/9/16
to or-tools-discuss
Hello Sonia,

- Is there any way to debug what happen when solver is executed? For example, which branches are visited, which one was failed a why?. ... 

There are several parameters that you can set to change the behavior of the solver, they are defined with Google Protobuf. In your case, I think trace_search is what you're looking for. You can also try trace_propagation to trace the propagation of constraints over variables.

To set these parameters, you can do like so :

search_parameters = pywrapcp.Solver.DefaultSolverParameters()
search_parameters
.trace_search  = True
search_parameters
.trace_propagation  = True
solver
= pywrapcp.Solver("solver_name", search_parameters)

- Could I add a constraint after an IntervalVar was performed?

Yes you can.

I hope this helps.

Regards,

Driss

Sonia Almodóvar

unread,
Sep 19, 2016, 4:05:39 AM9/19/16
to or-tools-discuss
- Could I add a constraint after an IntervalVar was performed?

Yes you can.


How can I do it? Could you give me an example? 

Thank you
Reply all
Reply to author
Forward
0 new messages