Examples of VrpXMLReader


Examples of jsprit.core.problem.io.VrpXMLReader

    }

    @Test
    public void whenReadingProblemFromFile_maxCapacityShouldNotBeExceeded(){
        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem_iniRoutes_2.xml");
        VehicleRoutingAlgorithm vra = new GreedySchrimpfFactory().createAlgorithm(vrpBuilder.build());
        vra.setNuOfIterations(10);

        Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

  @Test
  public void whenEmployingVehicleWhereOnlyOneDistinctVehicleCanServeAParticularJob_algorithmShouldFoundDistinctSolution(){
    final List<Boolean> testFailed = new ArrayList<Boolean>();
    for(int i=0;i<10;i++){
      VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
      new VrpXMLReader(vrpBuilder).read("src/test/resources/biggerProblem.xml");
      VehicleRoutingProblem vrp = vrpBuilder.build();

      VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
      vra.setNuOfIterations(10);
      try{
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

public class CVRPwithDeliveries_IT {
 
  @Test
  public void whenSolvingVRPNC1withDeliveries_solutionsMustNoBeWorseThan5PercentOfBestKnownSolution(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/vrpnc1-jsprit-with-deliveries.xml");
    VehicleRoutingProblem vrp = vrpBuilder.build();
    VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "src/test/resources/algorithmConfig.xml");
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
        assertEquals(530.0, Solutions.bestOf(solutions).getCost(),50.0);
        assertEquals(5, Solutions.bestOf(solutions).getRoutes().size());
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    @Test
    public void whenReading_jobMapShouldOnlyContainJob2(){

        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem_iniRoutes.xml");
        VehicleRoutingProblem vrp = vrpBuilder.build();

        assertEquals(1,getNuServices(vrp));
        assertTrue(vrp.getJobs().containsKey("2"));
    }
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    @Test
    public void whenReadingProblem2_jobMapShouldContain_service2(){

        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem_inclShipments_iniRoutes.xml");
        VehicleRoutingProblem vrp = vrpBuilder.build();

        assertEquals(1,getNuServices(vrp));
        assertTrue(vrp.getJobs().containsKey("2"));
    }
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    @Test
    public void whenReading_jobMapShouldContain_shipment4(){

        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem_inclShipments_iniRoutes.xml");
        VehicleRoutingProblem vrp = vrpBuilder.build();

        assertEquals(1,getNuShipments(vrp));
        assertTrue(vrp.getJobs().containsKey("4"));
    }
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    @Test
    public void whenReading_thereShouldBeOnlyOneActAssociatedToJob2(){

        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem_iniRoutes.xml");
        VehicleRoutingProblem vrp = vrpBuilder.build();

        assertEquals(1, vrp.getActivities(vrp.getJobs().get("2")).size());
    }
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

public class Solomon_IT {

    @Test
    public void itShouldFindTheBestKnownSolution(){
        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(vrpBuilder).read("src/test/resources/solomon_c101.xml");
        VehicleRoutingProblem vrp = vrpBuilder.build();

        VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp,"src/test/resources/algorithmConfig.xml");
        vra.setNuOfIterations(500);
        Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

public class SelectRandomlyTest {

  @Test
  public void loadAnAlgorithmWithSelectRandomly() {
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem.xml");
    VehicleRoutingProblem vrp = vrpBuilder.build();
    try {
      VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "src/test/resources/algorithmConfig_selectRandomly.xml");
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

 
  @Before
  public void setup(){
   
      VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
      new VrpXMLReader(builder).read("src/test/resources/pd_solomon_r101.xml");
      vrp = builder.build();
     
      final StateManager stateManager = new StateManager(vrp);
     
      ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
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.