Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to get the intervalvar solution value with opl interface?

    Posted 06/26/10 07:08 AM

    Originally posted by: flywithme


    Hi,everyone,

    I need to access the interval solution value with opl interface in .net, here is my invoke method. line 1 - 5 work well, but line 6 raise a AccessDenied exception. anybody can help?

    Thanks.

    subCP.Next();
    1 : ITupleSet alternatives = subOpl.GetElement("Alternatives").AsTupleSet();
    2 : IIntervalVarMap altIntervals = subOpl.GetElement("AltIntervals").AsIntervalVarMap();
    3 : foreach (ITuple tuple in alternatives)
    4 : {
    5 : IIntervalVar intervalVar = altIntervals.Get(tuple);
    6 : subCP.GetStartMin(intervalVar);
    7 : }
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: How to get the intervalvar solution value with opl interface?

    Posted 06/28/10 05:39 AM

    Originally posted by: ArnaudS


    Hi,

    You should retrieve the interval solution value as a tuple (and as a tupleMap for interval array).
    In your case, you could do:
    
    ITupleSet alternatives = opl.GetElement(
    "Alternatives").AsTupleSet(); ITupleMap altIntervals = opl.GetElement(
    "AltIntervals").AsTupleMap(); IMapIndexArray index = oplF.MapIndexArray(0); ITuple result = altIntervals.MakeTuple();   foreach (ITuple t in alternatives) 
    { index.Add(t); altIntervals.GetAt(index, result); Console.Out.WriteLine(
    "present: " + result.GetIntValue(
    "present") + 
    " start: " + result.GetIntValue(
    "start") + 
    " end: " + result.GetIntValue(
    "end") + 
    " size: " + result.GetIntValue(
    "size")); index.Clear(); 
    }
    


    Hope this help.

    Arnaud
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: How to get the intervalvar solution value with opl interface?

    Posted 06/28/10 11:54 AM

    Originally posted by: flywithme


    thanks, i will try it.
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: How to get the intervalvar solution value with opl interface?

    Posted 06/28/10 01:16 PM

    Originally posted by: flywithme


    Yes, It works for solution value of interval, can i get the startmin and endmax values after propagation ?

    thanks.
    #DecisionOptimization
    #OPLusingCPOptimizer