Class RegretInsertionConcurrentFast
java.lang.Object
com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
com.graphhopper.jsprit.core.algorithm.recreate.RegretInsertionConcurrentFast
- All Implemented Interfaces:
InsertionStrategy
Insertion based on regret approach.
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.
- Author:
- stefan schroeder
-
Nested Class Summary
Nested classes/interfaces inherited from class com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
AbstractInsertionStrategy.Insertion -
Field Summary
Fields inherited from class com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
NO_NEW_DEPARTURE_TIME_YET, NO_NEW_DRIVER_YET, NO_NEW_VEHICLE_YET, random, vrp -
Constructor Summary
ConstructorsConstructorDescriptionRegretInsertionConcurrentFast(JobInsertionCostsCalculator jobInsertionCalculator, VehicleRoutingProblem vehicleRoutingProblem, ExecutorService executorService, VehicleFleetManager fleetManager) -
Method Summary
Modifier and TypeMethodDescriptioninsertUnassignedJobs(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs) Runs insertion.voidsetDependencyTypes(DependencyType[] dependencyTypes) voidsetRegretK(int k) voidsetRegretKScoringFunction(RegretKScoringFunction regretKScoringFunction) voidsetRegretScoringFunction(RegretScoringFunction regretScoringFunction) voidsetScoringFunction(ScoringFunction scoringFunction) Sets the scoring function.voidsetSpatialFilter(AdaptiveSpatialFilter spatialFilter) voidsetSwitchAllowed(boolean switchAllowed) toString()Methods inherited from class com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
addListener, getListeners, insertJob, insertJobs, markUnassigned, removeListener, setRandom
-
Constructor Details
-
RegretInsertionConcurrentFast
public RegretInsertionConcurrentFast(JobInsertionCostsCalculator jobInsertionCalculator, VehicleRoutingProblem vehicleRoutingProblem, ExecutorService executorService, VehicleFleetManager fleetManager)
-
-
Method Details
-
setScoringFunction
Sets the scoring function.By default, the this.TimeWindowScorer is used.
- Parameters:
scoringFunction- to score
-
setRegretScoringFunction
-
setRegretKScoringFunction
-
setRegretK
public void setRegretK(int k) -
toString
-
setSwitchAllowed
public void setSwitchAllowed(boolean switchAllowed) -
setDependencyTypes
-
setSpatialFilter
-
getSpatialFilter
-
insertUnassignedJobs
public Collection<Job> insertUnassignedJobs(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs) Runs insertion.Before inserting a job, all unassigned jobs are scored according to its best- and secondBest-insertion plus additional scoring variables.
- Specified by:
insertUnassignedJobsin classAbstractInsertionStrategy- Throws:
RuntimeException- if smth went wrong with thread execution
-