1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

migrate SLF4j - remove sout

This commit is contained in:
oblonski 2016-06-15 07:55:08 +02:00
parent 1fc8dd0d87
commit 5c6ef8b8d3
13 changed files with 0 additions and 38 deletions

View file

@ -100,7 +100,6 @@ public class BuildCVRPAlgoFromScratch_IT {
@Category(IntegrationTest.class) @Category(IntegrationTest.class)
public void testVRA() { public void testVRA() {
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
System.out.println("costs=" + Solutions.bestOf(solutions).getCost() + ";#routes=" + Solutions.bestOf(solutions).getRoutes().size());
assertEquals(530.0, Solutions.bestOf(solutions).getCost(), 50.0); assertEquals(530.0, Solutions.bestOf(solutions).getCost(), 50.0);
assertEquals(5, Solutions.bestOf(solutions).getRoutes().size()); assertEquals(5, Solutions.bestOf(solutions).getRoutes().size());
} }

View file

@ -37,7 +37,6 @@ import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolutio
import com.graphhopper.jsprit.core.problem.solution.route.VehicleRoute; import com.graphhopper.jsprit.core.problem.solution.route.VehicleRoute;
import com.graphhopper.jsprit.core.problem.vehicle.InfiniteFleetManagerFactory; import com.graphhopper.jsprit.core.problem.vehicle.InfiniteFleetManagerFactory;
import com.graphhopper.jsprit.core.problem.vehicle.VehicleFleetManager; import com.graphhopper.jsprit.core.problem.vehicle.VehicleFleetManager;
import com.graphhopper.jsprit.core.util.Solutions;
import junit.framework.Assert; import junit.framework.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -110,7 +109,6 @@ public class BuildPDVRPAlgoFromScratch_IT {
public void test() { public void test() {
try { try {
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
System.out.println(Solutions.bestOf(solutions).getCost());
Assert.assertTrue(true); Assert.assertTrue(true);
} catch (Exception e) { } catch (Exception e) {
Assert.assertTrue(false); Assert.assertTrue(false);

View file

@ -90,8 +90,6 @@ public class CVRPwithMatrix_IT {
return vrp.getTransportCosts().getTransportCost(from, to, 0., null, null); return vrp.getTransportCosts().getTransportCost(from, to, 0., null, null);
} }
}); });
System.out.println(sa.getDistance());
System.out.println(sa.getTransportTime());
} }

View file

@ -54,7 +54,6 @@ public class FiniteVehicleFleetManagerIdentifiesDistinctVehicle_IT {
testFailed.add(true); testFailed.add(true);
} }
} }
System.out.println("failed: " + testFailed.size());
assertTrue(testFailed.isEmpty()); assertTrue(testFailed.isEmpty());
} }
@ -75,7 +74,6 @@ public class FiniteVehicleFleetManagerIdentifiesDistinctVehicle_IT {
testFailed.add(true); testFailed.add(true);
} }
} }
System.out.println("failed: " + testFailed.size());
assertTrue(testFailed.isEmpty()); assertTrue(testFailed.isEmpty());
} }

View file

@ -128,7 +128,6 @@ public class MeetTimeWindowConstraint_IT {
@SuppressWarnings("unused") @SuppressWarnings("unused")
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
System.out.println("failed " + testFailed.size());
assertTrue(testFailed.isEmpty()); assertTrue(testFailed.isEmpty());
} }
@ -254,7 +253,6 @@ public class MeetTimeWindowConstraint_IT {
@SuppressWarnings("unused") @SuppressWarnings("unused")
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
System.out.println("failed " + testFailed.size());
assertTrue(testFailed.isEmpty()); assertTrue(testFailed.isEmpty());
} }
@ -380,7 +378,6 @@ public class MeetTimeWindowConstraint_IT {
@SuppressWarnings("unused") @SuppressWarnings("unused")
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
System.out.println("failed " + testFailed.size());
assertTrue(testFailed.isEmpty()); assertTrue(testFailed.isEmpty());
} }
@ -506,7 +503,6 @@ public class MeetTimeWindowConstraint_IT {
@SuppressWarnings("unused") @SuppressWarnings("unused")
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions(); Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
System.out.println("failed " + testFailed.size());
assertTrue(testFailed.isEmpty()); assertTrue(testFailed.isEmpty());
} }

View file

@ -109,7 +109,6 @@ public class SolomonSkills_IT {
} }
assertTrue(true); assertTrue(true);
} catch (NoSolutionFoundException e) { } catch (NoSolutionFoundException e) {
System.out.println(e.toString());
assertFalse(true); assertFalse(true);
} }
} }

View file

@ -37,8 +37,5 @@ public class TestComparator {
} }
}); });
for(Job j : jobs){
System.out.println(j.getId());
}
} }
} }

View file

@ -65,10 +65,6 @@ public class DBSCANClustererTest {
c.setMinPts(1); c.setMinPts(1);
c.setEpsDistance(2); c.setEpsDistance(2);
List<List<Job>> cluster = c.getClusters(r); List<List<Job>> cluster = c.getClusters(r);
for (List<Job> l : cluster) {
System.out.println("--");
for (Job j : l) System.out.println(j);
}
Assert.assertEquals(3, cluster.size()); Assert.assertEquals(3, cluster.size());
} }

View file

@ -28,7 +28,6 @@ public class RuinBreakTest {
VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().setFleetSize(VehicleRoutingProblem.FleetSize.FINITE).addVehicle(v).build(); VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().setFleetSize(VehicleRoutingProblem.FleetSize.FINITE).addVehicle(v).build();
VehicleRoute route = VehicleRoute.Builder.newInstance(v).setJobActivityFactory(vrp.getJobActivityFactory()).addService(aBreak).build(); VehicleRoute route = VehicleRoute.Builder.newInstance(v).setJobActivityFactory(vrp.getJobActivityFactory()).addService(aBreak).build();
TourActivity tourActivity = route.getActivities().get(0); TourActivity tourActivity = route.getActivities().get(0);
System.out.println(tourActivity);
Assert.assertTrue(tourActivity instanceof BreakActivity); Assert.assertTrue(tourActivity instanceof BreakActivity);
RuinBreaks ruinBreaks = new RuinBreaks(); RuinBreaks ruinBreaks = new RuinBreaks();
List<Job> unassigned = new ArrayList<Job>(); List<Job> unassigned = new ArrayList<Job>();

View file

@ -63,7 +63,6 @@ public class AverageJobDistanceTest {
Shipment other1 = Shipment.Builder.newInstance("s1").addSizeDimension(0, 1).setPickupLocation(Location.Builder.newInstance().setId("0,0").build()).setDeliveryLocation(Location.newInstance(i + "," + j)).build(); Shipment other1 = Shipment.Builder.newInstance("s1").addSizeDimension(0, 1).setPickupLocation(Location.Builder.newInstance().setId("0,0").build()).setDeliveryLocation(Location.newInstance(i + "," + j)).build();
Shipment other2 = Shipment.Builder.newInstance("s2").addSizeDimension(0, 1).setPickupLocation(Location.Builder.newInstance().setId("0,0").build()).setDeliveryLocation(Location.newInstance("10,10")).build(); Shipment other2 = Shipment.Builder.newInstance("s2").addSizeDimension(0, 1).setPickupLocation(Location.Builder.newInstance().setId("0,0").build()).setDeliveryLocation(Location.newInstance("10,10")).build();
double dist2 = new AvgServiceAndShipmentDistance(routingCosts).getDistance(other1, other2); double dist2 = new AvgServiceAndShipmentDistance(routingCosts).getDistance(other1, other2);
System.out.println("(" + i + "," + j + "), dist=" + dist + ", dist2=" + dist2);
assertTrue(dist <= dist2 + dist2 * 0.001); assertTrue(dist <= dist2 + dist2 * 0.001);
} }
} }

View file

@ -224,7 +224,6 @@ public class VehicleDependentTimeWindowTest {
@Test @Test
public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt60_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt60_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -243,7 +242,6 @@ public class VehicleDependentTimeWindowTest {
@Test @Test
public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt50_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt50_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -261,7 +259,6 @@ public class VehicleDependentTimeWindowTest {
@Test @Test
public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt10_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt10_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -279,7 +276,6 @@ public class VehicleDependentTimeWindowTest {
@Test @Test
public void whenJobIsInsertedAlongWithV6BetweenS2AndS3_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithV6BetweenS2AndS3_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -297,7 +293,6 @@ public class VehicleDependentTimeWindowTest {
@Test @Test
public void whenJobIsInsertedAlongWithV6BetweenS1AndS2_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithV6BetweenS1AndS2_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -315,7 +310,6 @@ public class VehicleDependentTimeWindowTest {
@Test @Test
public void whenJobIsInsertedAlongWithV6AtTheEndOfRoute_itShouldReturnTrue() { public void whenJobIsInsertedAlongWithV6AtTheEndOfRoute_itShouldReturnTrue() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -331,7 +325,6 @@ public class VehicleDependentTimeWindowTest {
@Test @Test
public void whenJobIsInsertedAlongWithNewVehicleThatCanOnlyStartAt60_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithNewVehicleThatCanOnlyStartAt60_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();

View file

@ -222,7 +222,6 @@ public class VehicleDependentTimeWindowWithStartTimeAndMaxOperationTimeTest {
@Test @Test
public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt60_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt60_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -241,7 +240,6 @@ public class VehicleDependentTimeWindowWithStartTimeAndMaxOperationTimeTest {
@Test @Test
public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt50_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt50_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -259,7 +257,6 @@ public class VehicleDependentTimeWindowWithStartTimeAndMaxOperationTimeTest {
@Test @Test
public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt10_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt10_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -277,7 +274,6 @@ public class VehicleDependentTimeWindowWithStartTimeAndMaxOperationTimeTest {
@Test @Test
public void whenJobIsInsertedAlongWithV6BetweenS2AndS3_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithV6BetweenS2AndS3_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -295,7 +291,6 @@ public class VehicleDependentTimeWindowWithStartTimeAndMaxOperationTimeTest {
@Test @Test
public void whenJobIsInsertedAlongWithV6BetweenS1AndS2_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithV6BetweenS1AndS2_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -313,7 +308,6 @@ public class VehicleDependentTimeWindowWithStartTimeAndMaxOperationTimeTest {
@Test @Test
public void whenJobIsInsertedAlongWithV6AtTheEndOfRoute_itShouldReturnTrue() { public void whenJobIsInsertedAlongWithV6AtTheEndOfRoute_itShouldReturnTrue() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();
@ -329,7 +323,6 @@ public class VehicleDependentTimeWindowWithStartTimeAndMaxOperationTimeTest {
@Test @Test
public void whenJobIsInsertedAlongWithNewVehicleThatCanOnlyStartAt60_itShouldReturnFalse() { public void whenJobIsInsertedAlongWithNewVehicleThatCanOnlyStartAt60_itShouldReturnFalse() {
System.out.println("actualEndTime " + route.getEnd().getArrTime());
assertEquals(60., route.getEnd().getArrTime(), 0.01); assertEquals(60., route.getEnd().getArrTime(), 0.01);
Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build(); Service s4 = Service.Builder.newInstance("s4").setLocation(Location.newInstance("40,0")).build();

View file

@ -163,21 +163,18 @@ public class TimeTest {
@Test @Test
public void whenSecIs3600_shouldReturnCorrectTimeString() { public void whenSecIs3600_shouldReturnCorrectTimeString() {
String time = Time.parseSecondsToTime(3600); String time = Time.parseSecondsToTime(3600);
System.out.println(time);
assertEquals(3600., Time.parseTimeToSeconds(time), 0.01); assertEquals(3600., Time.parseTimeToSeconds(time), 0.01);
} }
@Test @Test
public void whenSecIs4000_shouldReturnCorrectTimeString() { public void whenSecIs4000_shouldReturnCorrectTimeString() {
String time = Time.parseSecondsToTime(4000); String time = Time.parseSecondsToTime(4000);
System.out.println(time);
assertEquals(4000., Time.parseTimeToSeconds(time), 0.01); assertEquals(4000., Time.parseTimeToSeconds(time), 0.01);
} }
@Test @Test
public void whenSecIs86399_shouldReturnCorrectTimeString() { public void whenSecIs86399_shouldReturnCorrectTimeString() {
String time = Time.parseSecondsToTime(86399); String time = Time.parseSecondsToTime(86399);
System.out.println(time);
assertEquals(86399., Time.parseTimeToSeconds(time), 0.01); assertEquals(86399., Time.parseTimeToSeconds(time), 0.01);
} }