Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  getCumulVar

    Posted 12/07/08 01:14 PM

    Originally posted by: SystemAdmin


    [anahana said:]

    I am trying to retrieve a Diminsion2 (time) cumulative value for each visit in a route; I created a route iterator and a vehicle iterator to step through each visit in each vehicle, I then used the visit.getCumulVar(time) to obtain the value of the cumulative variable at each visit; however, I'm only getting the lower and upper bounds for the variables, not their actual values at each visit (i.e. for all visits in all vehicles I am getting [0..1.#INF]), which is the range for the IloNumVar returned by the getCumulVar, but I don't need the range, I need the value. Any idea how I can do that?

    Regards,
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: getCumulVar

    Posted 12/08/08 04:47 PM

    Originally posted by: SystemAdmin


    [ahocquet said:]

    Hi,

    You have to use :
    solver.getMin(visit.getCumulVar(time))
    solver.getMax(visit.getCumulVar(time))

    Cheers.
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: getCumulVar

    Posted 12/08/08 06:30 PM

    Originally posted by: SystemAdmin


    [anahana said:]

    Hi,

    Wouldn't that give the same results as using visit.getCumulVar(time).getUB or getLB? Which in turn will give me the same bounds ([0...1.#INF]).

    Cheers
    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: getCumulVar

    Posted 12/08/08 06:40 PM

    Originally posted by: SystemAdmin


    [ahocquet said:]

    No. It should give you the results you expect, i.e. the min and max after resolution.
    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: getCumulVar

    Posted 12/08/08 06:51 PM

    Originally posted by: SystemAdmin


    [anahana said:]

    Thanks, I'll give it a try and let you know.
    #CPOptimizer
    #DecisionOptimization


  • 6.  Re: getCumulVar

    Posted 12/08/08 08:40 PM

    Originally posted by: SystemAdmin


    [anahana said:]

    Hi,

    I'm experiencing a minor problem in using the getMin\Max method; as these are methods of the IloSolver class, I can not access them because the instance of IloSolver (in my case _solver) is Private (specifically, I get this error message: cannot access private member declared in class 'RoutingSolver').

    If I attempt to make _solver Public, the program halts upon exection. Is there a way to use an instance of IloSolver while keeping it Private?

    Regards,
    #CPOptimizer
    #DecisionOptimization


  • 7.  Re: getCumulVar

    Posted 12/09/08 12:08 PM

    Originally posted by: SystemAdmin


    [ahocquet said:]

    There is no reason why you could not declare your _solver public. The exception is strange, and I'm pretty sure it has nothing to do with the fact you declare it public... Is it the solver::getMin/Max that throws the exception?
    Regarding your pure C++ question/problem, you can just define a public method on your class RoutingSolver such as :
    IloNum getMin(IloNumVar var) const {
      return _solver.getMin(var);
    }
    #CPOptimizer
    #DecisionOptimization


  • 8.  Re: getCumulVar

    Posted 12/12/08 04:57 PM

    Originally posted by: SystemAdmin


    [anahana said:]

    no execption is thrown by either _solver or solver::getMin\Max; in fact, the program compiles, builds, and links properly; however after the MS-DOS prompt window appears, I get the Windows dialog box stating that:

    "pdp.exe has encountered a problem and needs to close. 
    We are sorry for the inconvenience."

    This only happens if I declare _solver as Public instead of Private.

    Nontheless, I ended up moving the entire method (that needed _solver to be declared as Public) inside Main and used the already defined instances of RoutingSolver and RoutingModel inside Main to access the getMin and getMax methods. It worked smoothly, and I did get the limits I was looking for.

    Thanks for the support.

    p.s. if you have any idea why I'm getting that dialog box, please let me know.
    #CPOptimizer
    #DecisionOptimization


  • 9.  Re: getCumulVar

    Posted 12/12/08 05:01 PM

    Originally posted by: SystemAdmin


    [ahocquet said:]

    Fine if it works!
    I don't have any idea regarding your dialog box...

    #CPOptimizer
    #DecisionOptimization