1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

add editorconfig - #174

This commit is contained in:
oblonski 2015-09-11 12:49:01 +02:00
parent b9c7dc3324
commit 25e5c096f2
43 changed files with 625 additions and 645 deletions

View file

@ -382,8 +382,8 @@ public class BicycleMessenger {
String line;
boolean firstLine = true;
VehicleType messengerType = VehicleTypeImpl.Builder.newInstance("messengerType").addCapacityDimension(0, 15).setCostPerDistance(1).build();
/*
* the algo requires some time and space to search for a valid solution. if you ommit a penalty-type, it probably throws an Exception once it cannot insert an envelope anymore
/*
* the algo requires some time and space to search for a valid solution. if you ommit a penalty-type, it probably throws an Exception once it cannot insert an envelope anymore
* thus, give it space by defining a penalty/shadow vehicle with higher variable and fixed costs to up the pressure to find solutions without penalty type
*
* it is important to give it the same typeId as the type you want to shadow

View file

@ -46,13 +46,13 @@ public class ConfigureAlgorithmInCodeInsteadOfPerXml {
Examples.createOutputFolder();
/*
* 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);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
*/
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
vehicleBuilder.setStartLocation(Location.newInstance(10, 10));

View file

@ -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

View file

@ -49,14 +49,14 @@ public class EnRoutePickupAndDeliveryWithMultipleDepotsAndOpenRoutesExample {
Examples.createOutputFolder();
/*
* 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);
vehicleTypeBuilder.setCostPerDistance(1.0);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* define two vehicles and their start-locations
* define two vehicles and their start-locations
*
* the first two do need to return to depot
*/

View file

@ -48,8 +48,8 @@ public class MultipleDepotExample {
Examples.createOutputFolder();
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* Read cordeau-instance p01, BUT only its services without any vehicles
/*
* Read cordeau-instance p01, BUT only its services without any vehicles
*/
new VrpXMLReader(vrpBuilder).read("input/vrp_cordeau_01.xml");

View file

@ -50,8 +50,8 @@ public class MultipleDepotExample2 {
Examples.createOutputFolder();
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* Read cordeau-instance p01, BUT only its services without any vehicles
/*
* Read cordeau-instance p01, BUT only its services without any vehicles
*/
new CordeauReader(vrpBuilder).read("input/p08");

View file

@ -45,8 +45,8 @@ public class MultipleDepotWithInitialRoutesExample {
Examples.createOutputFolder();
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* Read cordeau-instance p01
/*
* Read cordeau-instance p01
*/
new VrpXMLReader(vrpBuilder).read("input/cordeau01.xml");

View file

@ -43,14 +43,14 @@ public class PickupAndDeliveryExample {
Examples.createOutputFolder();
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new VrpXMLReader(vrpBuilder).read("input/pickups_and_deliveries_solomon_r101_withoutTWs.xml");

View file

@ -49,12 +49,12 @@ public class PickupAndDeliveryExample2 {
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new VrpXMLReader(vrpBuilder).read("input/pd_christophides_vrpnc1_vcap50.xml");
/*
* Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
* Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
*/
VehicleRoutingProblem vrp = vrpBuilder.build();

View file

@ -41,14 +41,14 @@ public class PickupAndDeliveryOpenExample {
Examples.createOutputFolder();
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new VrpXMLReader(vrpBuilder).read("input/pickups_and_deliveries_solomon_r101_withoutTWs_open.xml");

View file

@ -55,7 +55,7 @@ public class RefuseCollectionExample {
Examples.createOutputFolder();
/*
* create vehicle-type and vehicle
* create vehicle-type and vehicle
*/
VehicleTypeImpl.Builder typeBuilder = VehicleTypeImpl.Builder.newInstance("vehicle-type").addCapacityDimension(0, 23);
typeBuilder.setCostPerDistance(1.0);
@ -67,7 +67,7 @@ public class RefuseCollectionExample {
VehicleImpl bigVehicle = vehicleBuilder.build();
/*
* start building the problem
* start building the problem
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
vrpBuilder.setFleetSize(FleetSize.INFINITE);

View file

@ -54,7 +54,7 @@ public class RefuseCollectionWithFastMatrixExample {
Examples.createOutputFolder();
/*
* create vehicle-type and vehicle
* create vehicle-type and vehicle
*/
VehicleTypeImpl.Builder typeBuilder = VehicleTypeImpl.Builder.newInstance("vehicle-type").addCapacityDimension(0, 23);
typeBuilder.setCostPerDistance(1.0);
@ -66,7 +66,7 @@ public class RefuseCollectionWithFastMatrixExample {
VehicleImpl bigVehicle = vehicleBuilder.build();
/*
* start building the problem
* start building the problem
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
vrpBuilder.setFleetSize(FleetSize.INFINITE);

View file

@ -47,14 +47,14 @@ public class ServicePickupsWithMultipleDepotsExample {
Examples.createOutputFolder();
/*
* 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, 8);
vehicleTypeBuilder.setCostPerDistance(1.0);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* define two depots, i.e. two vehicle locations ([10,10],[50,50]) and equip them with an infinite number of vehicles of type 'vehicleType'
* define two depots, i.e. two vehicle locations ([10,10],[50,50]) and equip them with an infinite number of vehicles of type 'vehicleType'
*/
Builder vehicleBuilder1 = VehicleImpl.Builder.newInstance("vehicles@[10,10]");
vehicleBuilder1.setStartLocation(Location.newInstance(10, 10));

View file

@ -46,13 +46,13 @@ public class SimpleDepotBoundedPickupAndDeliveryExample {
Examples.createOutputFolder();
/*
* 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);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
*/
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
vehicleBuilder.setStartLocation(Location.newInstance(10, 10));

View file

@ -47,13 +47,13 @@ public class SimpleEnRoutePickupAndDeliveryExample {
Examples.createOutputFolder();
/*
* 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);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
*/
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
vehicleBuilder.setStartLocation(loc(Coordinate.newInstance(10, 10)));

View file

@ -46,13 +46,13 @@ public class SimpleEnRoutePickupAndDeliveryOpenRoutesExample {
Examples.createOutputFolder();
/*
* 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);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
*/
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
vehicleBuilder.setStartLocation(loc(Coordinate.newInstance(10, 10)));

View file

@ -49,13 +49,13 @@ public class SimpleEnRoutePickupAndDeliveryWithDepotBoundedDeliveriesExample {
Examples.createOutputFolder();
/*
* 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);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
*/
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
vehicleBuilder.setStartLocation(loc(Coordinate.newInstance(10, 10)));

View file

@ -52,14 +52,14 @@ public class SimpleExample {
}
/*
* get a vehicle type-builder and build a type with the typeId "vehicleType" and one capacity dimension, i.e. weight, and capacity dimension value of 2
* get a vehicle type-builder and build a type with the typeId "vehicleType" and one capacity dimension, i.e. weight, and capacity dimension value of 2
*/
final int WEIGHT_INDEX = 0;
VehicleTypeImpl.Builder vehicleTypeBuilder = VehicleTypeImpl.Builder.newInstance("vehicleType").addCapacityDimension(WEIGHT_INDEX, 2);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
*/
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
vehicleBuilder.setStartLocation(Location.newInstance(10, 10));

View file

@ -44,14 +44,14 @@ public class SimpleExampleOpenRoutes {
Examples.createOutputFolder();
/*
* 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);
vehicleTypeBuilder.setFixedCost(100);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
*/
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
vehicleBuilder.setStartLocation(Location.newInstance(10, 10));

View file

@ -54,14 +54,14 @@ public class SimpleExampleWithSkills {
}
/*
* get a vehicle type-builder and build a type with the typeId "vehicleType" and one capacity dimension, i.e. weight, and capacity dimension value of 2
* get a vehicle type-builder and build a type with the typeId "vehicleType" and one capacity dimension, i.e. weight, and capacity dimension value of 2
*/
final int WEIGHT_INDEX = 0;
VehicleTypeImpl.Builder vehicleTypeBuilder = VehicleTypeImpl.Builder.newInstance("vehicleType").addCapacityDimension(WEIGHT_INDEX, 2);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
*/
Builder vehicleBuilder = Builder.newInstance("vehicle");
vehicleBuilder.setStartLocation(Location.newInstance(10, 10));

View file

@ -49,13 +49,13 @@ public class SimpleVRPWithBackhaulsExample {
Examples.createOutputFolder();
/*
* 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);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
*/
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
vehicleBuilder.setStartLocation(Location.newInstance(10, 10));

View file

@ -40,14 +40,14 @@ public class SolomonExample {
Examples.createOutputFolder();
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new SolomonReader(vrpBuilder).read("input/C101_solomon.txt");

View file

@ -47,14 +47,14 @@ public class SolomonExampleWithSpecifiedVehicleEndLocations {
}
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new VrpXMLReader(vrpBuilder).read("input/deliveries_solomon_specifiedVehicleEndLocations_c101.xml");

View file

@ -46,14 +46,14 @@ public class SolomonExampleWithSpecifiedVehicleEndLocationsWithoutTWs {
}
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new VrpXMLReader(vrpBuilder).read("input/pickups_and_deliveries_solomon_c101_withoutTWs_and_specifiedVehicleEndLocations.xml");

View file

@ -40,14 +40,14 @@ public class SolomonOpenExample {
Examples.createOutputFolder();
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new VrpXMLReader(vrpBuilder).read("input/deliveries_solomon_open_c101.xml");

View file

@ -39,14 +39,14 @@ public class SolomonR101Example {
Examples.createOutputFolder();
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
// new SolomonReader(vrpBuilder).read("/Users/schroeder/IdeaProjects/jsprit/jsprit-instances/instances/solomon/R211.txt");
new VrpXMLReader(vrpBuilder).read("output/R211.xml");

View file

@ -42,14 +42,14 @@ public class SolomonWithRegretInsertionExample {
Examples.createOutputFolder();
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new SolomonReader(vrpBuilder).read("input/C101_solomon.txt");

View file

@ -55,7 +55,7 @@ public class TransportOfDisabledPeople {
Examples.createOutputFolder();
/*
* 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 wheelChairTypeBuilder = VehicleTypeImpl.Builder.newInstance("wheelChairBusType")
.addCapacityDimension(WHEELCHAIRSPACE_INDEX, 2) //can transport two people with wheelchair
@ -67,7 +67,7 @@ public class TransportOfDisabledPeople {
VehicleType vehicleType_solelypassenger = soleyPassengerTypeBuilder.build();
/*
* define two vehicles and their locations.
* define two vehicles and their locations.
*
* this example employs two vehicles. one that has to return to its start-location (vehicle1) and one that has a different
* end-location.

View file

@ -43,14 +43,14 @@ public class VRPWithBackhaulsExample {
Examples.createOutputFolder();
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new VrpXMLReader(vrpBuilder).read("input/pickups_and_deliveries_solomon_r101.xml");

View file

@ -48,14 +48,14 @@ public class VRPWithBackhaulsExample2 {
Examples.createOutputFolder();
/*
* Build the problem.
* Build the problem.
*
* But define a problem-builder first.
*/
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
/*
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
* A solomonReader reads solomon-instance files, and stores the required information in the builder.
*/
new VrpXMLReader(vrpBuilder).read("input/pd_christophides_vrpnc1_vcap50.xml");