Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Minimizing the number of vehicles

    Posted Sat March 27, 2010 04:15 PM

    Originally posted by: anahana


    Dear all,

    I went through the "Minimizing the number of vehicles" example in CP. Part of the code requires that all empty vehicles are closed (i.e. their first visit is set to equal their last visit) in order to try and minimize the number of vehicles.

    To close empty vehicles, this constraint is added to the model: vehicle.getFirstVisit().getNextVar() == vehicle.getLastVisit().

    If I want to use the empty vehicles after the whole "Minimizing the number of vehicles" algorithm runs, what shall I do? I tried removing the above constraint from the model (using model.remove()), but it's not working. Any thoughts?

    Regards,
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Minimizing the number of vehicles

    Posted Thu April 01, 2010 12:11 PM

    Originally posted by: SystemAdmin


    Hi,

    Why do you say it is not working?
    Did you try to only improve from the solution with the minimum number of vehicles, or did you try to move one visit on a previously deactivated vehicle?
    Theoretically, if you keep the constraint C (vehicle.getFirstVisit().getNextVar() == vehicle.getLastVisit()) then removing it using model.remove(C) should work.

    Cheers,

    Amelie.
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Minimizing the number of vehicles

    Posted Fri April 02, 2010 03:49 AM

    Originally posted by: anahana


    Hi Amelie,

    The reason I'm saying that the "remove" method is not working is because I tried inserting new visits (using IloInsertVisit) into the solution after closing \ deactivating unused vehicles and improving the solution, but non were inserted. Even though I had many supposedly empty vehicles to use.

    Regards,
    #CPOptimizer
    #DecisionOptimization