diff --git a/jsprit-core/src/main/java/jsprit/core/algorithm/VehicleRoutingAlgorithm.java b/jsprit-core/src/main/java/jsprit/core/algorithm/VehicleRoutingAlgorithm.java index eec2300b..be6c1ac8 100644 --- a/jsprit-core/src/main/java/jsprit/core/algorithm/VehicleRoutingAlgorithm.java +++ b/jsprit-core/src/main/java/jsprit/core/algorithm/VehicleRoutingAlgorithm.java @@ -112,7 +112,7 @@ public class VehicleRoutingAlgorithm { /** * Adds solution to the collection of initial solutions. * - * @param solution + * @param solution to the set of initialSolutions */ public void addInitialSolution(VehicleRoutingProblemSolution solution){ initialSolutions.add(solution); @@ -121,7 +121,7 @@ public class VehicleRoutingAlgorithm { /** * Sets premature termination. * - * @param prematureAlgorithmTermination + * @param prematureAlgorithmTermination that terminates the algorithm according to its termination criterion */ public void setPrematureAlgorithmTermination(PrematureAlgorithmTermination prematureAlgorithmTermination){ this.prematureAlgorithmTermination = prematureAlgorithmTermination; diff --git a/jsprit-core/src/main/java/jsprit/core/algorithm/VehicleRoutingAlgorithmBuilder.java b/jsprit-core/src/main/java/jsprit/core/algorithm/VehicleRoutingAlgorithmBuilder.java index 3cec6751..e8179060 100644 --- a/jsprit-core/src/main/java/jsprit/core/algorithm/VehicleRoutingAlgorithmBuilder.java +++ b/jsprit-core/src/main/java/jsprit/core/algorithm/VehicleRoutingAlgorithmBuilder.java @@ -58,8 +58,8 @@ public class VehicleRoutingAlgorithmBuilder { /** * Constructs the builder with the problem and an algorithmConfigFile. Latter is to configure and specify the ruin-and-recreate meta-heuristic. * - * @param problem - * @param algorithmConfig + * @param problem to solve + * @param algorithmConfig config file of VehicleRoutingAlgorithm */ public VehicleRoutingAlgorithmBuilder(VehicleRoutingProblem problem, String algorithmConfig) { this.vrp=problem; @@ -69,9 +69,9 @@ public class VehicleRoutingAlgorithmBuilder { /** * Constructs the builder with the problem and an algorithmConfig. Latter is to configure and specify the ruin-and-recreate meta-heuristic. - * - * @param problem - * @param algorithmConfig + * + * @param problem to solve + * @param algorithmConfig config file of VehicleRoutingAlgorithm */ public VehicleRoutingAlgorithmBuilder(VehicleRoutingProblem problem, AlgorithmConfig algorithmConfig) { this.vrp=problem; @@ -85,7 +85,7 @@ public class VehicleRoutingAlgorithmBuilder { *
If objective function is not set, a default function is applied (which basically minimizes * fixed and variable transportation costs ({@link VariablePlusFixedSolutionCostCalculatorFactory}). * - * @param objectiveFunction + * @param objectiveFunction to be minimized * @see VariablePlusFixedSolutionCostCalculatorFactory */ public void setObjectiveFunction(SolutionCostCalculator objectiveFunction) { @@ -95,7 +95,7 @@ public class VehicleRoutingAlgorithmBuilder { /** * Sets stateManager to memorize states. * - * @param stateManager + * @param stateManager that memorizes your states * @see StateManager */ public void setStateManager(StateManager stateManager) { @@ -105,7 +105,7 @@ public class VehicleRoutingAlgorithmBuilder { /** * Adds core constraints. * - *
Thus, it adds vehicle-capacity and time-window constraints and their + *
Thus, it adds vehicle-capacity, time-window and skills constraints and their * required stateUpdater. * */ @@ -130,8 +130,8 @@ public class VehicleRoutingAlgorithmBuilder { /** * Sets state- and constraintManager. * - * @param stateManager - * @param constraintManager + * @param stateManager that memorizes your states + * @param constraintManager that manages your constraints * @see StateManager * @see ConstraintManager */ @@ -143,7 +143,7 @@ public class VehicleRoutingAlgorithmBuilder { /** * Sets nuOfThreads. * - * @param nuOfThreads + * @param nuOfThreads to be operated */ public void setNuOfThreads(int nuOfThreads){ this.nuOfThreads=nuOfThreads; @@ -154,7 +154,7 @@ public class VehicleRoutingAlgorithmBuilder { * *
If algorithmConfigFile is set, it reads the configuration. * - * @return + * @return the algorithm */ public VehicleRoutingAlgorithm build() { if(stateManager == null) stateManager = new StateManager(vrp.getTransportCosts()); @@ -167,8 +167,10 @@ public class VehicleRoutingAlgorithmBuilder { if(addCoreConstraints){ constraintManager.addLoadConstraint(); constraintManager.addTimeWindowConstraint(); - stateManager.updateLoadStates(); + constraintManager.addSkillsConstraint(); + stateManager.updateLoadStates(); stateManager.updateTimeWindowStates(); + stateManager.updateSkillStates(); } if(algorithmConfig==null){ algorithmConfig = new AlgorithmConfig(); diff --git a/jsprit-core/src/main/java/jsprit/core/algorithm/io/VehicleRoutingAlgorithms.java b/jsprit-core/src/main/java/jsprit/core/algorithm/io/VehicleRoutingAlgorithms.java index 59d2920e..d4eb5881 100644 --- a/jsprit-core/src/main/java/jsprit/core/algorithm/io/VehicleRoutingAlgorithms.java +++ b/jsprit-core/src/main/java/jsprit/core/algorithm/io/VehicleRoutingAlgorithms.java @@ -489,6 +489,7 @@ public class VehicleRoutingAlgorithms { } stateManager.updateLoadStates(); stateManager.updateTimeWindowStates(); + stateManager.updateSkillStates(); stateManager.addStateUpdater(new UpdateEndLocationIfRouteIsOpen()); stateManager.addStateUpdater(new OpenRouteStateVerifier()); stateManager.addStateUpdater(new UpdateActivityTimes(vrp.getTransportCosts())); @@ -501,6 +502,7 @@ public class VehicleRoutingAlgorithms { ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager,vrp.getConstraints()); constraintManager.addTimeWindowConstraint(); constraintManager.addLoadConstraint(); + constraintManager.addSkillsConstraint(); return readAndCreateAlgorithm(vrp, config, nuOfThreads, null, stateManager, constraintManager, true); }