Class RoutingPlan
- java.lang.Object
-
- org.optaweb.vehiclerouting.domain.RoutingPlan
-
public class RoutingPlan extends Object
Route plan for the whole vehicle fleet.
-
-
Constructor Summary
Constructors Constructor Description RoutingPlan(Distance distance, List<Vehicle> vehicles, Location depot, List<Location> visits, List<RouteWithTrack> routes)Create a routing plan.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Location>depot()The depot.Distancedistance()Total distance traveled (sum of distances of all routes).static RoutingPlanempty()Create an empty routing plan.booleanisEmpty()Routing plan is empty when there is no depot, no vehicles and no routes.List<RouteWithTrack>routes()Routes of all vehicles in the depot.List<Vehicle>vehicles()All available vehicles.List<Location>visits()All visits that are part of the routing problem.
-
-
-
Constructor Detail
-
RoutingPlan
public RoutingPlan(Distance distance, List<Vehicle> vehicles, Location depot, List<Location> visits, List<RouteWithTrack> routes)
Create a routing plan.- Parameters:
distance- the overall travel distancevehicles- all available vehiclesdepot- the depot (may benull)visits- all visitsroutes- routes of all vehicles
-
-
Method Detail
-
empty
public static RoutingPlan empty()
Create an empty routing plan.- Returns:
- empty routing plan
-
distance
public Distance distance()
Total distance traveled (sum of distances of all routes).- Returns:
- travel distance
-
routes
public List<RouteWithTrack> routes()
Routes of all vehicles in the depot. Includes empty routes of vehicles that stay in the depot.- Returns:
- all routes (may be empty when there is no depot or no vehicles)
-
visits
public List<Location> visits()
All visits that are part of the routing problem.- Returns:
- all visits
-
isEmpty
public boolean isEmpty()
Routing plan is empty when there is no depot, no vehicles and no routes.- Returns:
trueif the plan is empty
-
-