Decision Optimization

 View Only
Expand all | Collapse all

IloCumulExpr is not added to the model

  • 1.  IloCumulExpr is not added to the model

    Posted Mon November 29, 2021 11:05 PM
    Hello everybody,

    I have a small issue. Here below you find a simple pseudo-code of my problem :

    IloIntervalVarArray _tasks ...;
     unsigned int i,q;
    unsigned int Q = _task.getSize();

    IloCumulFunctionExpr cumul(_env);

    for(i=0;i<Q;i++)
         cumul += IloPulse(_taskOnRoute[i],1);

    _model.add(cumul <= 1);
    cumul.end();
    }

    The issue is that this constraint is not added to the model. Additional global constraints (NoOverlap and Alternative) are included in the model successfully, this issue is faced only with this part of the model.

    Have you any idea about this problem ? did I missed something ?

    Thank you in advance,

    Ala-Eddine,

    ------------------------------
    Ala-Eddine Yahiaoui
    ------------------------------


  • 2.  RE: IloCumulExpr is not added to the model

    Posted Tue November 30, 2021 03:37 AM
    Can you send a code to reproduce the problem?

    ------------------------------
    Olivier Lhomme
    ------------------------------



  • 3.  RE: IloCumulExpr is not added to the model

    Posted Wed December 01, 2021 12:09 PM
    You should not call end(),

    end

    public void end()

    This member function first removes the invoking extractable object from all other extractable objects where it is used (such as a model, ranges, etc.) and then deletes the invoking extractable object. That is, it frees all the resources used by the invoking object. After a call to this member function, you can not use the invoking extractable object again.

    Note
    The member function end notifies Concert Technology algorithms about the destruction of this invoking object.


    ------------------------------
    David Gravot
    ------------------------------