Package jsprit.core.problem.solution.route.activity

Examples of jsprit.core.problem.solution.route.activity.TourActivity$JobActivity


        //getting the indices created in vrpBuilder
        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        VehicleRoutingProblem vrp = vrpBuilder.addVehicle(vehicle).addVehicle(vehicle2).build();

        TourActivity act = mock(TourActivity.class);
        when(act.getIndex()).thenReturn(1);
        StateManager stateManager = new StateManager(vrp);
        StateId id = stateManager.createStateId("vehicleParam");
        double distanceParam = vehicle.getType().getVehicleCostParams().perDistanceUnit;
        stateManager.putActivityState(act, vehicle, id, distanceParam);
        stateManager.putActivityState(act, vehicle2, id, vehicle2.getType().getVehicleCostParams().perDistanceUnit);
View Full Code Here


        //getting the indices created in vrpBuilder
        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        VehicleRoutingProblem vrp = vrpBuilder.addVehicle(vehicle).addVehicle(vehicle2).build();

        TourActivity act = mock(TourActivity.class);
        when(act.getIndex()).thenReturn(1);
        StateManager stateManager = new StateManager(vrp);
        StateId id = stateManager.createStateId("vehicleParam");
        double distanceParam = vehicle.getType().getVehicleCostParams().perDistanceUnit;
        stateManager.putActivityState(act, vehicle, id, distanceParam);
        stateManager.putActivityState(act, vehicle2, id, vehicle2.getType().getVehicleCostParams().perDistanceUnit);
View Full Code Here

    when(routingCosts.getTransportTime("k", "j", 0.0, null, vehicle)).thenReturn(0.0);
  }
 
  @Test
  public void whenRouteIsClosed_itCalculatesCostUpToEnd_v1(){
    TourActivity prevAct = mock(TourActivity.class);
    when(prevAct.getLocationId()).thenReturn("i");
    TourActivity nextAct = mock(TourActivity.class);
    when(nextAct.getLocationId()).thenReturn("j");
    TourActivity newAct = mock(TourActivity.class);
    when(newAct.getLocationId()).thenReturn("k");
   
    when(vehicle.isReturnToDepot()).thenReturn(true);
   
    AuxilliaryCostCalculator aCalc = new AuxilliaryCostCalculator(routingCosts, actCosts);
    double costs = aCalc.costOfPath(Arrays.asList(prevAct,newAct,nextAct), 0.0, null, vehicle);
View Full Code Here

    assertEquals(6.0,costs,0.01);
  }
 
  @Test
  public void whenRouteIsClosed_itCalculatesCostUpToEnd_v2(){
    TourActivity prevAct = mock(TourActivity.class);
    when(prevAct.getLocationId()).thenReturn("i");
    End nextAct = End.newInstance("j", 0.0, 0.0);
    TourActivity newAct = mock(TourActivity.class);
    when(newAct.getLocationId()).thenReturn("k");
   
    when(vehicle.isReturnToDepot()).thenReturn(true);
   
    AuxilliaryCostCalculator aCalc = new AuxilliaryCostCalculator(routingCosts, actCosts);
    double costs = aCalc.costOfPath(Arrays.asList(prevAct,newAct,nextAct), 0.0, null, vehicle);
View Full Code Here

    assertEquals(6.0,costs,0.01);
  }
 
  @Test
  public void whenRouteIsOpen_itCalculatesCostUpToEnd_v1(){
    TourActivity prevAct = mock(TourActivity.class);
    when(prevAct.getLocationId()).thenReturn("i");
    TourActivity nextAct = mock(TourActivity.class);
    when(nextAct.getLocationId()).thenReturn("j");
    TourActivity newAct = mock(TourActivity.class);
    when(newAct.getLocationId()).thenReturn("k");
   
    when(vehicle.isReturnToDepot()).thenReturn(false);
   
    AuxilliaryCostCalculator aCalc = new AuxilliaryCostCalculator(routingCosts, actCosts);
    double costs = aCalc.costOfPath(Arrays.asList(prevAct,newAct,nextAct), 0.0, null, vehicle);
View Full Code Here

    assertEquals(6.0,costs,0.01);
  }
 
  @Test
  public void whenRouteIsOpen_itCalculatesCostUpToEnd_v2(){
    TourActivity prevAct = mock(TourActivity.class);
    when(prevAct.getLocationId()).thenReturn("i");
    End nextAct = End.newInstance("j", 0.0, 0.0);
    TourActivity newAct = mock(TourActivity.class);
    when(newAct.getLocationId()).thenReturn("k");
   
    when(vehicle.isReturnToDepot()).thenReturn(false);
   
    AuxilliaryCostCalculator aCalc = new AuxilliaryCostCalculator(routingCosts, actCosts);
    double costs = aCalc.costOfPath(Arrays.asList(prevAct,newAct,nextAct), 0.0, null, vehicle);
View Full Code Here

TOP

Related Classes of jsprit.core.problem.solution.route.activity.TourActivity$JobActivity

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.