Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Parsing Problem with Starting Point: Error reading from stream

    Posted 10/09/18 01:35 AM

    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


  • 2.  Re: Parsing Problem with Starting Point: Error reading from stream

    Posted 10/09/18 07:58 AM

    Originally posted by: Julian Jordi


    P.P.S.: This is with docplex 2.7.113 and CPO 12.8. 

    Also, I use Python 3.7, which is not yet officially supported by docplex.


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Parsing Problem with Starting Point: Error reading from stream

    Posted 10/10/18 09:43 AM

    Originally posted by: Olivier OUDOT


    Hello Julian,

    Your problem is a bug in our software. It will be fixed in the next delivery, probably available in few days.

    Many thanks to have notified this problem, and don't hesitate to share any other experience that would contribute to enhance the quality of docplex.

    I hope you will enjoy it for a long time !!  :-)

     


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Parsing Problem with Starting Point: Error reading from stream

    Posted 10/10/18 11:14 AM

    Originally posted by: Julian Jordi


    Hi Olivier

    Thanks, sounds good. Do you mean the next release of docplex? So I would check pypi in a few days to see if it's out?

    Cheers

    Julian


    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: Parsing Problem with Starting Point: Error reading from stream

    Posted 10/10/18 12:49 PM

    Originally posted by: Olivier OUDOT


    Hi Julian,

    Correct, the next release of docplex. Check it on pypi in coming days.


    #CPOptimizer
    #DecisionOptimization