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

Examples of jsprit.core.problem.solution.route.activity.DeliverShipment


  @Test
  public void whenDeliveryActivityIsInsertedAndLoadIsSufficient_returnFullFilled(){
        PickupService pickupService = (PickupService) vrp.getActivities(s1).get(0);
        PickupService anotherService = (PickupService) vrp.getActivities(s2).get(0);

        DeliverShipment deliverShipment = (DeliverShipment) vrp.getActivities(shipment).get(1);
   
    stateManager.putInternalTypedActivityState(pickupService, InternalStates.LOAD, Capacity.Builder.newInstance().addDimension(0, 1).build());
//    stateManager.putInternalActivityState(pickupService, StateFactory.LOAD, StateFactory.createState(1));
    assertEquals(ConstraintsStatus.FULFILLED,constraint.fulfilled(iFacts, pickupService, deliverShipment, anotherService, 0.0));
  }
View Full Code Here


    Shipment shipment = Shipment.Builder.newInstance("s").addSizeDimension(0, 1).setPickupLocationId("0,10").setDeliveryLocationId("10,0").build();
    VehicleRoute route = VehicleRoute.emptyRoute();
        JobActivityFactory activityFactory = mock(JobActivityFactory.class);
        List<AbstractActivity> activities = new ArrayList<AbstractActivity>();
        activities.add(new PickupShipment(shipment));
        activities.add(new DeliverShipment(shipment));
        when(activityFactory.createActivities(shipment)).thenReturn(activities);
        insertionCalculator.setJobActivityFactory(activityFactory);
    InsertionData iData = insertionCalculator.getInsertionData(route, shipment, vehicle, 0.0, null, Double.MAX_VALUE);
    assertEquals(40.0,iData.getInsertionCost(),0.05);
  }
View Full Code Here

        new Inserter(new InsertionListeners(), vehicleRoutingProblem).insertJob(shipment, new InsertionData(0,0,0,vehicle,null), route);

        JobActivityFactory activityFactory = mock(JobActivityFactory.class);
        List<AbstractActivity> activities = new ArrayList<AbstractActivity>();
        activities.add(new PickupShipment(shipment2));
        activities.add(new DeliverShipment(shipment2));
        when(activityFactory.createActivities(shipment2)).thenReturn(activities);
        insertionCalculator.setJobActivityFactory(activityFactory);

    InsertionData iData = insertionCalculator.getInsertionData(route, shipment2, vehicle, 0.0, null, Double.MAX_VALUE);
    assertEquals(0.0,iData.getInsertionCost(),0.05);
View Full Code Here

  }

    private List<AbstractActivity> getTourActivities(Shipment shipment) {
        List<AbstractActivity> acts = new ArrayList<AbstractActivity>();
        PickupShipment pick = new PickupShipment(shipment);
        DeliverShipment del = new DeliverShipment(shipment);
        acts.add(pick);
        acts.add(del);
        return acts;
    }
View Full Code Here

    });

        JobActivityFactory activityFactory = mock(JobActivityFactory.class);
        List<AbstractActivity> activities = new ArrayList<AbstractActivity>();
        activities.add(new PickupShipment(shipment2));
        activities.add(new DeliverShipment(shipment2));
        when(activityFactory.createActivities(shipment2)).thenReturn(activities);
        insertionCalculator.setJobActivityFactory(activityFactory);

        InsertionData iData = insertionCalculator.getInsertionData(route, shipment2, vehicle, 0.0, null, Double.MAX_VALUE);
    assertEquals(InsertionData.createEmptyInsertionData(),iData);
View Full Code Here

    inserter.insertJob(shipment2, new InsertionData(0,1,2,vehicle,null),route);

        JobActivityFactory activityFactory = mock(JobActivityFactory.class);
        List<AbstractActivity> activities = new ArrayList<AbstractActivity>();
        activities.add(new PickupShipment(shipment3));
        activities.add(new DeliverShipment(shipment3));
        when(activityFactory.createActivities(shipment3)).thenReturn(activities);
        insertionCalculator.setJobActivityFactory(activityFactory);

    InsertionData iData = insertionCalculator.getInsertionData(route, shipment3, vehicle, 0.0, null, Double.MAX_VALUE);
    assertEquals(0.0,iData.getInsertionCost(),0.05);
View Full Code Here

    inserter.insertJob(shipment2, new InsertionData(0,1,2,vehicle,null),route);

        JobActivityFactory activityFactory = mock(JobActivityFactory.class);
        List<AbstractActivity> activities = new ArrayList<AbstractActivity>();
        activities.add(new PickupShipment(shipment3));
        activities.add(new DeliverShipment(shipment3));
        when(activityFactory.createActivities(shipment3)).thenReturn(activities);
        insertionCalculator.setJobActivityFactory(activityFactory);


        InsertionData iData = insertionCalculator.getInsertionData(route, shipment3, vehicle, 0.0, null, Double.MAX_VALUE);
View Full Code Here

  }

    private List<AbstractActivity> getTourActivities(Shipment shipmentToInsert) {
        List<AbstractActivity> acts = new ArrayList<AbstractActivity>();
        acts.add(new PickupShipment(shipmentToInsert));
        acts.add(new DeliverShipment(shipmentToInsert));
        return acts;
    }
View Full Code Here

TOP

Related Classes of jsprit.core.problem.solution.route.activity.DeliverShipment

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.