mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
modify examples according to issue #24, i.e. if output-folder does not
exist, it is created.
This commit is contained in:
parent
8950d49e5a
commit
03e95c74a9
6 changed files with 66 additions and 4 deletions
|
|
@ -20,6 +20,8 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package examples;
|
package examples;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
import readers.SolomonReader;
|
import readers.SolomonReader;
|
||||||
import algorithms.GreedySchrimpfFactory;
|
import algorithms.GreedySchrimpfFactory;
|
||||||
import algorithms.SchrimpfFactory;
|
import algorithms.SchrimpfFactory;
|
||||||
|
|
@ -35,7 +37,16 @@ public class CompareAlgorithmExample {
|
||||||
* @param args
|
* @param args
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
/*
|
||||||
|
* some preparation - create output folder
|
||||||
|
*/
|
||||||
|
File dir = new File("output");
|
||||||
|
// if the directory does not exist, create it
|
||||||
|
if (!dir.exists()){
|
||||||
|
System.out.println("creating directory ./output");
|
||||||
|
boolean result = dir.mkdir();
|
||||||
|
if(result) System.out.println("./output created");
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Build the problem.
|
* Build the problem.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package examples;
|
package examples;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
|
@ -18,7 +19,6 @@ import basics.algo.VehicleRoutingAlgorithmListeners.Priority;
|
||||||
import basics.io.VrpXMLReader;
|
import basics.io.VrpXMLReader;
|
||||||
import basics.route.Vehicle;
|
import basics.route.Vehicle;
|
||||||
import basics.route.VehicleImpl;
|
import basics.route.VehicleImpl;
|
||||||
import basics.route.VehicleType;
|
|
||||||
import basics.route.VehicleTypeImpl;
|
import basics.route.VehicleTypeImpl;
|
||||||
|
|
||||||
public class MultipleDepotExample {
|
public class MultipleDepotExample {
|
||||||
|
|
@ -27,7 +27,16 @@ public class MultipleDepotExample {
|
||||||
* @param args
|
* @param args
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
/*
|
||||||
|
* some preparation - create output folder
|
||||||
|
*/
|
||||||
|
File dir = new File("output");
|
||||||
|
// if the directory does not exist, create it
|
||||||
|
if (!dir.exists()){
|
||||||
|
System.out.println("creating directory ./output");
|
||||||
|
boolean result = dir.mkdir();
|
||||||
|
if(result) System.out.println("./output created");
|
||||||
|
}
|
||||||
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
|
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
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package examples;
|
package examples;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
|
@ -29,6 +30,16 @@ public class MultipleDepotExampleWithPenaltyVehicles {
|
||||||
* @param args
|
* @param args
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
/*
|
||||||
|
* some preparation - create output folder
|
||||||
|
*/
|
||||||
|
File dir = new File("output");
|
||||||
|
// if the directory does not exist, create it
|
||||||
|
if (!dir.exists()){
|
||||||
|
System.out.println("creating directory ./output");
|
||||||
|
boolean result = dir.mkdir();
|
||||||
|
if(result) System.out.println("./output created");
|
||||||
|
}
|
||||||
|
|
||||||
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
|
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,16 @@ public class RefuseCollectionExample {
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
|
/*
|
||||||
|
* some preparation - create output folder
|
||||||
|
*/
|
||||||
|
File dir = new File("output");
|
||||||
|
// if the directory does not exist, create it
|
||||||
|
if (!dir.exists()){
|
||||||
|
System.out.println("creating directory ./output");
|
||||||
|
boolean result = dir.mkdir();
|
||||||
|
if(result) System.out.println("./output created");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* create vehicle-type and vehicle
|
* create vehicle-type and vehicle
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package examples;
|
package examples;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import util.Coordinate;
|
import util.Coordinate;
|
||||||
|
|
@ -42,6 +43,16 @@ import basics.route.VehicleTypeImpl;
|
||||||
public class SimpleExample {
|
public class SimpleExample {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
/*
|
||||||
|
* some preparation - create output folder
|
||||||
|
*/
|
||||||
|
File dir = new File("output");
|
||||||
|
// if the directory does not exist, create it
|
||||||
|
if (!dir.exists()){
|
||||||
|
System.out.println("creating directory ./output");
|
||||||
|
boolean result = dir.mkdir();
|
||||||
|
if(result) System.out.println("./output created");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package examples;
|
package examples;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import readers.SolomonReader;
|
import readers.SolomonReader;
|
||||||
|
|
@ -39,7 +40,16 @@ import basics.algo.VehicleRoutingAlgorithmListeners.Priority;
|
||||||
public class SolomonExample {
|
public class SolomonExample {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
/*
|
||||||
|
* some preparation - create output folder
|
||||||
|
*/
|
||||||
|
File dir = new File("output");
|
||||||
|
// if the directory does not exist, create it
|
||||||
|
if (!dir.exists()){
|
||||||
|
System.out.println("creating directory ./output");
|
||||||
|
boolean result = dir.mkdir();
|
||||||
|
if(result) System.out.println("./output created");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Build the problem.
|
* Build the problem.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue