Examples of VrpXMLReader


Examples of jsprit.core.problem.io.VrpXMLReader

public class PickupsAndDeliveries_IT {
 
  @Test
  public void whenSolvingLR101InstanceOfLiLim_solutionsMustNoBeWorseThan5PercentOfBestKnownSolution(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/lilim_lr101.xml");
    VehicleRoutingProblem vrp = vrpBuilder.build();
    VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "src/test/resources/lilim_algorithmConfig.xml");
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
    assertEquals(1650.8,Solutions.bestOf(solutions).getCost(),80.);
    assertEquals(19,Solutions.bestOf(solutions).getRoutes().size(),1);
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

public class CVRPwithPickups_IT {
 
  @Test
  public void whenSolvingVRPNC1WithPickups_solutionsMustNoBeWorseThan5PercentOfBestKnownSolution(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/vrpnc1-jsprit-with-pickups.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

   
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    /*
     * Read cordeau-instance p01, BUT only its services without any vehicles
     */
    new VrpXMLReader(vrpBuilder).read("input/vrp_cordeau_01.xml");
   
    /*
     * add vehicles with its depots
     * 4 depots:
     * (20,20)
 
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
   
    /*
     * A solomonReader reads solomon-instance files, and stores the required information in the builder.
     */
    new VrpXMLReader(vrpBuilder).read("input/pickups_and_deliveries_solomon_r101_withoutTWs.xml");
   
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
   
 
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    }
    public static void main(String[] args) {

        //route length 618
        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        new VrpXMLReader(vrpBuilder).read("input/pickups_and_deliveries_solomon_r101_withoutTWs.xml");
        //builds a matrix based on euclidean distances; t_ij = euclidean(i,j) / 2; d_ij = euclidean(i,j);
        VehicleRoutingTransportCostsMatrix costMatrix = createMatrix(vrpBuilder);
        vrpBuilder.setRoutingCost(costMatrix);
        VehicleRoutingProblem vrp = vrpBuilder.build();
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
   
    /*
     * A solomonReader reads solomon-instance files, and stores the required information in the builder.
     */
    new VrpXMLReader(vrpBuilder).read("input/deliveries_solomon_open_c101.xml");
   
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
    VehicleRoutingProblem vrp = vrpBuilder.build();
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

   
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    /*
     * Read cordeau-instance p01
     */
    new VrpXMLReader(vrpBuilder).read("input/cordeau01.xml");
   
    /*
     * Add initial route with 1_4_vehicle and services 44, 26
     */
    VehicleRoute initialRoute = VehicleRoute.Builder.newInstance(getVehicle("1_4_vehicle",vrpBuilder)).addService(getService("44",vrpBuilder))
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
   
    /*
     * A solomonReader reads solomon-instance files, and stores the required information in the builder.
     */
    new VrpXMLReader(vrpBuilder).read("input/pickups_and_deliveries_solomon_r101.xml");
   
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
//
 
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
   
    /*
     * A solomonReader reads solomon-instance files, and stores the required information in the builder.
     */
    new VrpXMLReader(vrpBuilder).read("input/pd_christophides_vrpnc1_vcap50.xml");
   
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
   
 
View Full Code Here

Examples of jsprit.core.problem.io.VrpXMLReader

    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
   
    /*
     * A solomonReader reads solomon-instance files, and stores the required information in the builder.
     */
    new VrpXMLReader(vrpBuilder).read("input/pickups_and_deliveries_solomon_c101_withoutTWs_and_specifiedVehicleEndLocations.xml");
   
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
//    vrpBuilder.addProblemConstraint(Constraint.DELIVERIES_FIRST);
 
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.