1
0
Fork 0
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:
oblonski 2015-09-17 08:38:52 +02:00
parent ddb6c8d658
commit 01bf0d55af
37 changed files with 39 additions and 38 deletions

View file

@ -106,7 +106,7 @@ class TimeWindowConstraint implements HardActivityConstraint {
double latestArrTimeAtNewAct = Math.min(newAct.getTheoreticalLatestOperationStartTime(), latestArrTimeAtNextAct - double latestArrTimeAtNewAct = Math.min(newAct.getTheoreticalLatestOperationStartTime(), latestArrTimeAtNextAct -
routingCosts.getBackwardTransportTime(nextActLocation, newAct.getLocation(), latestArrTimeAtNextAct, iFacts.getNewDriver(), routingCosts.getBackwardTransportTime(nextActLocation, newAct.getLocation(), latestArrTimeAtNextAct, iFacts.getNewDriver(),
iFacts.getNewVehicle()) - newAct.getOperationTime()); iFacts.getNewVehicle()) - newAct.getOperationTime());
/* /*
* |--- prevAct ---| * |--- prevAct ---|
* |--- vehicle's arrival @newAct * |--- vehicle's arrival @newAct
* latest arrival of vehicle @newAct ---| * latest arrival of vehicle @newAct ---|

View file

@ -135,7 +135,7 @@ public class VehicleDependentTimeWindowConstraints implements HardActivityConstr
double arrTimeAtNextAct = endTimeAtNewAct + routingCosts.getTransportTime(newAct.getLocation(), nextActLocation, endTimeAtNewAct, iFacts.getNewDriver(), iFacts.getNewVehicle()); double arrTimeAtNextAct = endTimeAtNewAct + routingCosts.getTransportTime(newAct.getLocation(), nextActLocation, endTimeAtNewAct, iFacts.getNewDriver(), iFacts.getNewVehicle());
/* /*
* |--- newAct ---| * |--- newAct ---|
* |--- vehicle's arrival @nextAct * |--- vehicle's arrival @nextAct
* latest arrival of vehicle @nextAct ---| * latest arrival of vehicle @nextAct ---|
*/ */

View file

@ -41,7 +41,7 @@ public class Service extends AbstractJob {
* *
* @author schroeder * @author schroeder
*/ */
public static class Builder <T extends Service> { public static class Builder<T extends Service> {
/** /**

View file

@ -163,7 +163,7 @@ public class RefuseCollectionWithCostsHigherThanTimesAndFiniteFleet_IT {
continue; continue;
} }
String[] lineTokens = line.split(","); String[] lineTokens = line.split(",");
/* /*
* build service * build service
*/ */
Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1])) Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1]))

View file

@ -163,7 +163,7 @@ public class RefuseCollectionWithCostsHigherThanTimesAndFiniteFleet_withTimeAndD
continue; continue;
} }
String[] lineTokens = line.split(","); String[] lineTokens = line.split(",");
/* /*
* build service * build service
*/ */
Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1])) Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1]))

View file

@ -104,7 +104,7 @@ public class RefuseCollection_IT {
VehicleImpl bigVehicle = vehicleBuilder.build(); VehicleImpl bigVehicle = vehicleBuilder.build();
/* /*
* start building the problem * start building the problem
*/ */
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance(); VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
vrpBuilder.setFleetSize(FleetSize.INFINITE); vrpBuilder.setFleetSize(FleetSize.INFINITE);

View file

@ -371,7 +371,7 @@ public class TestLocalActivityInsertionCostsCalculator {
//ref: 10 + 50 + 20 = 80 //ref: 10 + 50 + 20 = 80
//new: 80 - 10 - 30 - 20 = 20 //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}
*/ */
} }

View file

@ -104,7 +104,7 @@ public class TestMixedServiceAndShipmentsProblemOnRouteLevel {
@Test @Test
public void whenHavingOnlyServicesInOneProblem_andInsertionShouldBeMadeOnRouteLevel_itShouldAssertTrue() { public void whenHavingOnlyServicesInOneProblem_andInsertionShouldBeMadeOnRouteLevel_itShouldAssertTrue() {
/* get a vehicle type-builder and build a type with the typeId "vehicleType" and a capacity of 2 /* 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); VehicleTypeImpl.Builder vehicleTypeBuilder = VehicleTypeImpl.Builder.newInstance("vehicleType").addCapacityDimension(0, 2);
VehicleType vehicleType = vehicleTypeBuilder.build(); VehicleType vehicleType = vehicleTypeBuilder.build();

View file

@ -82,7 +82,7 @@ public class ConfigureAlgorithmInCodeInsteadOfPerXml {
VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.createAlgorithm(problem, algorithmConfig); VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.createAlgorithm(problem, algorithmConfig);
/* /*
* and search a solution * and search a solution
*/ */
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

View file

@ -59,7 +59,7 @@ public class CostMatrixExample {
/* /*
* Assume the following symmetric distance-matrix * Assume the following symmetric distance-matrix
* from,to,distance * from,to,distance
* 0,1,10.0 * 0,1,10.0
* 0,2,20.0 * 0,2,20.0

View file

@ -125,7 +125,7 @@ public class EnRoutePickupAndDeliveryWithMultipleDepotsAndOpenRoutesExample {
*/ */
VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(problem, "input/algorithmConfig.xml"); VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(problem, "input/algorithmConfig.xml");
// algorithm.setMaxIterations(30000); // algorithm.setMaxIterations(30000);
/* /*
* and search a solution * and search a solution
*/ */
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

View file

@ -86,7 +86,7 @@ public class MultipleDepotExample {
vrpBuilder.setFleetSize(FleetSize.FINITE); vrpBuilder.setFleetSize(FleetSize.FINITE);
/* /*
* build the problem * build the problem
*/ */
VehicleRoutingProblem vrp = vrpBuilder.build(); VehicleRoutingProblem vrp = vrpBuilder.build();

View file

@ -92,7 +92,7 @@ public class MultipleDepotExample2 {
vrpBuilder.setFleetSize(FleetSize.FINITE); vrpBuilder.setFleetSize(FleetSize.FINITE);
/* /*
* build the problem * build the problem
*/ */
VehicleRoutingProblem vrp = vrpBuilder.build(); VehicleRoutingProblem vrp = vrpBuilder.build();

View file

@ -61,7 +61,7 @@ public class MultipleDepotWithInitialRoutesExample {
* build the problem * build the problem
*/ */
VehicleRoutingProblem vrp = vrpBuilder.build(); VehicleRoutingProblem vrp = vrpBuilder.build();
/* /*
* since job (service) 26 and 44 are already planned in initial route and thus static AND sequence is fixed they * 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) * should not be in jobMap anymore (only variable jobs are in jobMap)
*/ */

View file

@ -71,7 +71,7 @@ public class PickupAndDeliveryExample {
// VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp); // VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml"); VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml");
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png")); vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
/* /*
* Solve the problem. * Solve the problem.
* *
* *

View file

@ -71,7 +71,7 @@ public class PickupAndDeliveryExample2 {
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml"); VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml");
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png")); vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
/* /*
* Solve the problem. * Solve the problem.
* *
* *
*/ */

View file

@ -68,7 +68,7 @@ public class PickupAndDeliveryOpenExample {
// VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp); // VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_open.xml"); VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_open.xml");
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png")); vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
/* /*
* Solve the problem. * Solve the problem.
* *
* *

View file

@ -109,7 +109,7 @@ public class RefuseCollectionExample {
continue; continue;
} }
String[] lineTokens = line.split(","); String[] lineTokens = line.split(",");
/* /*
* build service * build service
*/ */
Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1])).setLocation(Location.newInstance(lineTokens[0])).build(); Service service = Service.Builder.newInstance(lineTokens[0]).addSizeDimension(0, Integer.parseInt(lineTokens[1])).setLocation(Location.newInstance(lineTokens[0])).build();

View file

@ -108,7 +108,7 @@ public class RefuseCollectionWithFastMatrixExample {
continue; continue;
} }
String[] lineTokens = line.split(","); String[] lineTokens = line.split(",");
/* /*
* build service * build service
*/ */
Service service = Service.Builder.newInstance(lineTokens[0]) Service service = Service.Builder.newInstance(lineTokens[0])

View file

@ -104,7 +104,7 @@ public class ServicePickupsWithMultipleDepotsExample {
algorithm.setMaxIterations(10); algorithm.setMaxIterations(10);
/* /*
* and search a solution * and search a solution
*/ */
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

View file

@ -62,11 +62,12 @@ public class SimpleDepotBoundedPickupAndDeliveryExample {
/* /*
* build pickups and deliveries at the required locations, each with a capacity-demand of 1. * 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(); 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(); 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(); 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(); VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
@ -82,7 +83,7 @@ public class SimpleDepotBoundedPickupAndDeliveryExample {
VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem); VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
/* /*
* and search a solution * and search a solution
*/ */
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

View file

@ -88,7 +88,7 @@ public class SimpleEnRoutePickupAndDeliveryExample {
VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem); VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
/* /*
* and search a solution * and search a solution
*/ */
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

View file

@ -88,7 +88,7 @@ public class SimpleEnRoutePickupAndDeliveryOpenRoutesExample {
VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem); VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
/* /*
* and search a solution * and search a solution
*/ */
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

View file

@ -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(); 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) * 1: (4,8)
* 2: (4,12) * 2: (4,12)
* 3: (16,8) * 3: (16,8)

View file

@ -88,7 +88,7 @@ public class SimpleExample {
VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem); VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
/* /*
* and search a solution * and search a solution
*/ */
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

View file

@ -82,7 +82,7 @@ public class SimpleExampleOpenRoutes {
VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(problem, "input/algorithmConfig_fix.xml"); VehicleRoutingAlgorithm algorithm = VehicleRoutingAlgorithms.readAndCreateAlgorithm(problem, "input/algorithmConfig_fix.xml");
/* /*
* and search a solution * and search a solution
*/ */
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

View file

@ -110,7 +110,7 @@ public class SimpleExampleWithSkills {
VehicleRoutingAlgorithm algorithm = vraBuilder.build(); VehicleRoutingAlgorithm algorithm = vraBuilder.build();
/* /*
* and search a solution * and search a solution
*/ */
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();

View file

@ -94,7 +94,7 @@ public class SimpleVRPWithBackhaulsExample {
Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
/* /*
* get the best * get the best
*/ */
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions); VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);

View file

@ -67,7 +67,7 @@ public class SolomonExample {
VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp); VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
/* /*
* Solve the problem. * Solve the problem.
* *
* *
*/ */

View file

@ -76,7 +76,7 @@ public class SolomonExampleWithSpecifiedVehicleEndLocations {
vra.setMaxIterations(20000); vra.setMaxIterations(20000);
// vra.setPrematureBreak(100); // vra.setPrematureBreak(100);
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png")); vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
/* /*
* Solve the problem. * Solve the problem.
* *
* *

View file

@ -76,7 +76,7 @@ public class SolomonExampleWithSpecifiedVehicleEndLocationsWithoutTWs {
vra.setMaxIterations(20000); vra.setMaxIterations(20000);
// vra.setPrematureBreak(100); // vra.setPrematureBreak(100);
// vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png")); // vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
/* /*
* Solve the problem. * Solve the problem.
* *
* *

View file

@ -68,7 +68,7 @@ public class SolomonOpenExample {
VehicleRoutingAlgorithm vra = Jsprit.createAlgorithm(vrp); VehicleRoutingAlgorithm vra = Jsprit.createAlgorithm(vrp);
// vra.setPrematureBreak(100); // vra.setPrematureBreak(100);
// vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png")); // vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
/* /*
* Solve the problem. * Solve the problem.
* *
* *

View file

@ -59,7 +59,7 @@ public class SolomonR101Example {
// new Plotter(vrp).plot("output/solomon_R101.png", "R101"); // 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. * The algorithm can be defined and configured in an xml-file.
*/ */

View file

@ -74,7 +74,7 @@ public class SolomonWithRegretInsertionExample {
vra.addListener(eventsRecorder); vra.addListener(eventsRecorder);
/* /*
* Solve the problem. * Solve the problem.
* *
* *
*/ */

View file

@ -169,7 +169,7 @@ public class TransportOfDisabledPeople {
constraintManager.addConstraint(wheelchair_bus_passenger_pickup_constraint); 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>. * 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 * 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

View file

@ -76,7 +76,7 @@ public class VRPWithBackhaulsExample {
vraBuilder.setStateAndConstraintManager(stateManager, constraintManager); vraBuilder.setStateAndConstraintManager(stateManager, constraintManager);
VehicleRoutingAlgorithm vra = vraBuilder.build(); VehicleRoutingAlgorithm vra = vraBuilder.build();
vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png")); vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
/* /*
* Solve the problem. * Solve the problem.
* *
* *

View file

@ -98,7 +98,7 @@ public class VRPWithBackhaulsExample2 {
/* /*
* Solve the problem. * Solve the problem.
* *
* *
*/ */