From 7d8e32fc8d556d88fe48da41a88a53ad92cf10fb Mon Sep 17 00:00:00 2001
From: oblonski <4sschroeder@gmail.com>
Date: Wed, 15 Jan 2014 09:18:51 -0500
Subject: [PATCH] add util createOutputFolder
---
.../java/jsprit/examples/CVRPExample.java | 32 -------------------
.../jsprit/examples/HVRPBenchmarkExample.java | 6 ++--
.../src/main/java/jsprit/util/Examples.java | 17 ++++++++++
3 files changed, 21 insertions(+), 34 deletions(-)
delete mode 100644 jsprit-examples/src/main/java/jsprit/examples/CVRPExample.java
create mode 100644 jsprit-examples/src/main/java/jsprit/util/Examples.java
diff --git a/jsprit-examples/src/main/java/jsprit/examples/CVRPExample.java b/jsprit-examples/src/main/java/jsprit/examples/CVRPExample.java
deleted file mode 100644
index d6bd6444..00000000
--- a/jsprit-examples/src/main/java/jsprit/examples/CVRPExample.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 Stefan Schroeder
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3.0 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
These instances are from Golden and Taillard and copied from http://mistic.heig-vd.ch/taillard/problemes.dir/vrp.dir/vrp.html. + *
These instances are from Golden and Taillard and copied from
+ * .
*
* You can find best results of different problems, instances and authors here:
*
http://www2.ic.uff.br/~satoru/conteudo/artigos/PAPER%20PUCA-JHeuristics-2011.pdf
@@ -30,6 +32,7 @@ import jsprit.instance.reader.VrphGoldenReader.VrphType;
public class HVRPBenchmarkExample {
public static void main(String[] args) {
+ Examples.createOutputFolder();
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
//read modified Golden-instance, you can find all relevant instances in jsprit-instances/instances/vrph
//you can build various problems, see VrphType doc for more details
@@ -57,5 +60,4 @@ public class HVRPBenchmarkExample {
new GraphStreamViewer(vrp, best).setRenderDelay(100).display();
}
-
}
diff --git a/jsprit-examples/src/main/java/jsprit/util/Examples.java b/jsprit-examples/src/main/java/jsprit/util/Examples.java
new file mode 100644
index 00000000..37a4463a
--- /dev/null
+++ b/jsprit-examples/src/main/java/jsprit/util/Examples.java
@@ -0,0 +1,17 @@
+package jsprit.util;
+
+import java.io.File;
+
+public class Examples {
+
+ public static void createOutputFolder(){
+ 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");
+ }
+ }
+
+}