Examples of VehicleRoutingProblem


Examples of jsprit.core.problem.VehicleRoutingProblem

 
  @Test
  public void whenReadingShipments_itReadsThemCorrectly(){
    VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(builder, null).read(inFileName);
    VehicleRoutingProblem vrp = builder.build();
    int shipCounter = 0;
    for(Job j : vrp.getJobs().values()){
      if(j instanceof Shipment) shipCounter++;
    }
    assertEquals(2,shipCounter);
  }
View Full Code Here

Examples of jsprit.core.problem.VehicleRoutingProblem

    @Test
    public void whenReadingShipment3_skill1ShouldBeAssigned(){
        VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(builder, null).read(inFileName);
        VehicleRoutingProblem vrp = builder.build();
        Shipment s = (Shipment) vrp.getJobs().get("3");
        assertTrue(s.getRequiredSkills().containsSkill("skill1"));
    }
View Full Code Here

Examples of jsprit.core.problem.VehicleRoutingProblem

    @Test
    public void whenReadingShipment3_skill2ShouldBeAssigned(){
        VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(builder, null).read(inFileName);
        VehicleRoutingProblem vrp = builder.build();
        Shipment s = (Shipment) vrp.getJobs().get("3");
        assertTrue(s.getRequiredSkills().containsSkill("skill2"));
    }
View Full Code Here

Examples of jsprit.core.problem.VehicleRoutingProblem

    @Test
    public void whenReadingShipment3_nuSkillsShouldBeCorrect(){
        VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(builder, null).read(inFileName);
        VehicleRoutingProblem vrp = builder.build();
        Shipment s = (Shipment) vrp.getJobs().get("3");
        assertEquals(2,s.getRequiredSkills().values().size());
    }
View Full Code Here

Examples of jsprit.core.problem.VehicleRoutingProblem

    @Test
    public void whenReadingShipment4_nuSkillsOfV2ShouldBeCorrect(){
        VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(builder, null).read(inFileName);
        VehicleRoutingProblem vrp = builder.build();
        Shipment s = (Shipment) vrp.getJobs().get("4");
        assertEquals(0,s.getRequiredSkills().values().size());
    }
View Full Code Here

Examples of jsprit.core.problem.VehicleRoutingProblem

 
  @Test
  public void whenReadingServices_capOfService1IsReadCorrectly(){
    VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(builder, null).read(inFileName);
    VehicleRoutingProblem vrp = builder.build();
    Service s1 = (Service) vrp.getJobs().get("1");
    assertEquals(1,s1.getSize().get(0));
  }
View Full Code Here

Examples of jsprit.core.problem.VehicleRoutingProblem

 
  @Test
  public void whenReadingServices_durationOfService1IsReadCorrectly(){
    VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(builder, null).read(inFileName);
    VehicleRoutingProblem vrp = builder.build();
    Service s1 = (Service) vrp.getJobs().get("1");
    assertEquals(10.0,s1.getServiceDuration(),0.01);
  }
View Full Code Here

Examples of jsprit.core.problem.VehicleRoutingProblem

 
  @Test
  public void whenReadingServices_twOfService1IsReadCorrectly(){
    VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(builder, null).read(inFileName);
    VehicleRoutingProblem vrp = builder.build();
    Service s1 = (Service) vrp.getJobs().get("1");
    assertEquals(0.0,s1.getTimeWindow().getStart(),0.01);
    assertEquals(4000.0,s1.getTimeWindow().getEnd(),0.01);
  }
View Full Code Here

Examples of jsprit.core.problem.VehicleRoutingProblem

 
  @Test
  public void whenReadingServices_typeOfService1IsReadCorrectly(){
    VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(builder, null).read(inFileName);
    VehicleRoutingProblem vrp = builder.build();
    Service s1 = (Service) vrp.getJobs().get("1");
    assertEquals("service",s1.getType());
  }
View Full Code Here

Examples of jsprit.core.problem.VehicleRoutingProblem

 
  @Test
  public void whenReadingFile_v2MustNotReturnToDepot(){
    VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(builder, null).read(inFileName);
    VehicleRoutingProblem vrp = builder.build();
    Vehicle v = getVehicle("v2",vrp.getVehicles());
    assertFalse(v.isReturnToDepot());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.