Package jsprit.core.algorithm.acceptor

Examples of jsprit.core.algorithm.acceptor.SolutionAcceptor


    String acceptorId = "acceptorId";
   
    ModKey key = new ModKey(acceptorName,acceptorId);
    AcceptorKey accKey = new AcceptorKey(key);
   
    SolutionAcceptor acceptor = new GreedyAcceptance(1);
   
    typedMap.put(accKey, acceptor);
   
    assertEquals(acceptor,typedMap.get(accKey));
   
View Full Code Here


    String selectorName = "selector";
    String selectorId = "selectorId";
   
    ModKey key = new ModKey(acceptorName,acceptorId);
    AcceptorKey accKey = new AcceptorKey(key);
    SolutionAcceptor acceptor =  new GreedyAcceptance(1);
   
    SelectorKey selKey = new SelectorKey(new ModKey(selectorName,selectorId));
    SolutionSelector selector = new SelectBest();
   
    typedMap.put(accKey, acceptor);
View Full Code Here

    String selectorName = "selector";
    String selectorId = "selectorId";
   
    ModKey key = new ModKey(acceptorName,acceptorId);
    AcceptorKey accKey = new AcceptorKey(key);
    SolutionAcceptor acceptor =  new GreedyAcceptance(1);
   
    SelectorKey selKey = new SelectorKey(new ModKey(selectorName,selectorId));
    SolutionSelector selector = new SelectBest();
   
    AcceptorKey accKey2 = new AcceptorKey(new ModKey(acceptorName2,acceptorId2));
    SolutionAcceptor acceptor2 =  new GreedyAcceptance(1);
   
    typedMap.put(accKey, acceptor);
    typedMap.put(selKey, selector);
    typedMap.put(accKey2, acceptor2);
   
View Full Code Here

public class SearchStrategyTest {
 
  @Test(expected=IllegalStateException.class)
  public void whenANullModule_IsAdded_throwException(){
    SolutionSelector select = mock(SolutionSelector.class);
    SolutionAcceptor accept = mock(SolutionAcceptor.class);
    SolutionCostCalculator calc = mock(SolutionCostCalculator.class);
   
    SearchStrategy strat = new SearchStrategy(select, accept, calc);
    strat.addModule(null);
   
View Full Code Here

  }
 
  @Test
  public void whenStratRunsWithOneModule_runItOnes(){
    SolutionSelector select = mock(SolutionSelector.class);
    SolutionAcceptor accept = mock(SolutionAcceptor.class);
    SolutionCostCalculator calc = mock(SolutionCostCalculator.class);
   
    final VehicleRoutingProblem vrp = mock(VehicleRoutingProblem.class);
    final VehicleRoutingProblemSolution newSol = mock(VehicleRoutingProblemSolution.class);
   
View Full Code Here

  }
 
  @Test
  public void whenStratRunsWithTwoModule_runItTwice(){
    SolutionSelector select = mock(SolutionSelector.class);
    SolutionAcceptor accept = mock(SolutionAcceptor.class);
    SolutionCostCalculator calc = mock(SolutionCostCalculator.class);
   
    final VehicleRoutingProblem vrp = mock(VehicleRoutingProblem.class);
    final VehicleRoutingProblemSolution newSol = mock(VehicleRoutingProblemSolution.class);
   
View Full Code Here

  }
 
  @Test
  public void whenStratRunsWithNModule_runItNTimes(){
    SolutionSelector select = mock(SolutionSelector.class);
    SolutionAcceptor accept = mock(SolutionAcceptor.class);
    SolutionCostCalculator calc = mock(SolutionCostCalculator.class);
   
    final VehicleRoutingProblem vrp = mock(VehicleRoutingProblem.class);
    final VehicleRoutingProblemSolution newSol = mock(VehicleRoutingProblemSolution.class);
   
View Full Code Here

  }
 
  @Test(expected=IllegalStateException.class)
  public void whenSelectorDeliversNullSolution_throwException(){
    SolutionSelector select = mock(SolutionSelector.class);
    SolutionAcceptor accept = mock(SolutionAcceptor.class);
    SolutionCostCalculator calc = mock(SolutionCostCalculator.class);
   
    final VehicleRoutingProblem vrp = mock(VehicleRoutingProblem.class);
   
    when(select.selectSolution(null)).thenReturn(null);
View Full Code Here

TOP

Related Classes of jsprit.core.algorithm.acceptor.SolutionAcceptor

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.