mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
improve ruinApi
This commit is contained in:
parent
4f3c76ff28
commit
d46fed424d
3 changed files with 0 additions and 91 deletions
|
|
@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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<RemoverListener> remListeners = new ArrayList<RemoverListener>();
|
||||
|
||||
@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<RemoverListener> getRemListeners() {
|
||||
return remListeners;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -13,7 +13,6 @@
|
|||
package algorithms;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import basics.Job;
|
||||
import basics.route.VehicleRoute;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue