0

I am running a constraint programming model in docplex. When I add the following search phase I get an error in docplex:

    model.set_parameters({'SearchType': 'DepthFirst', 'Workers': 2, "LogVerbosity": "Verbose"})

    p1 = search_phase(
        vars=shifts.values(),
        varchooser=select_largest(var_impact()),
        valuechooser=select_largest(value_impact())
    )
    p2 = search_phase(
        vars=work_hours.values(),
        varchooser=select_smallest(domain_size()),
        valuechooser=select_random_value()
    )
    model.add(p1)
    ans = model.solve(TimeLimit=100, execfile='cpoptimizer.exe')

I get the following error

(base) dipplestix@DESKTOP-37BA91G:~/classes/csci 2951/hw2$ ./run.sh input/7_14.sched
 ! --------------------------------------------------- CP Optimizer 20.1.0.0 --
 ! Satisfiability problem - 196 variables, 266 constraints, 1 phase
 ! Presolve      : 21 extractables eliminated, 7 constraints generated
 ! TimeLimit            = 100
 ! Workers              = 2
 ! LogVerbosity         = Verbose
 ! SearchType           = DepthFirst
 ! Initial process time : 0.02s (0.02s extraction + 0.00s propagation)
 !  . Log search space  : 449.3 (before), 449.3 (after)
 !  . Memory usage      : 501.9 kB (before), 501.9 kB (after)
 ! Using parallel search with 2 workers.
 ! ----------------------------------------------------------------------------
 !               Branches  Non-fixed    W       Branch decision
Traceback (most recent call last):
  File "src/run.py", line 8, in <module>
    p = solve(sys.argv[1])
  File "/home/dipplestix/classes/csci 2951/hw2/src/solver.py", line 97, in solve
    ans = model.solve(TimeLimit=100, execfile='cpoptimizer.exe')
  File "/home/dipplestix/anaconda3/lib/python3.7/site-packages/docplex/cp/model.py", line 1080, in solve
    msol = solver.solve()
  File "/home/dipplestix/anaconda3/lib/python3.7/site-packages/docplex/cp/solver/solver.py", line 614, in solve
    raise e
  File "/home/dipplestix/anaconda3/lib/python3.7/site-packages/docplex/cp/solver/solver.py", line 607, in solve
    msol = self.agent.solve()
  File "/home/dipplestix/anaconda3/lib/python3.7/site-packages/docplex/cp/solver/solver_local.py", line 191, in solve
    jsol = self._wait_json_result(EVT_SOLVE_RESULT)
  File "/home/dipplestix/anaconda3/lib/python3.7/site-packages/docplex/cp/solver/solver_local.py", line 474, in _wait_json_result
    data = self._wait_event(evt)
  File "/home/dipplestix/anaconda3/lib/python3.7/site-packages/docplex/cp/solver/solver_local.py", line 424, in _wait_event
    evt, data = self._read_message()
  File "/home/dipplestix/anaconda3/lib/python3.7/site-packages/docplex/cp/solver/solver_local.py", line 533, in _read_message
    frame = self._read_frame(6)
  File "/home/dipplestix/anaconda3/lib/python3.7/site-packages/docplex/cp/solver/solver_local.py", line 593, in _read_frame
    raise CpoSolverException("Nothing to read from local solver process. Process seems to have been stopped (rc={}).".format(rc))
docplex.cp.solver.solver.CpoSolverException: Nothing to read from local solver process. Process seems to have been stopped (rc=5).

Hoiwever, if I use this search_phase instead it works

    p1 = search_phase(
        vars=shifts.values(),
        varchooser=select_random_var(),
        valuechooser=select_random_value()
    )

Any ideas what could be causing this?

1 Answers1

0

Unfortunately, the evaluators using statistics over the branches of the search like impacts, success rate, or objective variation measures are not available for variable and value in DepthFirst search. You can use them in Restart and MultiPoint. However docplex should raise an error is this case and not exit this way. We will fix this for the next release.

PhR
  • 16