Class RuinRandom
java.lang.Object
com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
com.graphhopper.jsprit.core.algorithm.ruin.RuinRandom
- All Implemented Interfaces:
RuinStrategy
Ruin strategy that ruins current solution randomly. I.e.
customer are removed randomly from current solution.
- Author:
- stefan schroeder
-
Field Summary
Fields inherited from class com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
jobFilter, random, ruinShareFactory -
Constructor Summary
ConstructorsConstructorDescriptionRuinRandom(VehicleRoutingProblem vrp, double fraction) Constructs ruinRandom. -
Method Summary
Modifier and TypeMethodDescriptionruinRoutes(Collection<VehicleRoute> vehicleRoutes) Removes a fraction of jobs from vehicleRoutes.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
-
RuinRandom
Constructs ruinRandom.- Parameters:
vrp-fraction- which is the fraction of total c
-
-
Method Details
-
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
-