From d46fed424d5252b9ce621fabb56d18b4a4b17cc8 Mon Sep 17 00:00:00 2001 From: oblonski <4sschroeder@gmail.com> Date: Tue, 13 Aug 2013 20:44:42 +0200 Subject: [PATCH] improve ruinApi --- .../src/main/java/algorithms/JobRemover.java | 36 ------------- .../main/java/algorithms/JobRemoverImpl.java | 54 ------------------- .../main/java/algorithms/RuinStrategy.java | 1 - 3 files changed, 91 deletions(-) delete mode 100644 jsprit-core/src/main/java/algorithms/JobRemover.java delete mode 100644 jsprit-core/src/main/java/algorithms/JobRemoverImpl.java diff --git a/jsprit-core/src/main/java/algorithms/JobRemover.java b/jsprit-core/src/main/java/algorithms/JobRemover.java deleted file mode 100644 index c8d34d15..00000000 --- a/jsprit-core/src/main/java/algorithms/JobRemover.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2013 Stefan Schroeder - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * Stefan Schroeder - initial API and implementation - ******************************************************************************/ -package algorithms; - -import basics.Job; -import basics.route.VehicleRoute; - -interface JobRemover { - - /** - * Removes jobs from vehicRoute and return true if job has been successfully removed. - * - * @return true if job removed successfully, otherwise false - */ - public boolean removeJobWithoutTourUpdate(Job job, VehicleRoute vehicleRoute); - - -} diff --git a/jsprit-core/src/main/java/algorithms/JobRemoverImpl.java b/jsprit-core/src/main/java/algorithms/JobRemoverImpl.java deleted file mode 100644 index 737fca0a..00000000 --- a/jsprit-core/src/main/java/algorithms/JobRemoverImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2013 Stefan Schroeder - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * Stefan Schroeder - initial API and implementation - ******************************************************************************/ -package algorithms; - -import java.util.ArrayList; -import java.util.List; - -import basics.Job; -import basics.route.VehicleRoute; - -class JobRemoverImpl implements JobRemover{ - - interface RemoverListener { - public void informRemovedJob(Job j, VehicleRoute r); - } - - private List remListeners = new ArrayList(); - - @Override - public boolean removeJobWithoutTourUpdate(Job job, VehicleRoute vehicleRoute) { - boolean jobRemoved = vehicleRoute.getTourActivities().removeJob(job); - if(jobRemoved) informRemovedJob(job,vehicleRoute); - return jobRemoved; - } - - private void informRemovedJob(Job job, VehicleRoute vehicleRoute) { - for(RemoverListener l : remListeners) l.informRemovedJob(job, vehicleRoute); - } - - public List getRemListeners() { - return remListeners; - } - - - -} diff --git a/jsprit-core/src/main/java/algorithms/RuinStrategy.java b/jsprit-core/src/main/java/algorithms/RuinStrategy.java index 8f425c6a..37d9e109 100644 --- a/jsprit-core/src/main/java/algorithms/RuinStrategy.java +++ b/jsprit-core/src/main/java/algorithms/RuinStrategy.java @@ -13,7 +13,6 @@ package algorithms; import java.util.Collection; -import java.util.List; import basics.Job; import basics.route.VehicleRoute;