vehicleRoutes, Job job){
-// InsertionData best = null;
-// InsertionData secondBest = null;
-// VehicleRoute bestRoute = null;
-// double benchmark = Double.MAX_VALUE;
-// for(VehicleRoute route : vehicleRoutes){
-// if(secondBest != null){
-// benchmark = secondBest.getInsertionCost();
-// }
-// InsertionData iData = routeAlgorithm.calculateBestInsertion(route, job, benchmark);
-// if(iData instanceof NoInsertionFound) continue;
-// if(best == null) {
-// best = iData;
-// bestRoute = route;
-// }
-// else if(iData.getInsertionCost() < best.getInsertionCost()){
-// secondBest = best;
-// best = iData;
-// bestRoute = route;
-// }
-// else if(secondBest == null) secondBest = iData;
-// else if(iData.getInsertionCost() < secondBest.getInsertionCost()) secondBest = iData;
-// }
-// if(best == null){
-// return null;
-// }
-// double score = score(job,best,secondBest);
-// return new ScoredJob(job, score, best, bestRoute);
-// }
-//
-// private double score(Job unassignedJob, InsertionData best, InsertionData secondBest) {
-// /*
-// * wieder so eine bescheuerte fallunterscheidung. hier will ich
-// * doch einfach nur das maßgebende zeitfenster des jobs
-// * job.getTimeWindow()
-// * Problem: eine Shipment hat zwei TWs, sowohl ein PickupTW als auch
-// * ein DeliveryTW
-// */
-// double twStart = 0.0;
-// double twEnd = 0.0;
-// if(unassignedJob instanceof Shipment){
-// twStart = ((Shipment) unassignedJob).getDeliveryTW().getStart();
-// twEnd = ((Shipment) unassignedJob).getDeliveryTW().getEnd();
-// }
-// else if(unassignedJob instanceof Service){
-// twStart = ((Service) unassignedJob).getTimeWindow().getStart();
-// twEnd = ((Service) unassignedJob).getTimeWindow().getEnd();
-// }
-// if(best == null){
-// throw new IllegalStateException("cannot insert job " + unassignedJob.getId());
-// }
-// if(secondBest == null){
-// return Double.MAX_VALUE;
-// }
-//// double score = (secondBest.getInsertionCost()-best.getInsertionCost()) + scoreParam_of_distance*getDistance(unassignedJob) - scoreParam_of_timeWindowLegth*(twEnd-twStart);
-//// logger.info("priceDiff="+ (secondBest.getPrice()-best.getPrice()) + "; param*dist="
-// double timeWindowInfluence = scoreParam_of_timeWindowLegth*(twEnd-twStart);
-// double distanceInfluence = scoreParam_of_distance*getDistance(unassignedJob);
-// double score = (secondBest.getInsertionCost()-best.getInsertionCost()) - timeWindowInfluence
-// + distanceInfluence;
-// return score;
-// }
-//
-// private double getDistance(Job unassignedJob) {
-// return depotDistance.calcDistance(unassignedJob);
-// }
-//
-//
-// public double getTimeParam() {
-// return scoreParam_of_timeWindowLegth;
-// }
-//
-//
-//}
diff --git a/jsprit-core/src/main/java/jsprit/core/algorithm/recreate/RegretInsertion.java b/jsprit-core/src/main/java/jsprit/core/algorithm/recreate/RegretInsertion.java
deleted file mode 100644
index cbac3d07..00000000
--- a/jsprit-core/src/main/java/jsprit/core/algorithm/recreate/RegretInsertion.java
+++ /dev/null
@@ -1,246 +0,0 @@
-package jsprit.core.algorithm.recreate;
-/*******************************************************************************
- * Copyright (C) 2013 Stefan Schroeder
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3.0 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see .
- ******************************************************************************/
-///*******************************************************************************
-// * 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.ArrayList;
-//import java.util.Collection;
-//import java.util.List;
-//
-//import org.apache.log4j.Logger;
-//
-//import algorithms.InsertionData.NoInsertionFound;
-//import basics.Job;
-//import basics.Service;
-//import basics.algo.InsertionListener;
-//import basics.route.VehicleRoute;
-//
-//
-///**
-// * Insertion based an regret approach.
-// *
-// * Basically calculates the insertion cost of the firstBest and the secondBest alternative. The score is then calculated as difference
-// * between secondBest and firstBest, plus additional scoring variables that can defined in this.ScoringFunction.
-// * The idea is that if the cost of the secondBest alternative is way higher than the first best, it seems to be important to insert this
-// * customer immediatedly. If difference is not that high, it might not impact solution if this customer is inserted later.
-// *
-// * @author stefan schroeder
-// *
-// */
-//final class RegretInsertion implements InsertionStrategy{
-//
-// /**
-// * Scorer to include other impacts on score such as time-window length or distance to depot.
-// *
-// * @author schroeder
-// *
-// */
-// static interface ScoringFunction {
-//
-// public double score(Job job);
-//
-// }
-//
-// /**
-// * Scorer that includes the length of the time-window when scoring a job. The wider the time-window, the lower the score.
-// *
-// *
This is the default scorer, i.e.: score = (secondBest - firstBest) + this.TimeWindowScorer.score(job)
-// *
-// * @author schroeder
-// *
-// */
-// static class TimeWindowScorer implements ScoringFunction {
-//
-// private double tw_scoringParam = - 0.1;
-//
-// @Override
-// public double score(Job job) {
-// double twStart = 0.0;
-// double twEnd = 0.0;
-//// if(job instanceof Shipment){
-//// twStart = ((Shipment) job).getDeliveryTW().getStart();
-//// twEnd = ((Shipment) job).getDeliveryTW().getEnd();
-//// }
-//// else
-// if(job instanceof Service){
-// twStart = ((Service) job).getTimeWindow().getStart();
-// twEnd = ((Service) job).getTimeWindow().getEnd();
-// }
-// return (twEnd-twStart)*tw_scoringParam;
-// }
-//
-// @Override
-// public String toString() {
-// return "[name=timeWindowScorer][scoringParam="+tw_scoringParam+"]";
-// }
-//
-// }
-//
-// public static RegretInsertion newInstance(RouteAlgorithm routeAlgorithm) {
-// return new RegretInsertion(routeAlgorithm);
-// }
-//
-// private Logger logger = Logger.getLogger(RegretInsertion.class);
-//
-// private RouteAlgorithm routeAlgorithm;
-//
-// private ScoringFunction scoringFunction = new TimeWindowScorer();
-//
-// /**
-// * Sets the scoring function.
-// *
-// *
By default, the this.TimeWindowScorer is used.
-// *
-// * @param scoringFunction
-// */
-// public void setScoringFunction(ScoringFunction scoringFunction) {
-// this.scoringFunction = scoringFunction;
-// }
-//
-// public RegretInsertion(RouteAlgorithm routeAlgorithm) {
-// super();
-// this.routeAlgorithm = routeAlgorithm;
-// logger.info("initialise " + this);
-// }
-//
-// @Override
-// public String toString() {
-// return "[name=regretInsertion][additionalScorer="+scoringFunction+"]";
-// }
-//
-// public RouteAlgorithm getRouteAlgorithm(){
-// return routeAlgorithm;
-// }
-//
-// /**
-// * Runs insertion.
-// *
-// *
Before inserting a job, all unassigned jobs are scored according to its best- and secondBest-insertion plus additional scoring variables.
-// *
-// */
-// @Override
-// public void insertJobs(Collection routes, Collection unassignedJobs) {
-// List jobs = new ArrayList(unassignedJobs);
-//// informInsertionStarts(routes,unassignedJobs);
-// int inserted = 0;
-// while(!jobs.isEmpty()){
-// List unassignedJobList = new ArrayList(jobs);
-// ScoredJob bestScoredJob = null;
-// double bestScore = -1*Double.MAX_VALUE;
-// VehicleRoute insertIn = null;
-//
-// for(Job unassignedJob : unassignedJobList){
-// InsertionData best = null;
-// InsertionData secondBest = null;
-// VehicleRoute bestRoute = null;
-//
-// double benchmark = Double.MAX_VALUE;
-// for(VehicleRoute route : routes){
-// if(secondBest != null){
-// benchmark = secondBest.getInsertionCost();
-// }
-// InsertionData iData = routeAlgorithm.calculateBestInsertion(route, unassignedJob, benchmark);
-// if(iData instanceof NoInsertionFound) continue;
-// if(best == null){
-// best = iData;
-// bestRoute = route;
-// }
-// else if(iData.getInsertionCost() < best.getInsertionCost()){
-// secondBest = best;
-// best = iData;
-// bestRoute = route;
-// }
-// else if(secondBest == null || (iData.getInsertionCost() < secondBest.getInsertionCost())){
-// secondBest = iData;
-// }
-// }
-// if(best == null){
-// break;
-// }
-// double score = score(unassignedJob,best,secondBest);
-// if(score > bestScore){
-// bestScoredJob = new ScoredJob(unassignedJob,score,best,bestRoute);
-// bestScore = score;
-// }
-// }
-// Job assignedJob;
-// if(bestScoredJob == null){
-// Job job = unassignedJobList.get(0);
-// VehicleRoute newRoute = VehicleRoute.emptyRoute();
-// InsertionData bestI = routeAlgorithm.calculateBestInsertion(newRoute, job, Double.MAX_VALUE);
-// if(bestI instanceof InsertionData.NoInsertionFound) throw new IllegalStateException("given the vehicles, could not create a valid solution");
-// insertIn=newRoute;
-// assignedJob=job;
-// routeAlgorithm.insertJob(job,bestI,newRoute);
-// routes.add(newRoute);
-// jobs.remove(job);
-//
-// }
-// else{
-// routeAlgorithm.insertJob(bestScoredJob.getJob(),bestScoredJob.getInsertionData(), bestScoredJob.getRoute());
-// insertIn=bestScoredJob.getRoute();
-// assignedJob=bestScoredJob.getJob();
-// jobs.remove(bestScoredJob.getJob());
-// }
-// inserted++;
-//// informJobInserted(assignedJob, insertIn);
-//
-// }
-// }
-//
-// private double score(Job unassignedJob, InsertionData best, InsertionData secondBest) {
-// if(best == null){
-// throw new IllegalStateException("cannot insert job " + unassignedJob.getId());
-// }
-// if(secondBest == null){
-// return Double.MAX_VALUE;
-// }
-// return (secondBest.getInsertionCost()-best.getInsertionCost()) + scoringFunction.score(unassignedJob);
-//
-// }
-//
-// @Override
-// public void removeListener(InsertionListener insertionListener) {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// @Override
-// public Collection getListeners() {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// @Override
-// public void addListener(InsertionListener insertionListener) {
-// // TODO Auto-generated method stub
-//
-// }
-//
-//}
diff --git a/jsprit-core/src/test/java/jsprit/core/algorithm/FindCheaperVehicleTest.java b/jsprit-core/src/test/java/jsprit/core/algorithm/FindCheaperVehicleTest.java
deleted file mode 100644
index 2146984c..00000000
--- a/jsprit-core/src/test/java/jsprit/core/algorithm/FindCheaperVehicleTest.java
+++ /dev/null
@@ -1,256 +0,0 @@
-package jsprit.core.algorithm;
-/*******************************************************************************
- * Copyright (C) 2013 Stefan Schroeder
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3.0 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see .
- ******************************************************************************/
-//package algorithms;
-//
-//import static org.hamcrest.CoreMatchers.is;
-//import static org.junit.Assert.assertThat;
-//
-//import java.util.ArrayList;
-//import java.util.Collection;
-//
-//import org.junit.Before;
-//import org.junit.Test;
-//
-//import util.ManhattanDistanceCalculator;
-//import algorithms.FindCheaperVehicleAlgo;
-//import algorithms.TourStateUpdater;
-//import basics.Coordinate;
-//import basics.Driver;
-//import basics.Service;
-//import basics.TimeWindow;
-//import basics.Tour;
-//import basics.TourBuilder;
-//import basics.Vehicle;
-//import basics.VehicleFleetManager;
-//import basics.VehicleFleetManagerImpl;
-//import basics.VehicleImpl;
-//import basics.VehicleRoute;
-//import basics.VehicleRoutingCosts;
-//import basics.VehicleImpl.Type;
-//
-//
-//public class FindCheaperVehicleTest {
-//
-// Tour tour;
-//
-// Vehicle heavyVehicle;
-//
-// Vehicle lightVehicle;
-//
-// VehicleRoutingCosts cost;
-//
-// @Before
-// public void setUp(){
-//
-// cost = new VehicleRoutingCosts() {
-//
-// @Override
-// public double getBackwardTransportTime(String fromId, String toId,
-// double arrivalTime, Driver driver, Vehicle vehicle) {
-// // TODO Auto-generated method stub
-// return 0;
-// }
-//
-// @Override
-// public double getBackwardTransportCost(String fromId, String toId,
-// double arrivalTime, Driver driver, Vehicle vehicle) {
-// // TODO Auto-generated method stub
-// return 0;
-// }
-//
-// @Override
-// public double getTransportCost(String fromId, String toId, double departureTime, Driver driver, Vehicle vehicle) {
-//
-// String[] fromTokens = fromId.split(",");
-// String[] toTokens = toId.split(",");
-// double fromX = Double.parseDouble(fromTokens[0]);
-// double fromY = Double.parseDouble(fromTokens[1]);
-//
-// double toX = Double.parseDouble(toTokens[0]);
-// double toY = Double.parseDouble(toTokens[1]);
-//
-// return vehicle.getType().vehicleCostParams.perDistanceUnit*ManhattanDistanceCalculator.calculateDistance(new Coordinate(fromX, fromY), new Coordinate(toX, toY));
-// }
-//
-// @Override
-// public double getTransportTime(String fromId, String toId, double departureTime, Driver driver, Vehicle vehicle) {
-// return 0;
-// }
-// };
-//
-// Type lightType = VehicleImpl.TypeBuilder.newInstance().setId("light").setCapacity(10).setFixedCost(1.0).setCostPerDistance(1.0).build();
-// lightVehicle = VehicleImpl.VehicleBuilder.newInstance("light").setLocationId("0,0").setType(lightType).build();
-//
-// Type heavyType = VehicleImpl.TypeBuilder.newInstance().setId("heavy").setCapacity(10).setFixedCost(2.0).setCostPerDistance(2.0).build();
-// heavyVehicle = VehicleImpl.VehicleBuilder.newInstance("heavy").setLocationId("0,0").setType(heavyType).build();
-// }
-//
-// @Test
-// public void runCheaperVehicle_lightIsCheaperThanHeavy_changeVehicle(){
-// TourStateUpdater tourStateCalculator = new TourStateUpdater(cost, new ExampleTransportCostFunction());
-//
-// TourBuilder tourBuilder = new TourBuilder();
-// Service firstShipment = getService("10,0");
-// tourBuilder.scheduleStart("0,0", 0.0, Double.MAX_VALUE);
-// tourBuilder.scheduleDeliveryService(firstShipment);
-// tourBuilder.scheduleEnd("0,0", 0.0, Double.MAX_VALUE);
-//
-// Tour tour = tourBuilder.build();
-//
-// VehicleRoute route = new VehicleRoute(tour,new Driver(){},heavyVehicle);
-// tourStateCalculator.updateTour(route);
-//
-// Collection vehicles = new ArrayList();
-// vehicles.add(lightVehicle);
-// vehicles.add(heavyVehicle);
-// VehicleFleetManager fleetManager = new VehicleFleetManagerImpl(vehicles);
-// fleetManager.lock(heavyVehicle);
-//
-// FindCheaperVehicleAlgo findCheaperVehicle = new FindCheaperVehicleAlgo(fleetManager, tourStateCalculator);
-// VehicleRoute newRoute = findCheaperVehicle.runAndGetVehicleRoute(route);
-//
-// assertThat(lightVehicle, is(newRoute.getVehicle()));
-// }
-//
-// @Test
-// public void runCheaperVehicle_costComparisonBetweenHeavyAndLight_keepHeavy(){
-//
-//
-// Type lightType = VehicleImpl.TypeBuilder.newInstance().setId("light").setCapacity(10).setFixedCost(1.0).setCostPerDistance(1.0).build();
-// lightVehicle = VehicleImpl.VehicleBuilder.newInstance("light").setLocationId("0,0").setType(lightType).build();
-//
-// Type heavyType = VehicleImpl.TypeBuilder.newInstance().setId("heavy").setCapacity(10).setFixedCost(2.0).setCostPerDistance(1.0).build();
-// heavyVehicle = VehicleImpl.VehicleBuilder.newInstance("heavy").setLocationId("0,0").setType(heavyType).build();
-//
-//
-// TourStateUpdater tourStateCalculator = new TourStateUpdater(cost, new ExampleTransportCostFunction());
-//
-// TourBuilder tourBuilder = new TourBuilder();
-// Service firstShipment = getService("10,0");
-// tourBuilder.scheduleStart("0,0", 0.0, Double.MAX_VALUE);
-// tourBuilder.scheduleDeliveryService(firstShipment);
-// tourBuilder.scheduleEnd("0,0", 0.0, Double.MAX_VALUE);
-//
-// Tour tour = tourBuilder.build();
-//
-//
-// VehicleRoute route = new VehicleRoute(tour,new Driver(){},heavyVehicle);
-// tourStateCalculator.updateTour(route);
-//
-// Collection vehicles = new ArrayList();
-// vehicles.add(lightVehicle);
-// vehicles.add(heavyVehicle);
-// VehicleFleetManager fleetManager = new VehicleFleetManagerImpl(vehicles);
-// fleetManager.lock(heavyVehicle);
-//
-// FindCheaperVehicleAlgo findCheaperVehicle = new FindCheaperVehicleAlgo(fleetManager, tourStateCalculator);
-// findCheaperVehicle.setWeightFixCosts(0.0);
-// VehicleRoute newRoute = findCheaperVehicle.runAndGetVehicleRoute(route);
-//
-// assertThat(heavyVehicle, is(newRoute.getVehicle()));
-//
-// }
-//
-// @Test
-// public void runCheaperVehicle_lightIsTheCheapest_doNotChangeVehicle(){
-// TourBuilder tourBuilder = new TourBuilder();
-// Service firstShipment = getService("10,0");
-// tourBuilder.scheduleStart("0,0", 0.0, Double.MAX_VALUE);
-// tourBuilder.scheduleDeliveryService(firstShipment);
-// tourBuilder.scheduleEnd("0,0", 0.0, Double.MAX_VALUE);
-//
-// VehicleRoute route = new VehicleRoute(tourBuilder.build(),new Driver(){},lightVehicle);
-//
-// Collection vehicles = new ArrayList();
-// vehicles.add(lightVehicle);
-// vehicles.add(heavyVehicle);
-// VehicleFleetManager fleetManager = new VehicleFleetManagerImpl(vehicles);
-// fleetManager.lock(heavyVehicle);
-//
-// TourStateUpdater tourStateCalculator = new TourStateUpdater(cost, new ExampleTransportCostFunction());
-// FindCheaperVehicleAlgo findCheaperVehicle = new FindCheaperVehicleAlgo(fleetManager, tourStateCalculator);
-// VehicleRoute newRoute = findCheaperVehicle.runAndGetVehicleRoute(route);
-//
-// assertThat(lightVehicle, is(newRoute.getVehicle()));
-//
-//
-// }
-//
-// @Test
-// public void runCheaperVehicle_noAlterativeVehicle_doNotChangeVehicle(){
-// TourBuilder tourBuilder = new TourBuilder();
-// Service firstShipment = getService("10,0");
-// tourBuilder.scheduleStart("0,0", 0.0, Double.MAX_VALUE);
-// tourBuilder.scheduleDeliveryService(firstShipment);
-// tourBuilder.scheduleEnd("0,0", 0.0, Double.MAX_VALUE);
-//
-// VehicleRoute route = new VehicleRoute(tourBuilder.build(),new Driver(){},heavyVehicle);
-//
-// Collection vehicles = new ArrayList();
-//// vehicles.add(lightVehicle);
-// vehicles.add(heavyVehicle);
-// VehicleFleetManager fleetManager = new VehicleFleetManagerImpl(vehicles);
-// fleetManager.lock(heavyVehicle);
-//
-// TourStateUpdater tourStateCalculator = new TourStateUpdater(cost, new ExampleTransportCostFunction());
-// FindCheaperVehicleAlgo findCheaperVehicle = new FindCheaperVehicleAlgo(fleetManager, tourStateCalculator);
-// VehicleRoute newRoute = findCheaperVehicle.runAndGetVehicleRoute(route);
-//
-//
-// assertThat(heavyVehicle, is(newRoute.getVehicle()));
-//
-// }
-//
-// @Test
-// public void runCheaperVehicle_noTour_throwException(){
-// TourBuilder tourBuilder = new TourBuilder();
-// Service firstShipment = getService("10,0");
-// tourBuilder.scheduleStart("0,0", 0.0, Double.MAX_VALUE);
-// tourBuilder.scheduleDeliveryService(firstShipment);
-// tourBuilder.scheduleEnd("0,0", 0.0, Double.MAX_VALUE);
-//
-// VehicleRoute route = new VehicleRoute(null,null,heavyVehicle);
-//
-// Collection vehicles = new ArrayList();
-//// vehicles.add(lightVehicle);
-// vehicles.add(heavyVehicle);
-// VehicleFleetManager fleetManager = new VehicleFleetManagerImpl(vehicles);
-// fleetManager.lock(heavyVehicle);
-//
-// TourStateUpdater tourStateCalculator = new TourStateUpdater(cost, new ExampleTransportCostFunction());
-// FindCheaperVehicleAlgo findCheaperVehicle = new FindCheaperVehicleAlgo(fleetManager, tourStateCalculator);
-// VehicleRoute newRoute = findCheaperVehicle.runAndGetVehicleRoute(route);
-//
-// assertThat(heavyVehicle, is(newRoute.getVehicle()));
-// }
-//
-// private Service getService(String to, double serviceTime) {
-// Service s = Service.Builder.newInstance("s", 0).setLocationId(to).setServiceTime(serviceTime).setTimeWindow(TimeWindow.newInstance(0.0, 20.0)).build();
-// return s;
-// }
-//
-// private Service getService(String to) {
-// Service s = getService(to, 0.0);
-// return s;
-// }
-//
-//
-//
-//
-//
-//}
diff --git a/jsprit-core/src/test/java/jsprit/core/algorithm/GendreauPostOptTest.java b/jsprit-core/src/test/java/jsprit/core/algorithm/GendreauPostOptTest.java
deleted file mode 100644
index c96ccf38..00000000
--- a/jsprit-core/src/test/java/jsprit/core/algorithm/GendreauPostOptTest.java
+++ /dev/null
@@ -1,305 +0,0 @@
-///*******************************************************************************
-// * Copyright (C) 2013 Stefan Schroeder
-// *
-// * This library is free software; you can redistribute it and/or
-// * modify it under the terms of the GNU Lesser General Public
-// * License as published by the Free Software Foundation; either
-// * version 3.0 of the License, or (at your option) any later version.
-// *
-// * This library 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
-// * Lesser General Public License for more details.
-// *
-// * You should have received a copy of the GNU Lesser General Public
-// * License along with this library. If not, see .
-// ******************************************************************************/
-//package jsprit.core.algorithm;
-//
-//import static org.junit.Assert.assertEquals;
-//
-//import java.util.ArrayList;
-//import java.util.Arrays;
-//import java.util.Collection;
-//import java.util.List;
-//
-//import jsprit.core.algorithm.module.Gendreau;
-//import jsprit.core.algorithm.recreate.BestInsertion;
-//import jsprit.core.algorithm.recreate.InsertionStrategy;
-//import jsprit.core.algorithm.recreate.JobInsertionConsideringFixCostsCalculator;
-//import jsprit.core.algorithm.recreate.JobInsertionCostsCalculator;
-//import jsprit.core.algorithm.recreate.LocalActivityInsertionCostsCalculator;
-//import jsprit.core.algorithm.recreate.ServiceInsertionCalculator;
-//import jsprit.core.algorithm.recreate.VehicleSwitched;
-//import jsprit.core.algorithm.recreate.VehicleTypeDependentJobInsertionCalculator;
-//import jsprit.core.algorithm.ruin.RuinRadial;
-//import jsprit.core.algorithm.ruin.distance.JobDistanceAvgCosts;
-//import jsprit.core.algorithm.state.StateFactory;
-//import jsprit.core.algorithm.state.StateManager;
-//import jsprit.core.problem.VehicleRoutingProblem;
-//import jsprit.core.problem.constraint.TimeWindowConstraint;
-//import jsprit.core.problem.cost.VehicleRoutingActivityCosts;
-//import jsprit.core.problem.cost.VehicleRoutingTransportCosts;
-//import jsprit.core.problem.driver.Driver;
-//import jsprit.core.problem.driver.DriverImpl;
-//import jsprit.core.problem.job.Job;
-//import jsprit.core.problem.job.Service;
-//import jsprit.core.problem.solution.VehicleRoutingProblemSolution;
-//import jsprit.core.problem.solution.route.VehicleRoute;
-//import jsprit.core.problem.solution.route.activity.ServiceActivity;
-//import jsprit.core.problem.solution.route.activity.TimeWindow;
-//import jsprit.core.problem.solution.route.activity.TourActivities;
-//import jsprit.core.problem.vehicle.FiniteFleetManagerFactory;
-//import jsprit.core.problem.vehicle.Vehicle;
-//import jsprit.core.problem.vehicle.VehicleFleetManager;
-//import jsprit.core.problem.vehicle.VehicleImpl;
-//import jsprit.core.problem.vehicle.VehicleTypeImpl;
-//import jsprit.core.util.Coordinate;
-//import jsprit.core.util.ManhattanDistanceCalculator;
-//import jsprit.core.util.RouteUtils;
-//
-//import org.junit.Before;
-//import org.junit.Test;
-//
-//
-//public class GendreauPostOptTest {
-//
-// TourActivities tour;
-//
-// Vehicle heavyVehicle;
-//
-// Vehicle lightVehicle1;
-//
-// Vehicle lightVehicle2;
-//
-// VehicleRoutingTransportCosts cost;
-//
-// VehicleRoutingActivityCosts activityCosts;
-//
-// VehicleRoutingProblem vrp;
-//
-// Service job1;
-//
-// Service job2;
-//
-// Service job3;
-//
-// private StateManager states;
-//
-// private List vehicles;
-//
-// private VehicleFleetManager fleetManager;
-//
-// private JobInsertionCostsCalculator insertionCalc;
-//
-// @Before
-// public void setUp(){
-//
-// cost = new VehicleRoutingTransportCosts() {
-//
-// @Override
-// public double getBackwardTransportTime(String fromId, String toId,
-// double arrivalTime, Driver driver, Vehicle vehicle) {
-// // TODO Auto-generated method stub
-// return 0;
-// }
-//
-// @Override
-// public double getBackwardTransportCost(String fromId, String toId,
-// double arrivalTime, Driver driver, Vehicle vehicle) {
-// // TODO Auto-generated method stub
-// return 0;
-// }
-//
-// @Override
-// public double getTransportCost(String fromId, String toId, double departureTime, Driver driver, Vehicle vehicle) {
-//
-// String[] fromTokens = fromId.split(",");
-// String[] toTokens = toId.split(",");
-// double fromX = Double.parseDouble(fromTokens[0]);
-// double fromY = Double.parseDouble(fromTokens[1]);
-//
-// double toX = Double.parseDouble(toTokens[0]);
-// double toY = Double.parseDouble(toTokens[1]);
-//
-// double costPerDistanceUnit;
-// if(vehicle != null){
-// costPerDistanceUnit = vehicle.getType().getVehicleCostParams().perDistanceUnit;
-// }
-// else{
-// costPerDistanceUnit = 1;
-// }
-//
-// return costPerDistanceUnit*ManhattanDistanceCalculator.calculateDistance(new Coordinate(fromX, fromY), new Coordinate(toX, toY));
-// }
-//
-// @Override
-// public double getTransportTime(String fromId, String toId, double departureTime, Driver driver, Vehicle vehicle) {
-// return 0;
-// }
-// };
-//
-// VehicleTypeImpl lightType = VehicleTypeImpl.Builder.newInstance("light", 10).setFixedCost(10).setCostPerDistance(1.0).build();
-// VehicleTypeImpl heavyType = VehicleTypeImpl.Builder.newInstance("heavy", 10).setFixedCost(30).setCostPerDistance(2.0).build();
-//
-// lightVehicle1 = VehicleImpl.Builder.newInstance("light").setLocationId("0,0").setType(lightType).build();
-// lightVehicle2 = VehicleImpl.Builder.newInstance("light2").setLocationId("0,0").setType(lightType).build();
-// heavyVehicle = VehicleImpl.Builder.newInstance("heavy").setLocationId("0,0").setType(heavyType).build();
-//
-//
-// job1 = getService("10,0");
-// job2 = getService("10,10");
-// job3 = getService("0,10");
-//
-// Collection jobs = new ArrayList();
-// jobs.add(job1);
-// jobs.add(job2);
-// jobs.add(job3);
-//
-// vehicles = Arrays.asList(lightVehicle1,lightVehicle2, heavyVehicle);
-//
-//// Collection vehicles = Arrays.asList(lightVehicle1,lightVehicle2, heavyVehicle);
-// fleetManager = new FiniteFleetManagerFactory(vehicles).createFleetManager();
-// states = new StateManager();
-//
-// activityCosts = new ExampleActivityCostFunction();
-//
-//
-// ServiceInsertionCalculator standardServiceInsertion = new ServiceInsertionCalculator(cost, new LocalActivityInsertionCostsCalculator(cost, activityCosts), new LoadConstraint(states), new TimeWindowConstraint(states, cost));
-//
-//
-//
-//
-// JobInsertionConsideringFixCostsCalculator withFixCost = new JobInsertionConsideringFixCostsCalculator(standardServiceInsertion, states);
-// withFixCost.setWeightOfFixCost(1.2);
-//
-// insertionCalc = new VehicleTypeDependentJobInsertionCalculator(fleetManager, withFixCost);
-//
-//// updater = new TourStateUpdater(states, cost, activityCosts);
-//
-// }
-//
-// @Test
-// public void whenPostOpt_splitsTour_oneActiveTourBecomeTwoSeperateActiveTours(){
-// Collection jobs = new ArrayList();
-// jobs.add(job1);
-// jobs.add(job2);
-//
-// vrp = VehicleRoutingProblem.Builder.newInstance().addAllJobs(jobs).addAllVehicles(vehicles).setRoutingCost(cost).build();
-//
-// TourActivities tour = new TourActivities();
-// tour.addActivity(ServiceActivity.newInstance(job1));
-// tour.addActivity(ServiceActivity.newInstance(job2));
-//
-// VehicleRoute route = VehicleRoute.newInstance(tour,DriverImpl.noDriver(),heavyVehicle);
-//
-// fleetManager.lock(heavyVehicle);
-//
-// UpdateStates stateUpdater = new UpdateStates(states, vrp.getTransportCosts(), vrp.getActivityCosts());
-// stateUpdater.update(route);
-//
-// Collection routes = new ArrayList();
-// routes.add(route);
-//// routes.add(new VehicleRoute(getEmptyTour(),getDriver(),getNoVehicle()));
-//// routes.add(new VehicleRoute(getEmptyTour(),getDriver(),getNoVehicle()));
-//
-//
-// VehicleRoutingProblemSolution sol = new VehicleRoutingProblemSolution(routes, states.getRouteState(route, StateFactory.COSTS).toDouble() + getFixedCosts(routes));
-//
-//
-// assertEquals(110.0, sol.getCost(), 0.5);
-//
-//
-// RuinRadial radialRuin = new RuinRadial(vrp, 0.2, new JobDistanceAvgCosts(vrp.getTransportCosts()));
-//// radialRuin.addListener(stateUpdater);
-//
-// InsertionStrategy insertionStrategy = new BestInsertion(insertionCalc);
-// insertionStrategy.addListener(stateUpdater);
-// insertionStrategy.addListener(new VehicleSwitched(fleetManager));
-// Gendreau postOpt = new Gendreau(vrp, radialRuin, insertionStrategy, fleetManager);
-//
-// VehicleRoutingProblemSolution newSolution = postOpt.runAndGetSolution(sol);
-// newSolution.setCost(getCosts(newSolution,states));
-//
-// assertEquals(2,RouteUtils.getNuOfActiveRoutes(newSolution.getRoutes()));
-// assertEquals(2,newSolution.getRoutes().size());
-// assertEquals(80.0,newSolution.getCost(),0.5);
-// }
-//
-// private double getFixedCosts(Collection routes) {
-// double c = 0.0;
-// for(VehicleRoute r : routes){ c += r.getVehicle().getType().getVehicleCostParams().fix; }
-// return c;
-// }
-//
-// private double getCosts(VehicleRoutingProblemSolution newSolution, StateManager states) {
-// double c = 0.0;
-// for(VehicleRoute r : newSolution.getRoutes()){
-//
-// c += states.getRouteState(r, StateFactory.COSTS).toDouble() + r.getVehicle().getType().getVehicleCostParams().fix;
-//
-// }
-// return c;
-// }
-//
-// @Test
-// public void whenPostOpt_optsRoutesWithMoreThanTwoJobs_oneRouteBecomesTwoRoutes(){
-// Collection jobs = new ArrayList();
-// jobs.add(job1);
-// jobs.add(job2);
-// jobs.add(job3);
-//
-// vrp = VehicleRoutingProblem.Builder.newInstance().addAllJobs(jobs).addAllVehicles(vehicles).setRoutingCost(cost).build();
-//
-// TourActivities tour = new TourActivities();
-// tour.addActivity(ServiceActivity.newInstance(job1));
-// tour.addActivity(ServiceActivity.newInstance(job2));
-// tour.addActivity(ServiceActivity.newInstance(job3));
-//
-// VehicleRoute route = VehicleRoute.newInstance(tour,DriverImpl.noDriver(),heavyVehicle);
-//
-// UpdateStates stateUpdater = new UpdateStates(states, vrp.getTransportCosts(), vrp.getActivityCosts());
-// stateUpdater.update(route);
-//
-// fleetManager.lock(heavyVehicle);
-//
-// Collection routes = new ArrayList();
-// routes.add(route);
-//
-// VehicleRoutingProblemSolution sol = new VehicleRoutingProblemSolution(routes, route.getCost());
-// sol.setCost(getCosts(sol,states));
-//
-// assertEquals(110.0, sol.getCost(), 0.5);
-//
-// RuinRadial radialRuin = new RuinRadial(vrp, 0.2, new JobDistanceAvgCosts(vrp.getTransportCosts()));
-// InsertionStrategy insertionStrategy = new BestInsertion(insertionCalc);
-// insertionStrategy.addListener(stateUpdater);
-// insertionStrategy.addListener(new VehicleSwitched(fleetManager));
-// Gendreau postOpt = new Gendreau(vrp, radialRuin, insertionStrategy, fleetManager);
-// postOpt.setShareOfJobsToRuin(1.0);
-// postOpt.setNuOfIterations(1);
-//
-//// postOpt.setWithFix(withFixCost);
-// VehicleRoutingProblemSolution newSolution = postOpt.runAndGetSolution(sol);
-// newSolution.setCost(getCosts(newSolution,states));
-//
-// assertEquals(2,RouteUtils.getNuOfActiveRoutes(newSolution.getRoutes()));
-// assertEquals(2,newSolution.getRoutes().size());
-// assertEquals(80.0,newSolution.getCost(),0.5);
-// }
-//
-// private Service getService(String to, double serviceTime) {
-// Service s = Service.Builder.newInstance(to, 0).setLocationId(to).setServiceTime(serviceTime).setTimeWindow(TimeWindow.newInstance(0.0, 20.0)).build();
-//
-// return s;
-// }
-//
-// private Service getService(String to) {
-// Service s = getService(to, 0.0);
-// return s;
-// }
-//
-//
-//
-//
-//}
diff --git a/jsprit-core/src/test/java/jsprit/core/algorithm/recreate/TestAuxilliaryCostCalculatorWithServices.java b/jsprit-core/src/test/java/jsprit/core/algorithm/recreate/TestAuxilliaryCostCalculatorWithServices.java
deleted file mode 100644
index 4f332cd4..00000000
--- a/jsprit-core/src/test/java/jsprit/core/algorithm/recreate/TestAuxilliaryCostCalculatorWithServices.java
+++ /dev/null
@@ -1,215 +0,0 @@
-package jsprit.core.algorithm.recreate;
-/*******************************************************************************
- * Copyright (C) 2013 Stefan Schroeder
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3.0 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see .
- ******************************************************************************/
-//package algorithms;
-//
-//import java.util.ArrayList;
-//import java.util.Collection;
-//import java.util.List;
-//
-//import junit.framework.TestCase;
-//
-//import org.junit.Test;
-//
-//import util.EuclideanDistanceCalculator;
-//import basics.Coordinate;
-//import basics.Driver;
-//import basics.Job;
-//import basics.Service;
-//import basics.TimeWindow;
-//import basics.Tour;
-//import basics.TourActivity;
-//import basics.TourBuilder;
-//import basics.Vehicle;
-//import basics.VehicleRoutingTransportCosts;
-
-//
-//
-//public class TestAuxilliaryCostCalculatorWithServices extends TestCase{
-//
-// AuxilliaryCostCalculator costCalc;
-//
-// Tour tour;
-//
-// public void setUp(){
-//
-// VehicleRoutingTransportCosts cost = new VehicleRoutingTransportCosts() {
-//
-// @Override
-// public double getBackwardTransportTime(String fromId, String toId,
-// double arrivalTime, Driver driver, Vehicle vehicle) {
-// // TODO Auto-generated method stub
-// return 0;
-// }
-//
-// @Override
-// public double getBackwardTransportCost(String fromId, String toId,
-// double arrivalTime, Driver driver, Vehicle vehicle) {
-// // TODO Auto-generated method stub
-// return 0;
-// }
-//
-// @Override
-// public double getTransportCost(String fromId, String toId, double departureTime, Driver driver, Vehicle vehicle) {
-// String[] fromTokens = fromId.split(",");
-// String[] toTokens = toId.split(",");
-// double fromX = Double.parseDouble(fromTokens[0]);
-// double fromY = Double.parseDouble(fromTokens[1]);
-//
-// double toX = Double.parseDouble(toTokens[0]);
-// double toY = Double.parseDouble(toTokens[1]);
-//
-// return EuclideanDistanceCalculator.calculateDistance(new Coordinate(fromX, fromY), new Coordinate(toX, toY));
-// }
-//
-// @Override
-// public double getTransportTime(String fromId, String toId, double departureTime, Driver driver, Vehicle vehicle) {
-//
-// return 0;
-// }
-// };
-//
-// costCalc = AuxilliaryCostCalculator.newInstance(cost, new ExampleTransportCostFunction());
-//
-// Service firstService = Service.Builder.newInstance("1", 0).setLocationId("10,0").setTimeWindow(TimeWindow.newInstance(0, 20)).build();
-// Service secondService = Service.Builder.newInstance("2", 0).setLocationId("0,10").setTimeWindow(TimeWindow.newInstance(0, 20)).build();
-//
-// Collection services = new ArrayList();
-// services.add(firstService);
-// services.add(secondService);
-//
-// ActivityStates states = new ActivityStates();
-// states.initialiseStateOfJobs(services);
-//
-// TourBuilder tourBuilder = new TourBuilder();
-//
-// tourBuilder.scheduleStart("0,0", 0.0, Double.MAX_VALUE);
-// tourBuilder.addActivity(states.getActivity(firstService,true));
-// tourBuilder.addActivity(states.getActivity(secondService,true));
-// tourBuilder.scheduleEnd("0,0", 0.0, Double.MAX_VALUE);
-//
-// tour = tourBuilder.build();
-// costCalc.setActivityStates(states);
-//
-// }
-//
-//// @Test
-//// public void testGetPath(){
-//// List path = AuxilliaryCostCalculator.getPath(tour,tour.getStart(), tour.getActivities().get(1));
-//// assertEquals(3,path.size());
-//// }
-////
-//// @Test
-//// public void testGetPath_withEnd(){
-//// List path = AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(0), tour.getEnd());
-//// assertEquals(3,path.size());
-//// }
-//
-//
-//// public void testCalcTourCost(){
-//// List path = AuxilliaryCostCalculator.getPath(tour,tour.getStart(), tour.getActivities().get(1));
-//// assertEquals(0.0, costCalc.costOfPath(path,0.0,null,null));
-//// }
-//
-//// public void testCalcTourCost2(){
-//// assertEquals(10.0, costCalc.costOfPath(AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(0), tour.getActivities().get(2)),0.0,null,null));
-//// }
-////
-//// public void testCalcTourCost3(){
-//// assertEquals(20.0, costCalc.costOfPath(AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(2), tour.getActivities().get(6)),0.0,null,null));
-//// }
-////
-//// public void testCalcTourCost4(){
-//// assertEquals(30.0, costCalc.costOfPath(AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(0), tour.getActivities().get(6)),0.0,null,null));
-//// }
-////
-//// public void testCalcTourCost5(){
-//// assertEquals(40.0, costCalc.costOfPath(AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(1), tour.getActivities().get(7)),0.0,null,null));
-//// }
-//
-//// public void testCalcTourCost6(){
-//// assertEquals(0.0, costCalc.costOfPath(AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(1), tour.getActivities().get(1)),0.0,null,null));
-//// }
-////
-//// public void testCalcTourCost7(){
-//// try{
-//// double c =costCalc.costOfPath(AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(1), tour.getActivities().get(0)),0.0,null,null);
-//// assertTrue(false);
-//// }
-//// catch(AssertionError e){
-//// assertTrue(true);
-//// }
-//// catch(IllegalArgumentException e){
-//// assertTrue(true);
-//// }
-//// }
-////
-//// public void testCalcTourCost8(){
-//// try{
-//// Shipment s = getShipment("10,10","0,10");
-//// TourActivity pickup = new Pickup(s);
-////
-//// double c = costCalc.costOfPath(AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(0), pickup),0.0,null,null);
-//// assertTrue(false);
-//// }
-//// catch(AssertionError e){
-//// assertTrue(true);
-//// }
-//// catch(IllegalArgumentException e){
-//// assertTrue(true);
-//// }
-//// }
-////
-//// public void testBoundary1(){
-//// assertEquals(40.0, costCalc.costOfPath(AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(1), tour.getActivities().get(tour.getActivities().size()-1)),0.0,null,null));
-//// }
-////
-//// public void testBoundary2(){
-//// try{
-//// costCalc.costOfPath(AuxilliaryCostCalculator.getPath(tour,tour.getActivities().get(tour.getActivities().size()-1), tour.getActivities().get(0)),0.0,null,null);
-//// assertTrue(false);
-//// }
-//// catch(AssertionError e){
-//// assertTrue(true);
-//// }
-//// catch(IllegalArgumentException e){
-//// assertTrue(true);
-//// }
-//// }
-////
-////// public void testBoundary3(){
-////// assertEquals(40.0, costCalc.calculateCost(tour, tour.getActivities().getFirst(), tour.getActivities().getLast(), Double.MAX_VALUE, null, null));
-////// }
-//////
-////// public void testBoundary4(){
-////// try{
-////// costCalc.calculateCost(tour, tour.getActivities().getFirst(), tour.getActivities().getLast(), (-1)*Double.MAX_VALUE, null, null);
-////// assertTrue(false);
-////// }
-////// catch(AssertionError e){
-////// assertTrue(true);
-////// }
-////// }
-////
-////
-////
-//// private Shipment getShipment(String string, String string2) {
-//// Shipment s = Shipment.Builder.newInstance("first", 0).setFromId(string).setToId(string2).setPickupTW(TimeWindow.newInstance(0.0, 20.0)).setDeliveryTW(TimeWindow.newInstance(0.0, 20.0)).build();
-//// return s;
-//// }
-////
-//}