Decision Optimization

Decision Optimization

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


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

unification of two sets- giving- "Cannot use type boolean for string" error

  • 1.  unification of two sets- giving- "Cannot use type boolean for string" error

    Posted 09/17/12 07:54 AM

    Originally posted by: arguen


    I am trying to unify the following two sets:

    
    
    {string
    } NP_v[v in V] = 
    {p| <v, p, d, t> in Arc_ijvt, v in V
    }; 
    // Set of pick-up ports for vessel v 
    {string
    } ND_v[v in V] = 
    {d| <v, p, d, t> in Arc_ijvt, v in V
    }; 
    // Set of delivery ports for vessel v
    

    with the following code:

    
    NPD_v[v in V]= NP_v[v in V] union ND_v[v in V]; 
    // Set of ports for vessel v
    


    But it is giving "Cannot use type boolean for string" error.

    by the way "V" is also a string set with the names of vessels.
    Any help would be appreciated.
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: unification of two sets- giving- "Cannot use type boolean for string" error

    Posted 09/17/12 09:34 AM

    Originally posted by: GGR


    Hi

    I would say there is several mistake in your code.

    First you could simplify the definition of your 2 sets by telling

    
    
    {string
    } NP_v[v in V] = 
    {p| <v, p, d, t> in Arc_ijvt
    } 
    {string
    } ND_v[v in V] = 
    {d| <v, p, d, t> in Arc_ijvt
    }
    


    Second OPL is right. In your second expression v in V is a boolean expression, not a string

    You have to write
    
    
    {string
    } NPD_v[v in V]= NP_v[v] union ND_v[v];
    


    Hope that helps
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: unification of two sets- giving- "Cannot use type boolean for string" error

    Posted 09/17/12 03:44 PM

    Originally posted by: arguen


    Thank you for your answer and recommendations.
    It helped.
    #DecisionOptimization
    #OPLusingCPOptimizer