d-krupke / cpsat-primer

The CP-SAT Primer: Using and Understanding Google OR-Tools' CP-SAT Solver
https://d-krupke.github.io/cpsat-primer/
Creative Commons Attribution 4.0 International
292 stars 27 forks source link

Update README.md #24

Closed chekmanh closed 6 months ago

chekmanh commented 6 months ago

Setting subsolvers got the following error message:

Traceback (most recent call last):
  File "/Users/chek-manh/Documents/code/python/cp_sat.py", line 44, in <module>
    SimpleSatProgram()
  File "/Users/chek-manh/Documents/code/python/cp_sat.py", line 34, in SimpleSatProgram
    solver.parameters.subsolvers = ["default_lp", "fixed", "less_encoding", "no_lp", "max_lp", "pseudo_costs", "reduced_cos
ts", "quick_restart", "quick_restart_no_lp", "lb_tree_search", "probing"]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: Assignment not allowed to message, map, or repeated field "subsolvers" in protocol message object.

This can be avoided by using the extend function.

d-krupke commented 6 months ago

Thanks!