Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  how to change variable in dat file from .net

    Posted 08/02/10 03:26 AM

    Originally posted by: NRYSTR


    here is my .dat file

    *******************************************
    Products = { kluski capellini fettucine };
    Resources = { flour eggs };
    NbPeriods = 3;

    Consumption = [
    http:// 0.5, 0.4, 0.3 ,
    http:// 0.2, 0.4, 0.6
    ];
    Capacity = 20, 40 ;
    *******************************************

    I want to change NbPeriods from .net C# . How can I do ?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: how to change variable in dat file from .net

    Posted 08/02/10 05:38 AM

    Originally posted by: Olivier Binckly


    you can review the samples available in the distribution

    for example Mulprod_main.cs

    "A simple example that shows how to load an OPL model, solve it, and then modify the model and solve it again."
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: how to change variable in dat file from .net

    Posted 08/02/10 09:36 AM

    Originally posted by: NRYSTR


    Hello , I read Mulprod_Main example
    There is line

    dataElements.GetElement("Capacity").AsNumMap().Set("flour", capFlour);

    it set Capacity. I think , Capacity is an array.
    But NbPeriods is simple integer variable.

    I want set to NbPeriods's value before model solved.
    and then I will set NbPeriods then I will solve model.

    Can you give me and assignment statement sample?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: how to change variable in dat file from .net

    Posted 08/09/10 11:05 AM

    Originally posted by: Laval


    Hi,

    I think a very quick way to fix your problem is to set NbPeriods as an array having one element and use the same code you have below. Instead of"flour", you put the first element of your array which should be "0". dataElements.GetElement("NbPeriods").AsNumMap().Set("0", capFlour);
    I hope this can help.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer