public class RegretInsertionConcurrent extends AbstractInsertionStrategy
Basically calculates the insertion cost of the firstBest and the secondBest alternative. The score is then calculated as difference between secondBest and firstBest, plus additional scoring variables that can defined in this.ScoringFunction. The idea is that if the cost of the secondBest alternative is way higher than the first best, it seems to be important to insert this customer immediatedly. If difference is not that high, it might not impact solution if this customer is inserted later.
AbstractInsertionStrategy.InsertionNO_NEW_DEPARTURE_TIME_YET, NO_NEW_DRIVER_YET, NO_NEW_VEHICLE_YET, random, vrp| Constructor and Description |
|---|
RegretInsertionConcurrent(JobInsertionCostsCalculator jobInsertionCalculator,
VehicleRoutingProblem vehicleRoutingProblem,
ExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
Collection<Job> |
insertUnassignedJobs(Collection<VehicleRoute> routes,
Collection<Job> unassignedJobs)
Runs insertion.
|
void |
setRegretScoringFunction(RegretScoringFunction regretScoringFunction) |
void |
setScoringFunction(ScoringFunction scoringFunction)
Sets the scoring function.
|
String |
toString() |
addListener, getListeners, insertJob, insertJobs, markUnassigned, removeListener, setRandompublic RegretInsertionConcurrent(JobInsertionCostsCalculator jobInsertionCalculator, VehicleRoutingProblem vehicleRoutingProblem, ExecutorService executorService)
public void setScoringFunction(ScoringFunction scoringFunction)
By default, the this.TimeWindowScorer is used.
scoringFunction - to scorepublic void setRegretScoringFunction(RegretScoringFunction regretScoringFunction)
public Collection<Job> insertUnassignedJobs(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs)
Before inserting a job, all unassigned jobs are scored according to its best- and secondBest-insertion plus additional scoring variables.
insertUnassignedJobs in class AbstractInsertionStrategyRuntimeException - if smth went wrong with thread executionCopyright © 2013–2024. All rights reserved.