Package jsprit.instance.reader

Examples of jsprit.instance.reader.CordeauReader


public class CordeauReaderTest {
 
  @Test
  public void testCordeauReader(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
    vrpBuilder.build();
   
  }
View Full Code Here


  }
 
  @Test
  public void whenReadingInstance_fleetSizeIsFinite(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    assertEquals(FleetSize.FINITE, vrp.getFleetSize());
  }
View Full Code Here

  }
 
  @Test
  public void testNuOfVehicles(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    assertEquals(16,vrp.getVehicles().size());
  }
View Full Code Here

  }
 
  @Test
  public void whenReadingCordeauInstance_vehiclesHaveTheCorrectCapacity(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    for(Vehicle v : vrp.getVehicles()){
      assertEquals(80, v.getType().getCapacityDimensions().get(0));
    }
  }
View Full Code Here

  }
 
  @Test
  public void whenReadingCordeauInstance_vehiclesHaveTheCorrectDuration(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p08").getPath());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    for(Vehicle v : vrp.getVehicles()){
      assertEquals(0.0,v.getEarliestDeparture(),0.1);
      assertEquals(310.0, v.getLatestArrival()-v.getEarliestDeparture(),0.1);
    }
View Full Code Here

  }
 
  @Test
  public void whenReadingCustomersCordeauInstance_customerOneShouldHaveCorrectCoordinates(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    Service service = (Service) vrp.getJobs().get("1");
    assertEquals(37.0, service.getCoord().getX(), 0.1);
    assertEquals(52.0, service.getCoord().getY(), 0.1);
  }
View Full Code Here

  }
 
  @Test
  public void whenReadingCustomersCordeauInstance_customerTwoShouldHaveCorrectServiceDuration(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    Service service = (Service) vrp.getJobs().get("2");
    assertEquals(0.0, service.getServiceDuration(), 0.1);
  }
View Full Code Here

  }
 
  @Test
  public void whenReadingCustomersCordeauInstance_customerThreeShouldHaveCorrectDemand(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    Service service = (Service) vrp.getJobs().get("3");
    assertEquals(16.0, service.getSize().get(0), 0.1)
  }
View Full Code Here

  }
 
  @Test
  public void whenReadingCustomersCordeauInstance_customerFortySevenShouldHaveCorrectDemand(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    Service service = (Service) vrp.getJobs().get("47");
    assertEquals(25.0, service.getSize().get(0), 0.1)
  }
View Full Code Here

  }
 
  @Test
  public void testLocationsAndCapOfVehicles(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new CordeauReader(vrpBuilder).read(this.getClass().getClassLoader().getResource("p01").getPath());
    VehicleRoutingProblem vrp = vrpBuilder.build();
    boolean capacityOk = true;
    boolean loc1ok = false;
    boolean loc2ok = false;
    boolean loc3ok = false;
View Full Code Here

TOP

Related Classes of jsprit.instance.reader.CordeauReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.