Topic
4 replies Latest Post - ‏2013-11-18T17:51:49Z by Betis
Betis
Betis
3 Posts
ACCEPTED ANSWER

Pinned topic Operator not available for float [nodes] <= dexpr float.

‏2013-11-14T16:20:49Z |

Hi,

In my constraint block, I have an error in the 3rd line of this script, telling"Operator not available for float [nodes] <= dexpr float.":

forall (i in nodes)
    forall (j in nodes)
        lambda_i[i] <= T1ij[i][j]*b1 + T2ij[i][j]*b2;

 

Have someone ever had this kind of error? (I note I am beginner at OPL scripting language)

Thanks!

Betis

 

Updated on 2013-11-15T10:35:27Z at 2013-11-15T10:35:27Z by Betis
  • ChrisBr
    ChrisBr
    17 Posts
    ACCEPTED ANSWER

    Re: Operator not available for float [nodes] <= dexpr float.

    ‏2013-11-15T16:08:13Z  in response to Betis

    Hello,

    I don't see any error. But this can depend on the type of the different arguments (T1ij, T2ij, b1, b2, lambda_i).
    Would you post your model so that we can check the syntax?
    By the way, because your question is about OPL's syntax, I suggest that you post it in the more appropriate forum:
    OPL using CP Optimizer

    Regards,

    Chris.
     

    • Betis
      Betis
      3 Posts
      ACCEPTED ANSWER

      Re: Operator not available for float [nodes] <= dexpr float.

      ‏2013-11-17T17:11:38Z  in response to ChrisBr

      Thanks for reply Chris,

      Actually, I can't see either any syntax error, here is my all model script:

      Thanks for the reply Chris,

      Actually I don't see any error, but IBM ILOG CPLEX Optimization Studio is blocking processing. Here is all the model script:

      using CP;
      // ~~~~~~~~ Model inputs ~~~~~~~
      int N = ...;                     // number of nodes
      range nodes = 1..N;                // range of nodes number
      float lambda_i [nodes] = ...;            // All generated traffic in node i
      int lij [nodes][nodes] = ...; // linking Matrix
      {string} Technologies = { "link 1", "link 2" };    // linking technologies
      float b1 = ...;                    // link capacity for technology 1
      float b2 = ...;                    // link capacity for technology 2
      float c1 = ...;                    // link cost per length unit for technology 1
      float c2 = ...;                    // link cost per length unit for technology 2
      float dij[nodes][nodes] = ...;            // Double sized array of distances between nodes


      // ~~~~~~~~ Model decision variables ~~~~~~~


      dvar int aggij [nodes][nodes];
      dvar int T1ij [nodes][nodes];
      dvar int T2ij [nodes][nodes];

      // ~~~~~~~~ Model ~~~~~~~
      dexpr float Cost = sum (i in nodes) (sum (j in nodes) (((T1ij[i][j]*c1*dij[i][j]) + (T2ij[i][j]*c2*dij[i][j]))));
      minimize
       Cost;


      subject to {

      forall (i in nodes)
          forall (j in nodes)
              lambda_i[i] <= T1ij[i][j]*b1 + T2ij[i][j]*b2;

      forall (i in nodes)
          forall (j in nodes)
              lij[i][j] >= aggij[i][j];


      forall (i in nodes)
          forall (j in nodes)
              T1ij[i][j] != T2ij[i][j];

      /*forall (i in nodes , j in nodes)
              aggij[i][j] = T1ij[i][j] + T2ij[i][j]; */

      }

       

      Regards,

      Betis

      • ChrisBr
        ChrisBr
        17 Posts
        ACCEPTED ANSWER

        Re: Operator not available for float [nodes] <= dexpr float.

        ‏2013-11-18T14:12:24Z  in response to Betis

        Hello,

        The only error that I see in your model is the one that you commented yourself.
        I mean
          forall (i in nodes , j in nodes)
                aggij[i][j] = T1ij[i][j] + T2ij[i][j];

        which has to be replaced by
          forall (i in nodes , j in nodes)
                aggij[i][j] == T1ij[i][j] + T2ij[i][j];


        And OPL indicates no error.

        Which version are you using? Which port?
        Have you tried the command line tool (oplrun)?
        What is the exact text of the displayed error?

        Regards,

        Chris.
         

        • Betis
          Betis
          3 Posts
          ACCEPTED ANSWER

          Re: Operator not available for float [nodes] <= dexpr float.

          ‏2013-11-18T17:51:49Z  in response to ChrisBr

          Hello,

           

          Well, I did restart the software tool, and now I have no more this error!!! I didn't change anything in my script! It's confusing!

          I'm using IBM ILOG CPLEX Optimization Studio Version12.5.1.0. I don't know in which port. I'm using it from its graphical interface (not yet the oplrun). The error that was displayed is exactly the title of this subject.

           

          May be there are some basic installation configuration to avoid this kind of errors?

           

          Regards,

          Betis