Decision Optimization

 View Only
Expand all | Collapse all

Division in tuple

ALEX FLEISCHER

ALEX FLEISCHERTue July 16, 2019 01:20 PM

  • 1.  Division in tuple

    Posted Tue July 16, 2019 06:32 AM

    Originally posted by: sandeepsinghchauhan


    I have a tuple

     

    tuple T1
    {
     Proc process;
     Raw Rawtype;
     float Rawreq;
     float capacity;

    }

    {T1} Processlevel1 = {<pl.process,r.Rawtype,r.Rawreq,pl.Level,pl.ProdID,pl.capacity,pl.Production,pl.Investment>| pl in ProcessLevel,r in Rawperprocess};

     

    float Plant1[p in Processlevel1] = floor(p.process.RawAmount/(p.RawReq*p.capacity));

    But I am getting error

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Division in tuple

    Posted Tue July 16, 2019 01:20 PM

    Hi

    tuple Proc
    {
    float RawAmount;
    float RawReq;
    }

    tuple Raw
    {
    int r;
    }
     
     tuple T1
    {
     Proc process;
     Raw Rawtype;
     float Rawreq;
     float capacity;

    }

    {T1} Processlevel1 = {<<1,2.0>,<2>,1.0,2.0>};

     

    float Plant1[p in Processlevel1] = floor(p.process.RawAmount/(p.process.RawReq*p.capacity));

    execute
    {
    Plant1;
    }

    works fine

     

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer