Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  question Cplex studio OPL

    Posted 04/24/13 03:15 PM

    Originally posted by: 82BF_AIT_HADDADENE_Syrine_Rouf


    Hello, I am a beginner, I'm working on Cplex in OPL Studio IDE? I have a problem which is that: when I run my program without the main function I get to see my solutions on the "browser problem" so it allows me to study well the achievements against when I add the function main I have not posted anything on the browser, I can only display the results on the console. Thank you for helping me;  


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: question Cplex studio OPL

    Posted 04/28/13 04:52 AM

    Hi,

     

    are you sure that your model is feasible?

    In the problem browser do you see solution with objective x or relaxed solution ?

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: question Cplex studio OPL

    Posted 04/28/13 06:35 AM

    Originally posted by: 82BF_AIT_HADDADENE_Syrine_Rouf


     

    thank you for your reply.
    Yes I am sure that the model is feasible because though nothing is displayed in the browser problems, I can see solutions on the console these are correct.

     

    I do not know if there is a command to add to the main function to display the solutions in the browser problems?
    Here is my main function

     

    main
    {  
        var opl = thisOplModel;
        var mod = opl.modelDefinition;
        var dat = opl.dataElements;
        var status = 0;
        
       var best;
       var curr = Infinity;
       while (best != curr) 
       {
            best=curr;
            // IloCplex() sert à résoudre a Mixed Integer Programming
            var cplex1 = new IloCplex();
            opl = new IloOplModel(mod,cplex1);
            opl.addDataSource(dat);
            opl.generate();
            if (!cplex1.solve()) {
                writeln("ERROR: could not solve");
                status = 1;
                opl.end();
                break;
            }   
            opl.postProcess();   
            curr = cplex1.getObjValue();
            writeln("Current solution : ", curr);
            writeln("Arcs Adjacents : ", opl.Adj);
            if (opl.newk!=0) 
            {
            dat.subtours.add(opl.newk, opl.newS);
            writeln("le sous tours existant : ", opl.subtours);
    opl.end();
    cplex1.end();
            }
            else
            {          
             writeln("y a rien à rajouter");
              opl.end();
              cplex1.end();
              break;      
           }      
      }    
        status;
    }
     

     

    regards.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: question Cplex studio OPL

    Posted 04/28/13 06:36 AM

    Originally posted by: 82BF_AIT_HADDADENE_Syrine_Rouf


     

    thank you for your reply.
    Yes I am sure that the model is feasible because though nothing is displayed in the browser problems, I can see solutions on the console these are correct.

     

    I do not know if there is a command to add to the main function to display the solutions in the browser problems?
    Here is my main function

     

    main
    {  
        var opl = thisOplModel;
        var mod = opl.modelDefinition;
        var dat = opl.dataElements;
        var status = 0;
        
       var best;
       var curr = Infinity;
       while (best != curr) 
       {
            best=curr;
            // IloCplex() sert à résoudre a Mixed Integer Programming
            var cplex1 = new IloCplex();
            opl = new IloOplModel(mod,cplex1);
            opl.addDataSource(dat);
            opl.generate();
            if (!cplex1.solve()) {
                writeln("ERROR: could not solve");
                status = 1;
                opl.end();
                break;
            }   
            opl.postProcess();   
            curr = cplex1.getObjValue();
            writeln("Current solution : ", curr);
            writeln("Arcs Adjacents : ", opl.Adj);
            if (opl.newk!=0) 
            {
            dat.subtours.add(opl.newk, opl.newS);
            writeln("le sous tours existant : ", opl.subtours);
    opl.end();
    cplex1.end();
            }
            else
            {          
             writeln("y a rien à rajouter");
              opl.end();
              cplex1.end();
              break;      
           }      
      }    
        status;
    }
     

     

    regards.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: question Cplex studio OPL

    Posted 04/28/13 07:37 AM

    Hi

     

    so then what you could do to see the problem browser for each step is the following:

    use

    printExternalData

    at each iteration and then use the mod file and this generated dat file without any main block and then you will have access for sure to the problem browser

     

    I hope this helps

     

    regards

     

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: question Cplex studio OPL

    Posted 05/03/13 12:00 PM

    Originally posted by: 82BF_AIT_HADDADENE_Syrine_Rouf


     

    Hi

    unfortunately,

    it does not work,

    I have the solutions displayed only on console,

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: question Cplex studio OPL

    Posted 05/03/13 12:40 PM

    Hi

     

    indeed if you use plain write or writeln you will have the result in the console.

     

    But with an IloOplOutputFile you can write in dat files.

     

    1. 
      
      var ofile = new 
      
      
      IloOplOutputFile("mulprod_main.txt");
      
    2. Then you can write statements such as:
      
           ofile.writeln("Objective with capFlour = ", capFlour, " is ", curr);  
      

    I hope this helps

     

    Regards

     

    Alex Fleischer


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: question Cplex studio OPL

    Posted 05/04/13 08:23 AM

    Originally posted by: 82BF_AIT_HADDADENE_Syrine_Rouf


    Hi

    Thank you for your reply,

    but my real concern is not that,
    because what I want is a good look at my results, I would to see something that looks like this "see navigateur.png"
      
    By cons, if I display my results with writeln either console or a txt file, I have something that looks like this "see console.png",
    and it is not easy to study.

     

    in fact, I have another question
    how can I tell it to generate some constraints, such as opl.generate () "I want it to generate only the first five constraints??

     

    Regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 9.  Re: question Cplex studio OPL

    Posted 05/04/13 09:56 AM

    Hi,

     

    printExternalData will not write the result but the .dat and then running the .mod and the .dat in the IDE you will have access to the problem browser info, which is what you need.

    In your subject to constraints, you can use if in order to condition some constraints:

    subject to

    if (a==1) ct: x<=3;

     

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 10.  Re: question Cplex studio OPL

    Posted 05/07/13 06:32 AM

    Originally posted by: 82BF_AIT_HADDADENE_Syrine_Rouf


     

    Hello,
    I have a problem with my Oplide, I can not open it,
    I was working normally, and then I put my computer to sleep and resuming it he said : une erreur est survenue, Reportez vous au fichier journal???
    thanks.

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 11.  Re: question Cplex studio OPL

    Posted 05/13/13 04:48 AM

    Hi

     

    have tou tried oplide -clean in the command line ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 12.  Re: question Cplex studio OPL

    Posted 05/13/13 10:13 AM

    Originally posted by: 82BF_AIT_HADDADENE_Syrine_Rouf


     

    Hello, 

     

    Please, I still have the same concern compared to the display in the browser problem, except that this time, I can see the browser, but it gives me no value while a solution is displayed in the console. 

    thanks.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 13.  Re: question Cplex studio OPL

    Posted 05/13/13 03:52 PM

    You see solutions in the problem browser when you do not have a main.

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 14.  Re: question Cplex studio OPL

    Posted 04/28/13 09:08 AM

    Originally posted by: 82BF_AIT_HADDADENE_Syrine_Rouf


    I will try

    thank you


    #DecisionOptimization
    #OPLusingCPLEXOptimizer