Decision Optimization

 View Only
Expand all | Collapse all

Min 1 0 sequence in int array

  • 1.  Min 1 0 sequence in int array

    Posted Tue April 09, 2019 04:11 PM

    Originally posted by: trxw


    Hi,

    I am using this dexpr int People[i in KK] = (min(t in 1..Duration-1) ((People[i][t]==1 && People[i][t+1]==0)*t)) to trying to calculate the lowest sequence of 1 0  in the array, so if I have

    111110000111000011110000  I want to get 5, however I am getting always 0

     

    Any idea why?

    Thanks


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Min 1 0 sequence in int array

    Posted Tue April 09, 2019 04:59 PM

    Originally posted by: trxw


    I found the answer. Alex, you explained it to me in other post that the min was not going to work because of the 0...


    #DecisionOptimization
    #OPLusingCPLEXOptimizer