Class RuinClusters
java.lang.Object
com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
com.graphhopper.jsprit.core.algorithm.ruin.RuinClusters
- All Implemented Interfaces:
IterationStartsListener,VehicleRoutingAlgorithmListener,RuinStrategy
Ruin strategy that ruins current solution randomly. I.e.
customer are removed randomly from current solution.
- Author:
- stefan schroeder
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
jobFilter, random, ruinShareFactory -
Constructor Summary
ConstructorsConstructorDescriptionRuinClusters(VehicleRoutingProblem vrp, int initialNumberJobsToRemove, JobNeighborhoods jobNeighborhoods) -
Method Summary
Modifier and TypeMethodDescriptionvoidinformIterationStarts(int i, VehicleRoutingProblem problem, Collection<VehicleRoutingProblemSolution> solutions) ruinRoutes(Collection<VehicleRoute> vehicleRoutes) Removes a fraction of jobs from vehicleRoutes.voidsetNoClusters(int noClusters) toString()Methods inherited from class com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
addListener, filterJobs, getListeners, getRuinShareFactory, removeJob, removeJob, removeListener, ruin, setJobFilter, setRandom, setRuinShareFactory
-
Constructor Details
-
RuinClusters
public RuinClusters(VehicleRoutingProblem vrp, int initialNumberJobsToRemove, JobNeighborhoods jobNeighborhoods)
-
-
Method Details
-
informIterationStarts
public void informIterationStarts(int i, VehicleRoutingProblem problem, Collection<VehicleRoutingProblemSolution> solutions) - Specified by:
informIterationStartsin interfaceIterationStartsListener
-
setNoClusters
public void setNoClusters(int noClusters) -
ruinRoutes
Removes a fraction of jobs from vehicleRoutes.The number of jobs is calculated as follows: Math.ceil(vrp.getJobs().values().size() * fractionOfAllNodes2beRuined).
- Specified by:
ruinRoutesin classAbstractRuinStrategy
-
toString
-