Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

do boolean type mean the same as +int variable 0..1?

  • 1.  do boolean type mean the same as +int variable 0..1?

    Posted Mon February 23, 2009 04:58 PM

    Originally posted by: SystemAdmin


    [hidedeep2008 said:]

    when using OPL, do the following two variable initializations mean the same?

    1.  dvar boolean a;
    2.  dvar int+ b in 0..1;
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: do boolean type mean the same as +int variable 0..1?

    Posted Mon February 23, 2009 06:57 PM

    Originally posted by: SystemAdmin


    [jfk said:]

    hello,
    what viewpoint are you interested knowing if they are the same/different?
    memory-wise: which representation is consuming more memory?
    performance-wise : if I model my problem with boolean does it run faster then modeling with integer?
    conceptually: does integer provide something different than a boolean?
    syntactically: where can the boolean be used in constraints where the integer can't and vice versa?

    personally: I usually use integers...

    cheers
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: do boolean type mean the same as +int variable 0..1?

    Posted Fri March 06, 2009 10:55 AM

    Originally posted by: SystemAdmin


    [fwagner@Ilog.fr said:]

    Yes "dvar boolean x" and "dvar int x in 0..1" are the same.
    The former is just a shortcut syntax for the latter.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer