Package jsprit.core.problem.job

Examples of jsprit.core.problem.job.Service


    public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt60_itShouldReturnFalse(){

        System.out.println("actualEndTime " + route.getEnd().getArrTime());
        assertEquals(60.,route.getEnd().getArrTime(),0.01);

        Service s4 = Service.Builder.newInstance("s4").setLocationId("40,0").build();
        PickupService serviceAct = new PickupService(s4);

        JobInsertionContext insertionContext = new JobInsertionContext(route,s4,v2,route.getDriver(),0.);

        HardActivityConstraint twConstraint = new VehicleDependentTimeWindowConstraints(stateManager,routingCosts);
View Full Code Here


    public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt50_itShouldReturnFalse(){

        System.out.println("actualEndTime " + route.getEnd().getArrTime());
        assertEquals(60.,route.getEnd().getArrTime(),0.01);

        Service s4 = Service.Builder.newInstance("s4").setLocationId("40,0").build();
        PickupService serviceAct = new PickupService(s4);

        JobInsertionContext insertionContext = new JobInsertionContext(route,s4,v3,route.getDriver(),0.);

        HardActivityConstraint twConstraint = new VehicleDependentTimeWindowConstraints(stateManager,routingCosts);
View Full Code Here

    public void whenJobIsInsertedAlongWithNewVehicleThatNeedsToBeHomeAt10_itShouldReturnFalse(){

        System.out.println("actualEndTime " + route.getEnd().getArrTime());
        assertEquals(60.,route.getEnd().getArrTime(),0.01);

        Service s4 = Service.Builder.newInstance("s4").setLocationId("40,0").build();
        PickupService serviceAct = new PickupService(s4);

        JobInsertionContext insertionContext = new JobInsertionContext(route,s4,v4,route.getDriver(),0.);

        HardActivityConstraint twConstraint = new VehicleDependentTimeWindowConstraints(stateManager,routingCosts);
View Full Code Here

    public void whenJobIsInsertedAlongWithV6BetweenS2AndS3_itShouldReturnFalse(){

        System.out.println("actualEndTime " + route.getEnd().getArrTime());
        assertEquals(60.,route.getEnd().getArrTime(),0.01);

        Service s4 = Service.Builder.newInstance("s4").setLocationId("40,0").build();
        PickupService serviceAct = new PickupService(s4);

        JobInsertionContext insertionContext = new JobInsertionContext(route,s4,v6,route.getDriver(),0.);

        HardActivityConstraint twConstraint = new VehicleDependentTimeWindowConstraints(stateManager,routingCosts);
View Full Code Here

    public void whenJobIsInsertedAlongWithV6BetweenS1AndS2_itShouldReturnFalse(){

        System.out.println("actualEndTime " + route.getEnd().getArrTime());
        assertEquals(60.,route.getEnd().getArrTime(),0.01);

        Service s4 = Service.Builder.newInstance("s4").setLocationId("40,0").build();
        PickupService serviceAct = new PickupService(s4);

        JobInsertionContext insertionContext = new JobInsertionContext(route,s4,v6,route.getDriver(),0.);

        HardActivityConstraint twConstraint = new VehicleDependentTimeWindowConstraints(stateManager,routingCosts);
View Full Code Here

    public void whenJobIsInsertedAlongWithV6AtTheEndOfRoute_itShouldReturnTrue(){

        System.out.println("actualEndTime " + route.getEnd().getArrTime());
        assertEquals(60.,route.getEnd().getArrTime(),0.01);

        Service s4 = Service.Builder.newInstance("s4").setLocationId("40,0").build();
        PickupService serviceAct = new PickupService(s4);

        JobInsertionContext insertionContext = new JobInsertionContext(route,s4,v6,route.getDriver(),0.);

        HardActivityConstraint twConstraint = new VehicleDependentTimeWindowConstraints(stateManager,routingCosts);
View Full Code Here

    @Test
    public void whenJobIsInsertedAlongWithNewVehicleThatCanOnlyStartAt60_itShouldReturnFalse(){
        System.out.println("actualEndTime " + route.getEnd().getArrTime());
        assertEquals(60.,route.getEnd().getArrTime(),0.01);

        Service s4 = Service.Builder.newInstance("s4").setLocationId("40,0").build();
        PickupService serviceAct = new PickupService(s4);

        JobInsertionContext insertionContext = new JobInsertionContext(route,s4,v5,route.getDriver(),60.);

        HardActivityConstraint twConstraint = new VehicleDependentTimeWindowConstraints(stateManager,routingCosts);
View Full Code Here

    double avgCost = 0.0;
    if (i instanceof Service && j instanceof Service) {
      if (i.equals(j)) {
        avgCost = 0.0;
      } else {
        Service s_i = (Service) i;
        Service s_j = (Service) j;
        if(s_i.getCoord() == null || s_j.getCoord() == null) throw new IllegalStateException("cannot calculate euclidean distance. since service coords are missing");
        avgCost = EuclideanDistanceCalculator.calculateDistance(s_i.getCoord(), s_j.getCoord());
      }
    } else {
      throw new UnsupportedOperationException(
          "currently, this class just works with shipments and services.");
    }
View Full Code Here

    double avgCost = 0.0;
    if (i instanceof Service && j instanceof Service) {
      if (i.equals(j)) {
        avgCost = 0.0;
      } else {
        Service s_i = (Service) i;
        Service s_j = (Service) j;
        avgCost = calcDist(s_i, s_j);
      }
    } else {
      throw new UnsupportedOperationException(
          "currently, this class just works services.");
View Full Code Here

        v6 = VehicleImpl.Builder.newInstance("v6").setType(type).setStartLocationId("0,0")
                .setEndLocationId("40,0").setEarliestStart(0.).setLatestArrival(40.).build();

        vrpBuilder.addVehicle(vehicle).addVehicle(v2).addVehicle(v3).addVehicle(v4).addVehicle(v5).addVehicle(v6);

        Service service = Service.Builder.newInstance("s1").setLocationId("10,0").build();
        Service service2 = Service.Builder.newInstance("s2").setLocationId("20,0").build();
        Service service3 = Service.Builder.newInstance("s3").setLocationId("30,0").build();

        vrpBuilder.addJob(service).addJob(service2).addJob(service3);
        final VehicleRoutingProblem vrp = vrpBuilder.build();

        route = VehicleRoute.Builder.newInstance(vehicle).setJobActivityFactory(new JobActivityFactory() {
View Full Code Here

TOP

Related Classes of jsprit.core.problem.job.Service

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.