From b6d97d6688cc6b65c4b95fff5de26ea84b9833fe Mon Sep 17 00:00:00 2001 From: oblonski <4sschroeder@gmail.com> Date: Sun, 29 Dec 2013 23:53:06 +0100 Subject: [PATCH] add javadoc and tests --- .../solution/InitialSolutionFactory.java | 14 ++++++-- .../solution/SolutionCostCalculator.java | 11 ++++-- .../VehicleRoutingProblemSolution.java | 19 ++++++++-- .../VehicleRoutingProblemSolutionTest.java | 36 +++++++++++++++++++ 4 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 jsprit-core/src/test/java/jsprit/core/problem/solution/VehicleRoutingProblemSolutionTest.java diff --git a/jsprit-core/src/main/java/jsprit/core/problem/solution/InitialSolutionFactory.java b/jsprit-core/src/main/java/jsprit/core/problem/solution/InitialSolutionFactory.java index 96fa7f82..6670745e 100644 --- a/jsprit-core/src/main/java/jsprit/core/problem/solution/InitialSolutionFactory.java +++ b/jsprit-core/src/main/java/jsprit/core/problem/solution/InitialSolutionFactory.java @@ -18,10 +18,20 @@ package jsprit.core.problem.solution; import jsprit.core.problem.VehicleRoutingProblem; - - +/** + * Interface for all factories that create initial solutions for the specified {@link VehicleRoutingProblem}. + * + * @author schroeder + * + */ public interface InitialSolutionFactory { + /** + * Creates an initial solution for the specified {@link VehicleRoutingProblem}. + * + * @param vrp + * @return + */ public VehicleRoutingProblemSolution createSolution(VehicleRoutingProblem vrp); } diff --git a/jsprit-core/src/main/java/jsprit/core/problem/solution/SolutionCostCalculator.java b/jsprit-core/src/main/java/jsprit/core/problem/solution/SolutionCostCalculator.java index 92c226cf..f82656fc 100644 --- a/jsprit-core/src/main/java/jsprit/core/problem/solution/SolutionCostCalculator.java +++ b/jsprit-core/src/main/java/jsprit/core/problem/solution/SolutionCostCalculator.java @@ -16,14 +16,21 @@ ******************************************************************************/ package jsprit.core.problem.solution; - +/** + * Interface for all solutionCostCalculators which should be the objective-functions of the problem. + * + *
It evaluates VehicleRoutingProblemSolution and returns its costs.
+ *
+ * @author schroeder
+ *
+ */
public interface SolutionCostCalculator {
/**
* Returns costs of solution.
*
* @param solution
- * @return TODO
+ * @return costs
*/
public double getCosts(VehicleRoutingProblemSolution solution);
diff --git a/jsprit-core/src/main/java/jsprit/core/problem/solution/VehicleRoutingProblemSolution.java b/jsprit-core/src/main/java/jsprit/core/problem/solution/VehicleRoutingProblemSolution.java
index c5c9ed86..63302c94 100644
--- a/jsprit-core/src/main/java/jsprit/core/problem/solution/VehicleRoutingProblemSolution.java
+++ b/jsprit-core/src/main/java/jsprit/core/problem/solution/VehicleRoutingProblemSolution.java
@@ -25,7 +25,7 @@ import jsprit.core.problem.solution.route.VehicleRoute;
/**
* Contains the solution of a vehicle routing problem and its corresponding costs.
*
- * @author stefan schröder
+ * @author stefan schroeder
*
*/
public class VehicleRoutingProblemSolution {
@@ -67,16 +67,29 @@ public class VehicleRoutingProblemSolution {
this.cost = cost;
}
-
+ /**
+ * Returns a collection of vehicle-routes.
+ *
+ * @return collection of vehicle-routes
+ */
public Collection