Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  project as executable file ?

    Posted 02/08/09 03:00 PM

    Originally posted by: SystemAdmin


    [subsoho said:]

    Hi all,

    would like to know if i can make executable my opl project, have the trial version ilog opl 6.1.1.

    Its a simple project that gets some data from excel and exports to excel again.

    another one,

    is there a way to export my dvar variables to text files ?

    thx.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: project as executable file ?

    Posted 02/09/09 11:23 AM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Hi,

    the model can be executed without the IDE using oplrun.

    licenses keys are needed to do so.

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: project as executable file ?

    Posted 02/09/09 12:06 PM

    Originally posted by: SystemAdmin


    [subsoho said:]


    Thx Alain.

    So if i only want to use the IDE to make an executable file with my model i cant ? Have to use another programming language to do this ?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: project as executable file ?

    Posted 02/09/09 01:03 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Hi,

    I am not sure exactly what you mean.

    OPL IDE is a development tool, to develop optimization models that can be deployed in several ways :
    - you can deploy as a simple OPL project (incl. -.mod -.dat etc) ythat will be run with oplrun (a command line tool)
    - you can deploy via APIs. You can make a simple C++, Java or .NET program that takes your OPL model and run it. This can be deployed as an .exe esaily.
    - you can also deploy using ODM, creating an application that a business end user will be able to do.

    None of these deployement can be done with the trial version, you need licenses.

    Are you thinking about another kind of deployement ?

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: project as executable file ?

    Posted 02/23/09 01:42 PM

    Originally posted by: SystemAdmin


    [Myke said:]

    Hi Alain,

    I saw your post and it seems you can help me.
    I'm currently developing a system that will run my OPL model from the .NET program.
    My .NET program only takes input and insert it to the database.

    The model then will get the data from database and put the result output in another table.

    My problem is when I run the OPL model from the OPL IDE i get the results out on the database but when I try running my .NET code It doesn't show the results in the database.

    The code Im running to call the model to solve

    Private Sub Testing()       
            Try
                OplFactory.DebugMode = True           
                Dim oplF As OplFactory = New OplFactory
                Dim rc0 As OplRunConfiguration = oplF.CreateOplRunConfiguration(DATADIR + "/Testing 1.mod", DATADIR + "/Testing.dat")
                rc0.GetOplModel().Generate()

                If (rc0.Cplex.Solve = True) Then
                    Response.Write("
    Solution found")
                    Response.Write("OBJECTIVE : " & rc0.Cplex.ObjValue)
                Else
                    Response.Write("No Solution!")
                End If

                rc0.End()
                oplF.End()
            Catch ex As ILOG.Concert.Exception
                Response.Write(ex.Message)         
            End Try
    End Sub

    //Testing 1.mod

    {string} Products = ...;
    {string} Resources = ...;
    int NbPeriods = ...;
    range Periods = 1..NbPeriods;

    float Consumption[Resources][Products] = ...;
    float Capacity[Resources] = ...;
    float Demand[Products][Periods] = ...;
    float InsideCost[Products] = ...;
    float OutsideCost[Products]  = ...;
    float Inventory[Products]  = ...;
    float InvCost[Products]  = ...;

    dvar float+ Inside[Products][Periods];
    dvar float+ Outside[Products][Periods];
    dvar float+ Inv[Products][0..NbPeriods];


    minimize
      sum( p in Products, t in Periods )
          (InsideCost[p]*Inside[p][t] +
          OutsideCost[p]*Outside[p][t] +
          InvCost[p]*Inv[p][t]);

    subject to {
      forall( r in Resources, t in Periods )
        ctCapacity:
          sum( p in Products )
            Consumption[r][p] * Inside[p][t] <= Capacity[r];<br />  forall( p in Products , t in Periods )
        ctDemand:
          Inv[p][t-1] + Inside[p][t] + Outside[p][t] == Demand[p][t] + Inv[p][t];
      forall( p in Products )
        ctInventory:
          Inv[p][0] == Inventory[p];
    };
    tuple plan {
      string product;
      int period;
      float inside;
      float outside;
      float inv;
    }

    {plan} Plan = { <p,t,Inside&#91;p&#93;&#91;t&#93;,Outside&#91;p&#93;&#91;t&#93;,Inv&#91;p&#93;&#91;t&#93;>| p in Products, t in Periods};

    //Testing.dat

    DBconnection source("odbc","DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\\FOR MYKE\\MultiprodDB.mdb//");

    Products from DBread(source, "SELECT Products FROM Products");
    Resources from DBread(source, "SELECT Resources FROM Resources");

    NbPeriods = 3;


    Consumption = [
                    [ 0.5, 0.4, 0.3 ],
                    [ 0.2, 0.4, 0.6 ]
                  ];

    Capacity = [ 20, 40 ];
    Demand = [
              [ 10 100 50 ]
              [ 20 200 100]
              [ 50 100 100]
            ];
    Inventory = [ 0 0 0];
    InvCost = [ 0.1 0.2 0.1]; 
    InsideCost = [ 0.4, 0.6, 0.1 ];
    OutsideCost  = [ 0.8, 0.9, 0.4 ];

    DBExecute(source,"drop table Plan");
    DBExecute(source,"create table Plan(product varchar(15), period varchar(10), inside real, outside real, inv real)");
    Plan to DBUpdate(source,"INSERT INTO Plan(product, period, inside, outside, inv) VALUES(?,?,?,?,?)");



    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: project as executable file ?

    Posted 02/25/09 12:31 PM

    Originally posted by: SystemAdmin


    [afleischer said:]

    Hi Myke,

    in your .NET code I think you forgot to call

    rc0.GetOplModel().PostProcess()

    in your "If (rc0.Cplex.Solve = True) Then" block

    The postprocess will do the update in the database

    Alex
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: project as executable file ?

    Posted 02/26/09 10:10 AM

    Originally posted by: SystemAdmin


    [Myke said:]

    You are my hero!!

    Thank you so much mate. Hope I can help you in the future.

    Regards,
    Myke
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: project as executable file ?

    Posted 02/26/09 01:22 PM

    Originally posted by: SystemAdmin


    [Myke said:]

    One more thing, how to catch the error from the model constraints in .NET?

    #DecisionOptimization
    #OPLusingCPLEXOptimizer