Examples of Capacity


Examples of jsprit.core.problem.Capacity

            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        Capacity cap = analyser.getCapacityViolationAfterActivity(route.getStart(), route);
        assertEquals(25,cap.get(0));
    }
View Full Code Here

Examples of jsprit.core.problem.Capacity

 
  @Test
  public void whenTwoShipmentsHaveBeenAdded_nuOfActivitiesMustEqualFour(){
    Shipment s = mock(Shipment.class);
    Shipment s2 = mock(Shipment.class);
    Capacity capacity = Capacity.Builder.newInstance().build();
    when(s.getSize()).thenReturn(capacity);
    when(s2.getSize()).thenReturn(capacity);
    VehicleRoute.Builder builder = VehicleRoute.Builder.newInstance(mock(Vehicle.class), mock(Driver.class));
    builder.addPickup(s);
    builder.addPickup(s2);
View Full Code Here

Examples of jsprit.core.problem.Capacity

            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        Capacity cap = analyser.getCapacityViolationAfterActivity(route.getActivities().get(0),route);
        assertEquals(35,cap.get(0));
    }
View Full Code Here

Examples of jsprit.core.problem.Capacity

  @Test
  public void whenBuildingClosedRoute_routeEndShouldHaveLocationOfVehicle(){
    Shipment s = mock(Shipment.class);
    Shipment s2 = mock(Shipment.class);
    Capacity capacity = Capacity.Builder.newInstance().build();
    when(s.getSize()).thenReturn(capacity);
    when(s2.getSize()).thenReturn(capacity);
    Vehicle vehicle = mock(Vehicle.class);
    when(vehicle.isReturnToDepot()).thenReturn(true);
    when(vehicle.getStartLocationId()).thenReturn("vehLoc");
View Full Code Here

Examples of jsprit.core.problem.Capacity

 
  @Test
  public void whenBuildingOpenRoute_routeEndShouldHaveLocationOfLastActivity(){
    Shipment s = mock(Shipment.class);
    Shipment s2 = mock(Shipment.class);
    Capacity capacity = Capacity.Builder.newInstance().build();
    when(s.getSize()).thenReturn(capacity);
    when(s2.getSize()).thenReturn(capacity);
    when(s2.getDeliveryLocationId()).thenReturn("delLoc");
    Vehicle vehicle = mock(Vehicle.class);
    when(vehicle.isReturnToDepot()).thenReturn(false);
View Full Code Here

Examples of jsprit.core.problem.Capacity

            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        Capacity cap = analyser.getCapacityViolationAfterActivity(route.getActivities().get(1),route);
        assertEquals(50,cap.get(0));
    }
View Full Code Here

Examples of jsprit.core.problem.Capacity

 
  @Test
  public void whenSettingDepartureTime(){
    Shipment s = mock(Shipment.class);
    Shipment s2 = mock(Shipment.class);
    Capacity capacity = Capacity.Builder.newInstance().build();
    when(s.getSize()).thenReturn(capacity);
    when(s2.getSize()).thenReturn(capacity);
    when(s2.getDeliveryLocationId()).thenReturn("delLoc");
    Vehicle vehicle = mock(Vehicle.class);
    when(vehicle.isReturnToDepot()).thenReturn(false);
View Full Code Here

Examples of jsprit.core.problem.Capacity

 
  @Test
  public void whenSettingEndTime(){
    Shipment s = mock(Shipment.class);
    Shipment s2 = mock(Shipment.class);
    Capacity capacity = Capacity.Builder.newInstance().build();
    when(s.getSize()).thenReturn(capacity);
    when(s2.getSize()).thenReturn(capacity);
    when(s2.getDeliveryLocationId()).thenReturn("delLoc");
    Vehicle vehicle = mock(Vehicle.class);
    when(vehicle.isReturnToDepot()).thenReturn(false);
View Full Code Here

Examples of jsprit.core.problem.Capacity

            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        Capacity cap = analyser.getCapacityViolationAfterActivity(route.getActivities().get(2),route);
        assertEquals(35,cap.get(0));
    }
View Full Code Here

Examples of jsprit.core.problem.Capacity

            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        Capacity cap = analyser.getCapacityViolationAfterActivity(route.getActivities().get(3),route);
        assertEquals(15,cap.get(0));
    }
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.