Package jsprit.core.algorithm.box

Examples of jsprit.core.algorithm.box.SchrimpfFactory


    /*
     * Define the required vehicle-routing algorithms to solve the above problem.
     *
     * The algorithm can be defined and configured in an xml-file.
     */
    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);

    /*
     * Solve the problem.
     *
     *
 
View Full Code Here


   
    /*
     * Get schrimpf with threshold accepting
     * Note that Priority.LOW is a way to priorize AlgorithmListeners
     */
    VehicleRoutingAlgorithm vra_withThreshold = new SchrimpfFactory().createAlgorithm(vrp);
    vra_withThreshold.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/schrimpfThreshold_progress.png"), Priority.LOW);
    vra_withThreshold.getAlgorithmListeners().addListener(new StopWatch(), Priority.HIGH);
    /*
     * Get greedy schrimpf
     */
 
View Full Code Here

    VehicleRoutingProblem problem = vrpBuilder.build();
   
    /*
     * get the algorithm out-of-the-box.
     */
    VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
   
    /*
     * and search a solution
     */
    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
View Full Code Here

    VehicleRoutingProblem problem = vrpBuilder.build();
   
    /*
     * get the algorithm out-of-the-box.
     */
    VehicleRoutingAlgorithm algorithm = new SchrimpfFactory().createAlgorithm(problem);
   
    /*
     * and search a solution
     */
    Collection<VehicleRoutingProblemSolution> solutions = algorithm.searchSolutions();
View Full Code Here

  public void whenEmployingVehicleWithDifferentWorkingShifts_nRoutesShouldBeCorrect(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem.xml");
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
    vra.setNuOfIterations(100);
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    assertEquals(2,Solutions.bestOf(solutions).getRoutes().size());
  }
View Full Code Here

  public void whenEmployingVehicleWithDifferentWorkingShifts_certainJobsCanNeverBeAssignedToCertainVehicles(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem.xml");
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
    vra.setNuOfIterations(100);
    final List<Boolean> testFailed = new ArrayList<Boolean>();
    vra.addListener(new JobInsertedListener() {
     
      @Override
View Full Code Here

  public void whenEmployingVehicleWithDifferentWorkingShifts_certainVehiclesCanNeverBeAssignedToCertainRoutes(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem.xml");
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
    vra.setNuOfIterations(100);
    final List<Boolean> testFailed = new ArrayList<Boolean>();
    vra.addListener(new VehicleSwitchedListener() {
     
      @Override
View Full Code Here

  public void whenEmployingVehicleWithDifferentWorkingShifts_job2CanNeverBeInVehicle21(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem.xml");
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
    vra.setNuOfIterations(100);
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
    assertEquals(2,Solutions.bestOf(solutions).getRoutes().size());
  }
View Full Code Here

  public void whenEmployingVehicleWithDifferentWorkingShifts_job1ShouldBeAssignedCorrectly(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem.xml");
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
    vra.setNuOfIterations(100);
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
//    assertEquals(2,Solutions.bestOf(solutions).getRoutes().size());
    assertTrue(containsJob(vrp.getJobs().get("1"),getRoute("21",Solutions.bestOf(solutions))));
View Full Code Here

  public void whenEmployingVehicleWithDifferentWorkingShifts_job2ShouldBeAssignedCorrectly(){
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    new VrpXMLReader(vrpBuilder).read("src/test/resources/simpleProblem.xml");
    VehicleRoutingProblem vrp = vrpBuilder.build();
   
    VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
    vra.setNuOfIterations(100);
    Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
   
//    assertEquals(2,Solutions.bestOf(solutions).getRoutes().size());
    assertTrue(containsJob(vrp.getJobs().get("2"),getRoute("19",Solutions.bestOf(solutions))));
View Full Code Here

TOP

Related Classes of jsprit.core.algorithm.box.SchrimpfFactory

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.