Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Create copy of implementation object

    Posted 06/14/21 12:25 PM

    I have a MILP modelled using the C++ API of Cplex. The MILP is solved several times and after each solve certain constraints are modified and variables are removed or added. Before starting the process of modifying constraints and variables, I would like to save the old state. Therefore, I would like to create a copy of the current constraints and variables I have, before modifying them, so that I can fall back on those values. I don't know how to do that, because e.g.

    IloNumVarArray p(env, n); IloNumVarArray p_save(env,n); for (int i = 0; i < n; i++) { p_save[i] = p[i]; }

    just seems to create a copy of the handle object and not the implementation object (?). Using the above code, if I modify p later on, let's say

    p[2].end();

    the same modification happens with `p_save`, i.e. `p_save[2]`is an empty handle. How can I copy `p` so that when I modify `p`later on the copy `p_save` is not modified?






    #DecisionOptimization
    #Support
    #SupportMigration


  • 2.  RE: Create copy of implementation object

    Posted 06/14/21 11:08 PM

    There is a function for C++ API IloGetClone https://www.ibm.com/docs/en/icos/20.1.0?topic=f-ilogetclone

    If you need further discussion, please open a case if you are entitled. Otherwise, please discuss your question in Data Science Community https://community.ibm.com/community/user/datascience/communities/community-home/digestviewer?communitykey=ab7de0fd-6f43-47a9-8261-33578a231bb7&tab=digestviewer






    #DecisionOptimization
    #Support
    #SupportMigration