You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started to work on some of the changes required for operator gain evaluation in #1252, whose purpose is to add a service time component to the costs. Doing so with the current state of the codebase would require to duplicate the "new" service time logic in many places, typically in all the *::compute_gain functions across local search operators. This would be:
error prone;
breaking the DRY principle;
a maintenance nightmare.
This situation is a hint that we could do better. Actually the cost evaluation is already currently repeating a lot of similar logic across operators. If this were refactored so that the various compute_gain functions would call a unified interface, then:
maintenance of the current cost evaluation code would be made much easier;
This would be in a way similar to what we do with is_valid_addition_for_tw that operates in a generic manner on a route with a replaced range and an inserted range. The difference here is that we should keep things happening in constant time, so re-use various precomputed things from SolutionState, and not go through the inserted ranges.
I started to work on some of the changes required for operator gain evaluation in #1252, whose purpose is to add a service time component to the costs. Doing so with the current state of the codebase would require to duplicate the "new" service time logic in many places, typically in all the
*::compute_gainfunctions across local search operators. This would be:This situation is a hint that we could do better. Actually the cost evaluation is already currently repeating a lot of similar logic across operators. If this were refactored so that the various
compute_gainfunctions would call a unified interface, then:This would be in a way similar to what we do with
is_valid_addition_for_twthat operates in a generic manner on a route with a replaced range and an inserted range. The difference here is that we should keep things happening in constant time, so re-use various precomputed things fromSolutionState, and not go through the inserted ranges.