Package jsprit.core.problem

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


  @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

 
  @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

            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

 
  @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

 
  @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

            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

            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

            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(4),route);
        assertEquals(0,cap.get(0));
    }
View Full Code Here

            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(5),route);
        assertEquals(10,cap.get(0));
    }
View Full Code Here

TOP

Related Classes of jsprit.core.problem.Capacity

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.