Class SolutionFactory
- java.lang.Object
-
- org.optaweb.vehiclerouting.plugin.planner.domain.SolutionFactory
-
public class SolutionFactory extends Object
CreatesVehicleRoutingSolutioninstances.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static VehicleRoutingSolutionemptySolution()Create an empty solution.static VehicleRoutingSolutionsolutionFromVisits(List<PlanningVehicle> vehicles, PlanningDepot depot, List<PlanningVisit> visits)Create a new solution from given vehicles, depot and visits.
-
-
-
Method Detail
-
emptySolution
public static VehicleRoutingSolution emptySolution()
Create an empty solution. Empty solution has zero locations, depots, visits and vehicles and a zero score.- Returns:
- empty solution
-
solutionFromVisits
public static VehicleRoutingSolution solutionFromVisits(List<PlanningVehicle> vehicles, PlanningDepot depot, List<PlanningVisit> visits)
Create a new solution from given vehicles, depot and visits. All vehicles will be placed in the depot.The returned solution's vehicles and locations are new collections so modifying the solution won't affect the collections given as arguments.
Elements of the argument collections are NOT cloned.
- Parameters:
vehicles- vehiclesdepot- depotvisits- visits- Returns:
- solution containing the given vehicles, depot, visits and their locations
-
-