Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Warm start for a separate run

    Posted 03/18/11 02:34 PM

    Originally posted by: JaneM


    I have read all of the documentation on warmstart, vectors and basis and the forum results for "warmstart" and "warm start" that I could find. All of the examples assume that you are using getVectors, attach, and setVectors in the same run. But what if you want to separate the work into two runs.

    In the first run, I set a time limit so I can look at the results and then I use main commands under "run for solution set 1" and I get a successful preparation for a warm start.

    Now I want to use that solution set for a second run using the same exact model. Using just the setVectors command doesn't work as in "Run for solution set 2" doesn't work because it sets everything to 0.

    Apparently one needs to write the information to an output file or have some way to pick up the set of vectors from the previous run. But it is not clear how to do this. How can this be done.

    Run for solution set 1
    main {
    var status = 0;
    thisOplModel.generate();
    var plan = thisOplModel;

    var vectors = new IloOplCplexVectors();

    if ( vectors.getVectors(cplex) ) {
    writeln("warm start preparation successful: ",vectors.status);
    writeln("Nrows = ", vectors.Nrows, ", Ncols = ", vectors.Ncols);
    }
    else {
    writeln("warm start preparation failed: ",vectors.status);
    }

    }
    Run for solution set 2 with warm start
    main {
    var status = 0;
    thisOplModel.generate();
    var plan = thisOplModel;

    var vectors = new IloOplCplexVectors();

    if ( vectors.setVectors(cplex) ) {
    writeln("warm start ", vectors.Nrows,"x", vectors.Ncols, "found", vectors.status);
    }
    else {
    writeln("warm start ", vectors.Nrows,"x", vectors.Ncols, "failed", vectors.status);
    }
    }
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Warm start for a separate run

    Posted 03/21/11 05:37 AM
    Hi,

    what you could do is to use

    public void writeVectors(java.lang.String name)
                      throws IloException
    


    in java and call this fro your script with IloOplCallJava

    Regards

    Alex
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Warm start for a separate run

    Posted 03/21/11 05:03 PM

    Originally posted by: JaneM


    Alex - thanks for the quick reply.

    What if I don't use java or any of the other OPL interfaces?

    Thanks,
    Jane
    #DecisionOptimization
    #OPLusingCPLEXOptimizer