Originally posted by: Julian Jordi
I am trying to set a starting_point for my model with the docplex api. It seems to do what I want, but when I call the solve-method I get errors like these:
ERROR: stream:107:4: Error: Unrecognized character '#'.
ERROR: stream:107:5: Error: syntax error, unexpected constant, expecting '=' or '{'.
When i export the model as a text file, i get the result 'starting_point.cpo' attached
The problem seems to be that my interval variables are named using a schema that includes a hash '#' to separate the components of the name. That leads to a parsing problem. If i manually enclose the variables names in the starting point with douple quotes (see model 'starting_point_ok.cpo'), the model can be read and solved.
Question: Am I doing something wrong, or why does CPO not enclose the variables names in double quotes in the startingPoint, just like it does in all other expressions they occur in?
P.S.: I construct the starting point as follows:
- initialize empty solution: starting_point = docplex.cp.solution.CpoModelSolution()
- go through all interval variables in my model and if I want to have them in my starting point, call starting_point.add_interval_var_solution(itv, ...desired properties...)
- call my_model.set_starting_point(starting_point)
#CPOptimizer#DecisionOptimization