Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Get extreme ray in OPL's script language

    Posted 08/28/14 02:05 PM

    Originally posted by: aaapb


    Hi,

    I'm using OPL's IBM ILOG script language to implement Benders cut formulation but I can't find a way to get the extreme ray. I know that, in C++, I can use getRay but I wonder if there is a similar function in OPL's script language. 

    Thanks.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Get extreme ray in OPL's script language

    Posted 09/01/14 07:04 AM

    Hi

    what you could do is do in scripting an external java call to the java function

    public IloLinearNumExpr getRay() throws IloException

    You can find an example in the documentation at

    IDE and OPL > Optimization Programming Language (OPL) > Language User's Manual > Advanced feature: External functions > Using an external knapsack algorithm

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Get extreme ray in OPL's script language

    Posted 09/05/14 12:11 PM

    Originally posted by: aaapb


    Thanks for your reply.

    I read in the documentation that the first step to run this example is to compile the Java source code using Run.bat but it give me the following errors

    *** ERROR[SCRIPT_002] at 14:0 javaknapsack.mod: Scripting runtime error: (in IloOplCallJava) java.lang.ClassNotFoundException: javaknapsack.Knapsack

    *** ERROR[SCRIPT_004] at 49:1-5 cutstock_ext_main.mod: Execution of "main" failed: "javaknapsack.mod", line 14: IloOplCallJava: java.lang.ClassNotFoundException: javaknapsack.Knapsack.

    Can you help detecting the problem? Thanks for your time.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Get extreme ray in OPL's script language

    Posted 09/05/14 12:36 PM

    Hi,

    in CPLEX_Studio126\opl\examples\opl_interfaces\java\javaknapsack

    if I do run.bat I get

    run:
         [exec]
         [exec] <<< setup
         [exec]
         [exec] Solve master.
         [exec] Tried aggregator 1 time.
         [exec] LP Presolve eliminated 5 rows and 6 columns.
         [exec] All rows and columns eliminated.
         [exec] Presolve time = 0.03 sec. (0.00 ticks)
         [exec]
         [exec] MASTER OBJECTIVE: 125
         [exec] Solve sub.
         [exec]
         [exec] SUB OBJECTIVE: 5
         [exec] Solve master.
         [exec] Tried aggregator 1 time.
         [exec] LP Presolve eliminated 4 rows and 5 columns.
         [exec] Reduced LP has 1 rows, 2 columns, and 2 nonzeros.
         [exec] Presolve time = 0.00 sec. (0.00 ticks)
         [exec]
         [exec] Iteration log . . .
         [exec] Iteration:     1   Dual objective     =            86.600000
         [exec]
         [exec] MASTER OBJECTIVE: 86.6
         [exec] Solve sub.
         [exec]
         [exec] SUB OBJECTIVE: 2.2
         [exec] Solve master.
         [exec] Tried aggregator 1 time.
         [exec] LP Presolve eliminated 3 rows and 4 columns.
         [exec] Reduced LP has 2 rows, 4 columns, and 5 nonzeros.
         [exec] Presolve time = 0.00 sec. (0.00 ticks)
         [exec]
         [exec] Iteration
         [exec] log . . .
         [exec] Iteration:     1   Dual objective     =            51.600000
         [exec]
         [exec] MASTER OBJECTIVE: 65.6
         [exec] Solve sub.
         [exec]
         [exec] SUB OBJECTIVE: 2
         [exec] Solve master.
         [exec] Tried aggregator 1 time.
         [exec] LP Presolve eliminated 2 rows and 3 columns.
         [exec] Reduced LP has 3 rows, 6 columns, and 7 nonzeros.
         [exec] Presolve time = 0.00 sec. (0.00 ticks)
         [exec]
         [exec] Iteration log . . .
         [exec] Iteration:     1   Dual objective     =            27.600000
         [exec]
         [exec] MASTER OBJECTIVE: 53.6
         [exec] Solve sub.
         [exec]
         [exec] SUB OBJECTIVE: 2
         [exec] Solve master.
         [exec] Tried aggregator 1 time.
         [exec] LP Presolve eliminated 1 rows and 2 columns.
         [exec] Reduced LP has 4 rows, 8 columns, and 9 nonzeros.
         [exec] Presolve time = 0.00 sec. (0.00 ticks)
         [exec]
         [exec] Iteration log . . .
         [exec] Iteration:     1   Dual objective     =            17.600000
         [exec]
         [exec] MASTER OBJECTIVE: 48.6
         [exec] Solve sub.
         [exec]
         [exec] SUB OBJECTIVE: 1.2
         [exec] Solve master.
         [exec] Tried aggregator 1 time.
         [exec] LP Presolve eliminated 0 rows and 1 columns.
         [exec] Reduced LP has 5 rows, 10 columns, and 12 nonzeros.
         [exec] Presolve time = 0.00 sec. (0.00 ticks)
         [exec]
         [exec] Iteration log . . .
         [exec] Iteration:     1   Dual objective     =             9.600000
         [exec]
         [exec] MASTER OBJECTIVE: 47
         [exec] Solve sub.
         [exec]
         [exec] SUB OBJECTIVE: 1.1
         [exec] Solve master.
         [exec] Tried aggregator 1 time.
         [exec] LP Presolve eliminated 0 rows and 1 columns.
         [exec] Reduced LP has 5 rows, 11 columns, and 14 nonzeros.
         [exec] Presolve time = 0.00 sec. (0.00 ticks)
         [exec]
         [exec] Iteration log . . .
         [exec] Iteration:     1   Dual objective     =             9.600000
         [exec]
         [exec] MASTER OBJECTIVE: 46.25
         [exec] Solve sub.
         [exec] No solution!
         [exec]  {<<6 1 [1 2 0 0 0]> 17.5>
         [exec]      <<7 1 [0 0 2 0 0]> 8.25>
         [exec]      <<8 1 [0 0 0 2 0]> 5>
         [exec]      <<9 1 [1 0 0 0 1]> 8>
         [exec]      <<10 1 [3 0 1 0 0]> 7.5>}
         [exec] main returns 0
         [exec]
         [exec] <<< main
         [exec]
         [exec]
         [exec] <<< done
         [exec]

    BUILD SUCCESSFUL
    Total time: 7 seconds
    Press any key to continue . . .

     

     

     

     

     

     

     

     

     

     














     






     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Get extreme ray in OPL's script language

    Posted 09/05/14 01:48 PM

    Originally posted by: aaapb


    Hi,

    I imported the example to the workspace. 

    If I do run.bat from  ...\CPLEX_Studio125\workspace\javaknapsack I get the previous mencioned errors.

    if I do run.bat from ...\CPLEX_Studio125\opl\examples\opl_interfaces\java\javaknapsack I get

    Buildfile: C:\Program Files\IBM\ILOG\CPLEX_Studio125\opl\examples\opl_interfaces
    \java\javaknapsack\build.xml

    compile:

    BUILD FAILED
    C:\Program Files\IBM\ILOG\CPLEX_Studio125\opl\examples\opl_interfaces\java\build
    _common.xml:41: Directory C:\Program Files\IBM\ILOG\CPLEX_Studio125\opl\examples
    \opl_interfaces\java\javaknapsack\classes creation was not successful for an unk
    nown reason

    Total time: 0 seconds
    Press any key to continue . . .


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Get extreme ray in OPL's script language

    Posted 09/07/14 05:42 AM

    Hi,

    and what about other examples in C:\Program Files\IBM\ILOG\CPLEX_Studio125\opl\examples\opl_interfaces\java ?

    Have you jdk installed ?

    Maybe you should check your paths variables

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Get extreme ray in OPL's script language

    Posted 09/10/14 08:01 AM

    Originally posted by: aaapb


    Hi,

    First, I want to thank you for all the answers.

    I can't run any of the java opl_interfaces examples. I have jdk 1.7.0_67 install e I already set the environment variables according to IDE and OPL>Language and Interfaces Examples>Interfaces examples.

    I' working with CPLEX_Studio125 and windows 8…

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer