Package jsprit.core.problem

Examples of jsprit.core.problem.VehicleRoutingProblem


    @Test
    public void testRead_ifReaderIsCalled_itReadsSuccessfullyV2(){
        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        ArrayList<VehicleRoutingProblemSolution> solutions = new ArrayList<VehicleRoutingProblemSolution>();
        new VrpXMLReader(vrpBuilder, solutions).read("src/test/resources/finiteVrpWithShipmentsAndSolution.xml");
        VehicleRoutingProblem vrp = vrpBuilder.build();
        assertEquals(4,vrp.getJobs().size());
        assertEquals(1,solutions.size());

        assertEquals(1,solutions.get(0).getRoutes().size());
        List<TourActivity> activities = solutions.get(0).getRoutes().iterator().next().getTourActivities().getActivities();
        assertEquals(4,activities.size());
View Full Code Here


    new SolomonReader(vrpBuilder).read("input/R101.txt");
   
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    /*
     * Create ComputationalLaboratory
     */
    ComputationalLaboratory computationalLab = new ComputationalLaboratory();
View Full Code Here

//    new SolomonReader(vrpBuilder).read("/Users/schroeder/IdeaProjects/jsprit/jsprit-instances/instances/solomon/R211.txt");
    new VrpXMLReader(vrpBuilder).read("output/R211.xml");
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
    VehicleRoutingProblem vrp = vrpBuilder.build();

//        new VrpXMLWriter(vrp).write("output/R211.xml");
//    new Plotter(vrp).plot("output/solomon_R101.png", "R101");

    /*
 
View Full Code Here

                .setPickupCoord(Coordinate.newInstance(1, 6)).setDeliveryCoord(Coordinate.newInstance(10, 12)).build();

        Shipment apples_2 = Shipment.Builder.newInstance("apples_2").addSizeDimension(APPLES_DIMENSION_INDEX,1)
                .setPickupCoord(Coordinate.newInstance(1, 5)).setDeliveryCoord(Coordinate.newInstance(10, 11)).build();

        VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().setFleetSize(VehicleRoutingProblem.FleetSize.INFINITE)
                .addVehicle(vehicle)
                .addJob(bananas).addJob(apples).addJob(bananas_2).addJob(bananas_3).addJob(apples_2).build();

        VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(vrp,"input/algorithmConfig.xml");
        vraBuilder.addCoreConstraints();
View Full Code Here

    new VrpXMLReader(vrpBuilder).read("input/deliveries_solomon_specifiedVehicleEndLocations_c101.xml");
   
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    Plotter pblmPlotter = new Plotter(vrp);
    pblmPlotter.plot("output/solomon_C101_specifiedVehicleEndLocations.png","C101");
   
    /*
 
View Full Code Here


    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
    VehicleRoutingProblem vrp = vrpBuilder.build();

    new Plotter(vrp).plot("output/solomon_C101.png", "C101");
   
    /*
     * Define the required vehicle-routing algorithms to solve the above problem.
View Full Code Here

    vrpBuilder.setFleetSize(FleetSize.FINITE);
   


    //build the problem
    VehicleRoutingProblem problem = vrpBuilder.build();

    /*
     * add a geographic constraint determining that vehicle1 cannot go to x>15 and vehicle2 cannot go to x<15
     *
     * switch off the geoConstraints to see the impact of this constraint on routes, or just exchange v1 and v2 to reverse the geo-constraint.
View Full Code Here

   
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
   
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
//    SolutionPlotter.plotVrpAsPNG(vrp, "output/pd_solomon_r101_o.png", "pd_r101");
   
    /*
     * Define the required vehicle-routing algorithms to solve the above problem.
View Full Code Here

    new SolomonReader(vrpBuilder).read("input/C101_solomon.txt");
   
    /*
     * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
     */
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    /*
     * Get schrimpf with threshold accepting
     * Note that Priority.LOW is a way to priorize AlgorithmListeners
     */
 
View Full Code Here

   
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    vrpBuilder.addVehicle(vehicle);
    vrpBuilder.addJob(service1).addJob(service2).addJob(service3).addJob(service4);

    VehicleRoutingProblem problem = vrpBuilder.build();
   
    /*
     * get the algorithm out-of-the-box.
     */
    VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
View Full Code Here

TOP

Related Classes of jsprit.core.problem.VehicleRoutingProblem

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.