Decision Optimization

Decision Optimization

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

 View Only

Initializing missing array values

  • 1.  Initializing missing array values

    Posted Tue November 27, 2012 06:39 AM

    Originally posted by: SystemAdmin


    Apologies if this has been answered, but I could not find a corresponding thread.

    I use the IBM ILOG CPLEX Optimization Studio with cplex 12.4.
    Let´s say I define some array in the mod file, and instruct it to get its data from some dat file.
    By default, at least in the case of integer arrays, if certain array entries are missing in the dat file they are initialized to 0.
    I need to be able to define what the default value for missing entries is for each array I define, be it an integer or string array.
    I also need to stack conditions, e.g.
    If for some array A the entry A[i] is defined in the dat file, then

    A[i] = Value from dat file,

    if that particular entry is missing, check if some other condition C is given (within elements previously defined and initialized in the mod file). If C=true then

    A[i] = some value

    if C=false

    A[i] = another value.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer