Decision Optimization

Decision Optimization

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

 View Only

Multi-Dimensional Array randomization

  • 1.  Multi-Dimensional Array randomization

    Posted Mon April 09, 2012 10:15 PM

    Originally posted by: Karthick.Kanagal


    Hello, I am new to OPL and i am looking for some help in getting this to work..

    I am trying to assign channels to base stations but in a random manner/best possible set up.
    For example; there are 10 BaseStations, and 6 Channels based on the data that is coming from each base station a channel is turned on...
    But i am looking to turn on the channels randomly.. This is the code for what i have done so far, but i need to change it in order for it to be random

    dvar boolean BSChannelBaseStationChannels;
    subject to {
    forall(i in BaseStation)
    if(Up_Data[i] <=10){
    BSChannel[i][0] == 1;}
    else if(10 < Up_Data[i] <= 20){
    BSChannel[i][0] == 1;
    BSChannel[i][1] == 1;}
    else if(20 < Up_Data[i] <= 50){
    BSChannel[i][0] == 1;
    BSChannel[i][1] == 1;
    BSChannel[i][2] ==1;}
    }

    Up_Data = 10, 10, 15, 7, 12, 6, 5, 30, 8, 9

    resulting

    BSChannel = [1 0 0 0 0 0
    1 0 0 0 0 0
    1 1 0 0 0 0
    1 0 0 0 0 0
    1 1 0 0 0 0
    1 0 0 0 0 0
    1 0 0 0 0 0
    1 1 1 0 0 0
    1 0 0 0 0 0
    1 0 0 0 0 0];

    I would like the BSChannelBaseStationChannel to be a decision variable in the sense that the code will execute so that all constraints are met and the assignment of channels do not void any constraints.

    Thank you
    #DecisionOptimization
    #OPLusingCPLEXOptimizer