Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

How to multiply two float / operator does not exist

  • 1.  How to multiply two float / operator does not exist

    Posted 09/27/17 09:33 AM

    Originally posted by: gustavgans123


    Hi,

     

    I am trying to setup a constant of type float, which is defined by the product of two other float constants. For Example:

    int m = ...; // number of maintenance task (m=4)

    {int} M = asSet(0..m); // All maintenance tasks

    int s = ...; // number of shifts (s =1)

    {int} S = asSet(1..s); // all shifts in the planning period

     

    float Tmt[M][S] = ...; //Duration of task m in M in hrs

    float Ctmt[M][S] = ...; // costs per hr downtime of maintenance task M

    float Clp[M][S] = Tmt[M][S] * Ctmt[M][S]; // the total costs maintenance task M

    I get the error Tmt was not expected and / or operator * does not exist for float float

     

    I attached data and model file.

     

    Thank you for any help,

    Gustav


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to multiply two float / operator does not exist

    Posted 09/27/17 09:42 AM

    Hi,

    in the .mod I would rather write

    float Clp[m in M][s in S] =  Tmt[m][s] * Ctmt[s][s];

    and in the .dat

    Tmt = [[1], [7], [12], [10], [1]];
    Ctmt = [[50],[200],[200],[200],[50]];

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: How to multiply two float / operator does not exist

    Posted 09/27/17 09:49 AM

    Originally posted by: gustavgans123


    that is what I needed, thank you very much for the quick help on this!

    best regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer