Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  operator not available for string error

    Posted 03/12/12 09:35 AM

    Originally posted by: evrensarina


    Hi,

    I'm a newbee for ODME and CPLEX and I'm struggling with a problem for 2 hours. I hope someone can help me solving it.

    I have customer segments and channel information in two seperate tables. My decision varible is: xcustomerproductcustrepday. It's an assignment problem and my decision varible is boolean. custrep table has a foreign key from channel table, where each customer representative is working under different channels. Customer table has a foreign key also from customersegment table.

    Here is the code:

    forall(g in customersegment, k in channel)
    Const1SegmentChannelAvailability: sum(i in customer, j in product, c in custrep, d in day:g.segment==i.segment && k.channelid==c.channelid) x[i][j][c][d] <= segmentchannel[g][k];

    And the error is:

    Operator not available for string == <!channelid:string,varcost:float>
    Could someone help me?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: operator not available for string error

    Posted 03/12/12 09:51 AM
    Hi,

    in

    g.segment==i.segment && k.channelid==c.channelid
    


    what are the types of g.segment, i.segment, k.channelid and c.channelid ?

    Regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: operator not available for string error

    Posted 03/12/12 12:51 PM

    Originally posted by: SystemAdmin


    I am guessing that, you generated data model in ODME, which automatically generates tuples. And if you have identifying foreign key relationship, it generates tuple element with the type of parent table, such as:

    tuple custrep {
    channel channelid; 
    }
    


    instead of

    tuple custrep { 
    string channelid;
    }
    


    if this is the case, you will need

    k.channelid.channelid==c.channelid
    

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: operator not available for string error

    Posted 03/12/12 04:38 PM

    Originally posted by: evrensarina


    Thanks both for quick responses. Mehmet, your answer totally solved my problem, many thanks.

    Alex, I checked the types and I think they match, but the problem occured to be caused by foreign keys.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer