Package jsprit.core.algorithm.ruin.RuinRadial

Examples of jsprit.core.algorithm.ruin.RuinRadial.JobNeighborhoodsImplWithCapRestriction


    jobDistance = new EuclideanServiceDistance();
  }
 
  @Test
  public void whenRequestingNeighborhoodOfTargetJob_nNeighborsShouldBeTwo(){
    JobNeighborhoodsImplWithCapRestriction jn = new JobNeighborhoodsImplWithCapRestriction(vrp, jobDistance, 2);
    jn.initialise();
    Iterator<Job> iter = jn.getNearestNeighborsIterator(2, target);
    List<Service> services = new ArrayList<Service>();
    while(iter.hasNext()){
      services.add((Service) iter.next());
    }
    assertEquals(2,services.size());
View Full Code Here


    assertEquals(2,services.size());
  }
 
  @Test
  public void whenRequestingNeighborhoodOfTargetJob_s2ShouldBeNeighbor(){
    JobNeighborhoodsImplWithCapRestriction jn = new JobNeighborhoodsImplWithCapRestriction(vrp, jobDistance, 2);
    jn.initialise();
    Iterator<Job> iter = jn.getNearestNeighborsIterator(2, target);
    List<Service> services = new ArrayList<Service>();
    while(iter.hasNext()){
      services.add((Service) iter.next());
    }
    assertTrue(services.contains(s2));
View Full Code Here

    assertTrue(services.contains(s2));
  }
 
  @Test
  public void whenRequestingNeighborhoodOfTargetJob_s4ShouldBeNeighbor(){
    JobNeighborhoodsImplWithCapRestriction jn = new JobNeighborhoodsImplWithCapRestriction(vrp, jobDistance, 2);
    jn.initialise();
    Iterator<Job> iter = jn.getNearestNeighborsIterator(2, target);
    List<Service> services = new ArrayList<Service>();
    while(iter.hasNext()){
      services.add((Service) iter.next());
    }
    assertTrue(services.contains(s5));
View Full Code Here

    assertTrue(services.contains(s5));
  }
 
  @Test
  public void whenRequestingNeighborhoodOfTargetJob_sizeShouldBe4(){
    JobNeighborhoodsImplWithCapRestriction jn = new JobNeighborhoodsImplWithCapRestriction(vrp, jobDistance, 4);
    jn.initialise();
    Iterator<Job> iter = jn.getNearestNeighborsIterator(4, target);
    List<Service> services = new ArrayList<Service>();
    while(iter.hasNext()){
      services.add((Service) iter.next());
    }
    assertEquals(4,services.size());
View Full Code Here

    assertEquals(4,services.size());
  }
 
  @Test
  public void whenRequestingMoreNeighborsThanExisting_itShouldReturnMaxNeighbors(){
    JobNeighborhoodsImplWithCapRestriction jn = new JobNeighborhoodsImplWithCapRestriction(vrp, jobDistance, 2);
    jn.initialise();
    Iterator<Job> iter = jn.getNearestNeighborsIterator(100, target);
    List<Service> services = new ArrayList<Service>();
    while(iter.hasNext()){
      services.add((Service) iter.next());
    }
    assertEquals(2,services.size());
View Full Code Here

TOP

Related Classes of jsprit.core.algorithm.ruin.RuinRadial.JobNeighborhoodsImplWithCapRestriction

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.