Relu cost on a number of visit #2260
-
Questionmaximum points in a route is 15. I have a fixed cost of 850 till 8 points and post that an additional 65 for every point. For example: if I have 12 points in my route, cost = 850 + 65*4. Answer:I suppose you are using the routing library. The initial fixed cost can be expressed as a vehicle fixed cost. The extra cost per stop after a threshold can be expressed with a dimension which counts stops (its callback just returns 1, route start cumuls are bound to 0 and you can set the capacity to the desired value (15 in your case)); just add a soft upper bound cost on it and vehicle ends using SetCumulVarSoftUpperBound. In your case this would give something like:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Answered |
Beta Was this translation helpful? Give feedback.
Answered