Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  intermediate solutions to excel

    Posted 04/01/14 12:29 AM

    Originally posted by: Rajasekhar Kadambur


    How to write intermediate solutions to excel instantaneously when they are found.

    In general CP solves the problem and post process the final solution to excel but how to write the intermediate solutions to excel before complete solving and that write should be dynamic not post process.

    Explaining this with an example would be very helpful. Thanks in advance.....


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: intermediate solutions to excel

    Posted 04/04/14 10:04 AM

    Originally posted by: ArnaudS


    Hi,

    It is not possible to write intermediate solution in an Excel file dynamically.
     
    If you want to save the intermediate solutions in a file you can do like this:
     
            using CP;
    
            PairRound mirror[1..nbPairs] = ...;     
    
            dvar int pattern[1..nbRounds] in Where;
    
            subject to
            {
                    [...]
            }
    
            main {
                    var n = 0;
                    thisOplModel.generate();
                    cp.startNewSearch();
      
                    var outputFile = new IloOplOutputFile("e:\\output.txt");
      
                    while (cp.next()) {
                            n++;
                            writeln("solution ", n);
                            outputFile.writeln( thisOplModel.pattern );
                    }
    
                    outputFile.close();
            }
    

     

    Hope this help.
     
    Regards,
    Arnaud

    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: intermediate solutions to excel

    Posted 04/04/14 01:13 PM

    Originally posted by: Rajasekhar Kadambur


    Thanks for your response.

    I got this one this, writing to text file is pretty faster than writing to excel.

    for writing to excel dynamically we need to have thisOplModel.postprocess() in side the cp.next loop...


    #DecisionOptimization
    #OPLusingCPOptimizer