Package jsprit.core.algorithm.selector

Examples of jsprit.core.algorithm.selector.SelectRandomly.selectSolution()


    when(random.nextInt(2)).thenReturn(1);

    SelectRandomly selectRandomly = new SelectRandomly();
    selectRandomly.setRandom(random);
   
    assertThat(selectRandomly.selectSolution(Arrays.asList(sol1,sol2)), is(sol2));
  }
 
  @Test
  public void whenHaving2Solutions_selectFirst(){
   
View Full Code Here


    when(random.nextInt(2)).thenReturn(0);

    SelectRandomly selectRandomly = new SelectRandomly();
    selectRandomly.setRandom(random);
   
    assertThat(selectRandomly.selectSolution(Arrays.asList(sol1,sol2)), is(sol1));
  }
 
  @Test
  public void whenHavingNoSolutions_returnNull(){ 
    Random random = mock(Random.class);
View Full Code Here

    when(random.nextInt(2)).thenReturn(0);

    SelectRandomly selectRandomly = new SelectRandomly();
    selectRandomly.setRandom(random);
   
    assertNull(selectRandomly.selectSolution(Collections.<VehicleRoutingProblemSolution> emptyList()));
  }
}
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.