Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Unbound Expression

    Posted Thu April 04, 2013 09:00 PM

    Originally posted by: SystemAdmin


    Hello Everyone,

    Could someone please help me explain why I get an "Unbound expression" error with this constraint??
    I am calculating angles between segments and I just want to set that if the denominator is zero then the angle is 90.

    forall(f in Floor){
    forall (p in aSegments){
    if ((ChangeinX[f][p])== 0)
    Angles0[f][p] == 90;
    }
    }

    I have attached the .mod file as well,.

    Any assistance rendered will be highly appreciated!
    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: Unbound Expression

    Posted Fri April 05, 2013 06:03 AM

    Originally posted by: ol


    Hello,
    you cannot change an expression with a constraint, you need to build the expression with the "if" inside.

    for example:
    
    dexpr 
    
    float Angles0[g in Floor][h in aSegments] = (ChangeinX[g][h]==0) ? 90 : (Slope0[g][h]-(Slope0[g][h]^3)/3+(Slope0[g][h]^5)/5-(Slope0[g][h]^7)/7);
    


    and your can remove the lines:

    forall(f in Floor){
    forall (p in aSegments){
    if ((ChangeinX[f][p])== 0)
    Angles0[f][p] == 90;
    }
    }

    The same problem appears with Angle1.
    Regards,
    Olivier
    #ConstraintProgramming-General
    #DecisionOptimization


  • 3.  Re: Unbound Expression

    Posted Fri April 05, 2013 10:19 AM

    Originally posted by: SystemAdmin


    Thank you very much sir for helping me, it works now.
    #ConstraintProgramming-General
    #DecisionOptimization