Decision Optimization

 View Only
Expand all | Collapse all

Unrestricted variable in docplex pythin

  • 1.  Unrestricted variable in docplex pythin

    Posted Wed December 14, 2022 10:05 AM
    Hello, community.
    I would like your help to know how to declare an unrestricted variable. I currently use this:

    idh = [(d, p) for d in days for p in periods]
    O= model.continuous_var_dict(idh,name="O",lb=-1000)

    but I would like something like this:

    -inf <= O <= inf

    That is, not to give a specific value to lb

    ------------------------------
    andres montaña gavalo
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Unrestricted variable in docplex pythin

    Posted Wed December 14, 2022 11:15 AM
    O= model.continuous_var_dict(idh,name="O",lb=-model.infinity)

    should do the trick.
    In CPLEX, the infinity is 1e+20. Default constructors of variables in CPLEX have a lower bound of 0.



    ------------------------------
    Vincent Beraudier
    ------------------------------