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

add Figliozzi utilities to benchmark VRP with time dependent costs

This commit is contained in:
oblonski 2014-09-17 13:00:35 +02:00
parent 8df550e0e6
commit 50f3efb098

View file

@ -23,7 +23,7 @@ import org.junit.Test;
import java.util.List; import java.util.List;
public class FigliozziReaderTest { public class FigliozziTest {
@Test @Test
public void factoryShouldReturnCorrectSpeedDistribution(){ public void factoryShouldReturnCorrectSpeedDistribution(){
@ -35,8 +35,8 @@ public class FigliozziReaderTest {
} }
@Test @Test
public void whenAskingForTD1b_factoryShouldReturnCorrectSpeedDistribution(){ public void whenAskingForTD2a_factoryShouldReturnCorrectSpeedDistribution(){
List<Double> speedValues = Figliozzi.TimeDependentTransportCostsFactory.createSpeedValues(Figliozzi.TimeDependentTransportCostsFactory.SpeedDistribution.TD1b); List<Double> speedValues = Figliozzi.TimeDependentTransportCostsFactory.createSpeedValues(Figliozzi.TimeDependentTransportCostsFactory.SpeedDistribution.TD2a);
Assert.assertEquals(speedValues.get(0),1.,0.01); Assert.assertEquals(speedValues.get(0),1.,0.01);
Assert.assertEquals(speedValues.get(1),2.,0.01); Assert.assertEquals(speedValues.get(1),2.,0.01);
Assert.assertEquals(speedValues.get(2),1.5,0.01); Assert.assertEquals(speedValues.get(2),1.5,0.01);
@ -44,8 +44,8 @@ public class FigliozziReaderTest {
} }
@Test @Test
public void whenAskingForTD1c_factoryShouldReturnCorrectSpeedDistribution(){ public void whenAskingForTD3a_factoryShouldReturnCorrectSpeedDistribution(){
List<Double> speedValues = Figliozzi.TimeDependentTransportCostsFactory.createSpeedValues(Figliozzi.TimeDependentTransportCostsFactory.SpeedDistribution.TD1c); List<Double> speedValues = Figliozzi.TimeDependentTransportCostsFactory.createSpeedValues(Figliozzi.TimeDependentTransportCostsFactory.SpeedDistribution.TD3a);
Assert.assertEquals(speedValues.get(0),1.,0.01); Assert.assertEquals(speedValues.get(0),1.,0.01);
Assert.assertEquals(speedValues.get(1),2.5,0.01); Assert.assertEquals(speedValues.get(1),2.5,0.01);
Assert.assertEquals(speedValues.get(2),1.75,0.01); Assert.assertEquals(speedValues.get(2),1.75,0.01);