mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
reformat according to .editorconfig
This commit is contained in:
parent
ddb6c8d658
commit
01bf0d55af
37 changed files with 39 additions and 38 deletions
|
|
@ -106,7 +106,7 @@ class TimeWindowConstraint implements HardActivityConstraint {
|
|||
double latestArrTimeAtNewAct = Math.min(newAct.getTheoreticalLatestOperationStartTime(), latestArrTimeAtNextAct -
|
||||
routingCosts.getBackwardTransportTime(nextActLocation, newAct.getLocation(), latestArrTimeAtNextAct, iFacts.getNewDriver(),
|
||||
iFacts.getNewVehicle()) - newAct.getOperationTime());
|
||||
/*
|
||||
/*
|
||||
* |--- prevAct ---|
|
||||
* |--- vehicle's arrival @newAct
|
||||
* latest arrival of vehicle @newAct ---|
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class VehicleDependentTimeWindowConstraints implements HardActivityConstr
|
|||
double arrTimeAtNextAct = endTimeAtNewAct + routingCosts.getTransportTime(newAct.getLocation(), nextActLocation, endTimeAtNewAct, iFacts.getNewDriver(), iFacts.getNewVehicle());
|
||||
|
||||
/*
|
||||
* |--- newAct ---|
|
||||
* |--- newAct ---|
|
||||
* |--- vehicle's arrival @nextAct
|
||||
* latest arrival of vehicle @nextAct ---|
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class Service extends AbstractJob {
|
|||
*
|
||||
* @author schroeder
|
||||
*/
|
||||
public static class Builder <T extends Service> {
|
||||
public static class Builder<T extends Service> {
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ public class RefuseCollectionWithCostsHigherThanTimesAndFiniteFleet_IT {
|
|||
continue;
|
||||
}
|
||||
String[] lineTokens = line.split(",");
|
||||
/*
|
||||
/*
|
||||
* build service
|
||||
*/
|
||||
Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1]))
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ public class RefuseCollectionWithCostsHigherThanTimesAndFiniteFleet_withTimeAndD
|
|||
continue;
|
||||
}
|
||||
String[] lineTokens = line.split(",");
|
||||
/*
|
||||
/*
|
||||
* build service
|
||||
*/
|
||||
Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1]))
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class RefuseCollection_IT {
|
|||
VehicleImpl bigVehicle = vehicleBuilder.build();
|
||||
|
||||
/*
|
||||
* start building the problem
|
||||
* start building the problem
|
||||
*/
|
||||
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
|
||||
vrpBuilder.setFleetSize(FleetSize.INFINITE);
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ public class TestLocalActivityInsertionCostsCalculator {
|
|||
//ref: 10 + 50 + 20 = 80
|
||||
//new: 80 - 10 - 30 - 20 = 20
|
||||
/*
|
||||
w(new) + w(next) - w_old(next) - min{start_delay(next),future_waiting}
|
||||
w(new) + w(next) - w_old(next) - min{start_delay(next),future_waiting}
|
||||
*/
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class TestMixedServiceAndShipmentsProblemOnRouteLevel {
|
|||
@Test
|
||||
public void whenHavingOnlyServicesInOneProblem_andInsertionShouldBeMadeOnRouteLevel_itShouldAssertTrue() {
|
||||
/* get a vehicle type-builder and build a type with the typeId "vehicleType" and a capacity of 2
|
||||
*/
|
||||
*/
|
||||
VehicleTypeImpl.Builder vehicleTypeBuilder = VehicleTypeImpl.Builder.newInstance("vehicleType").addCapacityDimension(0, 2);
|
||||
VehicleType vehicleType = vehicleTypeBuilder.build();
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class ConfigureAlgorithmInCodeInsteadOfPerXml {
|
|||
VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.createAlgorithm(problem, algorithmConfig);
|
||||
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class CostMatrixExample {
|
|||
|
||||
|
||||
/*
|
||||
* Assume the following symmetric distance-matrix
|
||||
* Assume the following symmetric distance-matrix
|
||||
* from,to,distance
|
||||
* 0,1,10.0
|
||||
* 0,2,20.0
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class EnRoutePickupAndDeliveryWithMultipleDepotsAndOpenRoutesExample {
|
|||
*/
|
||||
VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(problem, "input/algorithmConfig.xml");
|
||||
// algorithm.setMaxIterations(30000);
|
||||
/*
|
||||
/*
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class MultipleDepotExample {
|
|||
vrpBuilder.setFleetSize(FleetSize.FINITE);
|
||||
|
||||
/*
|
||||
* build the problem
|
||||
* build the problem
|
||||
*/
|
||||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public class MultipleDepotExample2 {
|
|||
vrpBuilder.setFleetSize(FleetSize.FINITE);
|
||||
|
||||
/*
|
||||
* build the problem
|
||||
* build the problem
|
||||
*/
|
||||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class MultipleDepotWithInitialRoutesExample {
|
|||
* build the problem
|
||||
*/
|
||||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
/*
|
||||
/*
|
||||
* since job (service) 26 and 44 are already planned in initial route and thus static AND sequence is fixed they
|
||||
* should not be in jobMap anymore (only variable jobs are in jobMap)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class PickupAndDeliveryExample {
|
|||
// VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
|
||||
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml");
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
/*
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class PickupAndDeliveryExample2 {
|
|||
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml");
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class PickupAndDeliveryOpenExample {
|
|||
// VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
|
||||
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_open.xml");
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
/*
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class RefuseCollectionExample {
|
|||
continue;
|
||||
}
|
||||
String[] lineTokens = line.split(",");
|
||||
/*
|
||||
/*
|
||||
* build service
|
||||
*/
|
||||
Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1])).setLocation(Location.newInstance(lineTokens[0])).build();
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public class RefuseCollectionWithFastMatrixExample {
|
|||
continue;
|
||||
}
|
||||
String[] lineTokens = line.split(",");
|
||||
/*
|
||||
/*
|
||||
* build service
|
||||
*/
|
||||
Service service = Service.Builder.newInstance(lineTokens[0])
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class ServicePickupsWithMultipleDepotsExample {
|
|||
algorithm.setMaxIterations(10);
|
||||
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -62,11 +62,12 @@ public class SimpleDepotBoundedPickupAndDeliveryExample {
|
|||
/*
|
||||
* build pickups and deliveries at the required locations, each with a capacity-demand of 1.
|
||||
*/
|
||||
|
||||
Pickup pickup1 = Pickup.Builder.newInstance("1").addSizeDimension(0, 1).setLocation(Location.newInstance(5, 7)).build();
|
||||
Delivery delivery1 = Delivery.Builder.newInstance("2").addSizeDimension(0, 1).setLocation(Location.newInstance(5, 13)).build();
|
||||
|
||||
Pickup pickup2 = Pickup.Builder.newInstance("3").addSizeDimension(0, 1).setLocation(Location.newInstance(15, 7)).build();
|
||||
Delivery delivery2 = Delivery.Builder.newInstance("4").addSizeDimension(0, 1).setLocation(Location.newInstance(15, 13)).build();
|
||||
Delivery delivery2 = Delivery.Builder.newInstance("4").addSizeDimension(0, 1).setLocation(Location.newInstance(15, 13)).build();
|
||||
|
||||
|
||||
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
|
||||
|
|
@ -82,7 +83,7 @@ public class SimpleDepotBoundedPickupAndDeliveryExample {
|
|||
VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
|
||||
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class SimpleEnRoutePickupAndDeliveryExample {
|
|||
VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
|
||||
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class SimpleEnRoutePickupAndDeliveryOpenRoutesExample {
|
|||
VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
|
||||
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class SimpleEnRoutePickupAndDeliveryWithDepotBoundedDeliveriesExample {
|
|||
Shipment shipment4 = Shipment.Builder.newInstance("4").addSizeDimension(0, 1).setPickupLocation(loc(Coordinate.newInstance(15, 13))).setDeliveryLocation(loc(Coordinate.newInstance(14, 11))).build();
|
||||
//
|
||||
/*
|
||||
* build deliveries, (implicitly picked up in the depot)
|
||||
* build deliveries, (implicitly picked up in the depot)
|
||||
* 1: (4,8)
|
||||
* 2: (4,12)
|
||||
* 3: (16,8)
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class SimpleExample {
|
|||
VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
|
||||
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class SimpleExampleOpenRoutes {
|
|||
VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(problem, "input/algorithmConfig_fix.xml");
|
||||
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public class SimpleExampleWithSkills {
|
|||
VehicleRoutingAlgorithm algorithm = vraBuilder.build();
|
||||
|
||||
/*
|
||||
* and search a solution
|
||||
* and search a solution
|
||||
*/
|
||||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public class SimpleVRPWithBackhaulsExample {
|
|||
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
|
||||
|
||||
/*
|
||||
* get the best
|
||||
* get the best
|
||||
*/
|
||||
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class SolomonExample {
|
|||
VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
|
||||
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class SolomonExampleWithSpecifiedVehicleEndLocations {
|
|||
vra.setMaxIterations(20000);
|
||||
// vra.setPrematureBreak(100);
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
/*
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class SolomonExampleWithSpecifiedVehicleEndLocationsWithoutTWs {
|
|||
vra.setMaxIterations(20000);
|
||||
// vra.setPrematureBreak(100);
|
||||
// vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
/*
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class SolomonOpenExample {
|
|||
VehicleRoutingAlgorithm vra = Jsprit.createAlgorithm(vrp);
|
||||
// vra.setPrematureBreak(100);
|
||||
// vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
/*
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class SolomonR101Example {
|
|||
// new Plotter(vrp).plot("output/solomon_R101.png", "R101");
|
||||
|
||||
/*
|
||||
* Define the required vehicle-routing algorithms to solve the above problem.
|
||||
* Define the required vehicle-routing algorithms to solve the above problem.
|
||||
*
|
||||
* The algorithm can be defined and configured in an xml-file.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class SolomonWithRegretInsertionExample {
|
|||
vra.addListener(eventsRecorder);
|
||||
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ public class TransportOfDisabledPeople {
|
|||
constraintManager.addConstraint(wheelchair_bus_passenger_pickup_constraint);
|
||||
|
||||
/*
|
||||
* get a sample algorithm.
|
||||
* get a sample algorithm.
|
||||
*
|
||||
* Note that you need to make sure to prohibit vehicle-switching by adding the insertion-tag <vehicleSwitchAllowed>false</vehicleSwitchAllowed>.
|
||||
* This way you make sure that no vehicle can take over a route that is employed by another. Allowing this might make sense when dealing with
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class VRPWithBackhaulsExample {
|
|||
vraBuilder.setStateAndConstraintManager(stateManager, constraintManager);
|
||||
VehicleRoutingAlgorithm vra = vraBuilder.build();
|
||||
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
|
||||
/*
|
||||
/*
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class VRPWithBackhaulsExample2 {
|
|||
|
||||
|
||||
/*
|
||||
* Solve the problem.
|
||||
* Solve the problem.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue