/*******************************************************************************
 * Copyright (c) 2011 Stefan Schroeder.
 * eMail: stefan.schroeder@kit.edu
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Stefan Schroeder - initial API and implementation
 ******************************************************************************/
package algorithms;

import java.util.Collection;

import basics.Job;
import basics.route.VehicleRoute;




/**
 * 
 * @author stefan schroeder
 * 
 */

interface RuinStrategy {
	
	public static interface RuinListener {
		
		public void ruinStarts(Collection<VehicleRoute> routes);
		
		public void ruinEnds(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs);
		
		public void removed(Job job, VehicleRoute fromRoute);
		
	}

	/**
	 * Ruins a current solution, i.e. removes jobs from service providers and
	 * returns a collection of these removed, and thus unassigned, jobs.
	 * 
	 * @param vehicleRoutes
	 * @return
	 */
	public Collection<Job> ruin(Collection<VehicleRoute> vehicleRoutes);

	public Collection<Job> ruin(Collection<VehicleRoute> vehicleRoutes, Job targetJob, int nOfJobs2BeRemoved);
	
	public void addListener(RuinListener ruinListener);

}

@@ -751,203 +751,664 @@
 %0A%09%0A%09
-public static interface RuinListener %7B%0A%09%09%0A%09%09public void ruinStarts(Collection%3CVehicleRoute%3E routes);%0A%09%09%0A%09%09public void ruinEnds(Collection%3CVehicleRoute%3E routes, Collection%3CJob%3E unassignedJobs);%0A%09%09
+/**%0A%09 * Listener that listens to the ruin-process. It informs whoever is interested about start, end and about a removal of a job.%0A%09 * %0A%09 * @author schroeder%0A%09 *%0A%09 */%0A%09public static interface RuinListener %7B%0A%09%09%0A%09%09/**%0A%09%09 * informs about ruin-start.%0A%09%09 * %0A%09%09 * @param routes%0A%09%09 */%0A%09%09public void ruinStarts(Collection%3CVehicleRoute%3E routes);%0A%09%09%0A%09%09/**%0A%09%09 * informs about ruin-end.%0A%09%09 * %0A%09%09 * @param routes%0A%09%09 * @param unassignedJobs%0A%09%09 */%0A%09%09public void ruinEnds(Collection%3CVehicleRoute%3E routes, Collection%3CJob%3E unassignedJobs);%0A%09%09%0A%09%09/**%0A%09%09 * informs if a %7B@link Job%7D has been removed from a %7B@link VehicleRoute%7D.%0A%09%09 * %0A%09%09 * @param job%0A%09%09 * @param fromRoute%0A%09%09 */
 %0A%09%09p
@@ -1511,47 +1511,43 @@
 .e. 
-removes jobs from service provider
+a collection of vehicle-route
 s and
+ 
 %0A%09 *
@@ -1575,22 +1575,15 @@
  of 
-these 
 removed
-,
  and
@@ -1598,17 +1598,16 @@
 assigned
-,
  jobs.%0A%09
@@ -1621,17 +1621,24 @@
  @param 
-v
+%7B@link V
 ehicleRo
@@ -1640,17 +1640,17 @@
 cleRoute
-s
+%7D
 %0A%09 * @re
@@ -1653,16 +1653,42 @@
  @return
+ Collection of %7B@link Job%7D
 %0A%09 */%0A%09p
@@ -1756,16 +1756,112 @@
 utes);%0A%0A
+%09/**%0A%09 * Removes targetJob as well as its neighbors with a size of (nOfJobs2BeRemoved-1). %0A%09 */%0A
 %09public 
@@ -1962,16 +1962,89 @@
 ved);%0A%09%0A
+%09/**%0A%09 * Adds a ruin-listener.%0A%09 * %0A%09 * @param %7B@link RuinListener%7D%0A%09 */%0A
 %09public 

add javaDoc to RuinStrategy