Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Continuous decision variables take only specified values

    Posted 04/06/20 10:01 AM

    Originally posted by: KeerthivasanC


    Here is my code:

    m = CpoModel(name="CP Model")

     

    TP1 = m.integer_var_dict(name = "TP1",keys=project)

    for i in project:
        TP1[i].set_domain([0,1,2,3])

     

    I want to initiate TP1 as a continuous dictionary variable and the variable should take values from this list - [0,0.5,1,1.5,2]. Unfortunately, set_domain only works for integer type variables. Is there a way to accomplish what I am seeking using constraints or some other method?

    A code snippet in python would be helpful.

     

    Thanks and Regards.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Continuous decision variables take only specified values

    Posted 04/06/20 12:12 PM

    Hi,

    you could use a float decision expression

    You would have an integer decision variable that is 0,1,2,3 or 4 and to compute the decision expression you divide that by 2

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Continuous decision variables take only specified values

    Posted 04/06/20 12:30 PM

    Originally posted by: KeerthivasanC


    Hey Alex
    Thanks a lot for the reply. I am not sure if I exactly understand what you are saying. Can you please help me out by giving an example with a small code snippet? Sorry for the inconvenience.

    Thanks.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Continuous decision variables take only specified values