Decision Optimization

 View Only
  • 1.  Tuple with two-dimensional array

    Posted Thu November 12, 2020 02:57 PM
    I am trying to have a tuple with two-dimensional array, but I have an error, "Expecting a tuple component, found int[range][range]."
    Can you please tell me what my mistake is?

    FP = {
    <"A",1, [[1 1] [0 1]] >
    <"A",2, [[1 1] [0 1]] >
    };

    tuple t_FP {
      key string a;
      key int o;
      int  feasible[1..2][1..2];
    }
    {t_FP} FP = ...;

    Also, I am awaiting for some advice for Nurse Rostering Problem.
    https://community.ibm.com/community/user/datascience/communities/community-home/digestviewer/viewthread?GroupId=5557&MessageKey=9d878dc3-a501-470c-9b48-186f51cf4d1e&CommunityKey=ab7de0fd-6f43-47a9-8261-33578a231bb7&tab=digestviewer&ReturnUrl=%2fcommunity%2fuser%2fdatascience%2fcommunities%2fcommunity-home%2fdigestviewer%3fcommunitykey%3dab7de0fd-6f43-47a9-8261-33578a231bb7

    ------------------------------
    Andy Ham
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Tuple with two-dimensional array

    Posted Thu November 12, 2020 03:10 PM
    Hi

    arrays within Tuples are 1 dimension
    2D arrays are Not allowed 

    regards

    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: Tuple with two-dimensional array

    Posted Thu November 12, 2020 04:33 PM
    Edited by System Test Fri January 20, 2023 04:39 PM

    Thanks! I think I can convert two-dimension data into one.





  • 4.  RE: Tuple with two-dimensional array

    Posted Fri November 13, 2020 06:15 AM
    Hi,

    I shared an example: https://github.com/AlexFleischerParis/opltipsandtricks/blob/master/array2Dintupleset.mod

    regards

    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------