Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  main flow control problem

    Posted 01/26/14 09:01 PM

    Originally posted by: qtbgo


    Hi, I want to run a model with a sequence of dat. The model is as follows, here we have two dat files  to solve. But it report errors, My main block maybe incorrect, can anyone point out how to achieve my purpose.  The mod and the dat files are attached. 

     
     
    using CP;
     
     
    int n = ... ;  //ship number
    int m = ... ; //berth number
     
    int p[i in 1..n] = ...; //
     
     
    int a[i in 1..n] = ... ; //arrival time of ship i.
    int d[i in 1..n] = ... ; //
    int w[i in 1..n] = ...; //
     
    int T =...; // max(i in 1..n)a[i] + sum(i in 1..n)p[i]; //
     
     
    int depth[k in 1..m][t in 1..T] =...; //
     
    int draft[i in 1..n] = ...; //
     
     
    dvar interval tasks[i in 1..n] in 0..T size p[i]; //
     
     
     
     
    minimize  max(i in 1..n)endOf(tasks[i]); //
              
    subject to {
       
      
    };  
     
     
    main{
     
     
      thisOplModel.generate();
      var masterDef = thisOplModel.modelDefinition; 
      var masterCP = new IloCP();
     
     for (var i=1; i<=2; i++)
     {
     
      var masterOpl = new IloOplModel(masterDef,masterCP);
      var dataName = 9+"_"+i+".dat";
      var masterDataSource = new IloOplDataSource(dataName);
      masterOpl.addDataSource(masterDataSource);
      
      masterOpl.generate(); 
      masterCP.startNewSearch(); 
      while(masterCP.next()) 
       {
      writeln("obj = ", masterCP.getObjValue(),  " | time = ", masterCP.info.SolveTime);
       } 
      masterCP.endSearch();  
      masterOpl.end();
       
     };
       
     

    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: main flow control problem

    Posted 01/27/14 08:47 AM

    Originally posted by: ol


    Hello,

    it works on my PC with the files you sent, with OPL version 12.5.1.

    What is your version? and what is the error you get?

    Olivier


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: main flow control problem

    Posted 01/27/14 08:12 PM

    Originally posted by: qtbgo


    you are right, it works. I made a mistake in configuration


    #DecisionOptimization
    #OPLusingCPOptimizer