Decision Optimization

Decision Optimization

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


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

Error at _cmdno 2 executing "solve" command

  • 1.  Error at _cmdno 2 executing "solve" command

    Posted 06/27/18 01:00 AM

    Originally posted by: E.Bessa


    Hi, 

     
    I didnt understand why this constraints is not working. Can anyone help me? 
     
    set Jor := {1..j}; # jornadas
    set Notu {D};
    set Dp {D};
    set Simples {D};
    set Kj {d1 in D} := Dp[d1] union Simples[d1] union Notu[d1] in Jor;
    var Xij0 {C, D} binary; # if pilot C do not work (Xij0 =1), however Xij0 = 0 
     
     
    s.t. 3Folga2 {c1 in C, d1 in D}: # to do a night journey in d1+1 the pilot c1 must rest on day d1 (Xij0 = 1) or must did a night journey on d1
    sum {notu in Notu[d1]} Xijk [c1,d1,notu] + Xij0[c1,d1] <= sum {notu in Notu[d1]} Xijk [c1,d1+1,notu];  
     
    ampl: model teste2.mod;
    Error at _cmdno 2 executing "solve" command
    (file teste2.mod, line 180, offset 6008):
    error processing constraint 3Folga2[1,7]:
    invalid subscript Xijk[1,8,4]
     
    set Notu[1] := 4;
    set Notu[2] := 4;
    set Notu[3] := 4;
    set Notu[4] := 4;
    set Notu[5] := 4;
    set Notu[6] := 4;
    set Notu[7] := 4;
     

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Error at _cmdno 2 executing "solve" command

    Posted 06/27/18 02:10 AM

    This looks like a problem with AMPL? It seems ampl has problems executing your model before it even attempts to call CPLEX. So you may be better off asking this question on an AMPL forum.

    From the error message and what you showed a very wild guess would be that the problems come from

    Xijk[c1,d1+1,notu]

    for the last element in D. In that case index d1+1 is probably not defined? Maybe the constraint should not be defined for the last element in D?


    #CPLEXOptimizers
    #DecisionOptimization