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

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


        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 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

        routeInserter.setJobActivityFactory(new JobActivityFactory() {
            @Override
            public List<AbstractActivity> createActivities(Job job) {
                List<AbstractActivity> acts = activityFactory.createActivities(job);
                if(acts.isEmpty()){
                    acts.add(new PickupService(s4));
                }
                return acts;
            }
        });
        InsertionData iData = routeInserter.getInsertionData(route,s4,route.getVehicle(),route.getDepartureTime(),route.getDriver(),Double.MAX_VALUE);
View Full Code Here

        routeInserter.setJobActivityFactory(new JobActivityFactory() {
            @Override
            public List<AbstractActivity> createActivities(Job job) {
                List<AbstractActivity> acts = activityFactory.createActivities(job);
                if(acts.isEmpty()){
                    acts.add(new PickupService(s4));
                }
                return acts;
            }
        });
        InsertionData iData = routeInserter.getInsertionData(route,s4,route.getVehicle(),route.getDepartureTime(),route.getDriver(),Double.MAX_VALUE);
View Full Code Here

        routeInserter.setJobActivityFactory(new JobActivityFactory() {
            @Override
            public List<AbstractActivity> createActivities(Job job) {
                List<AbstractActivity> acts = activityFactory.createActivities(job);
                if(acts.isEmpty()){
                    acts.add(new PickupService(s4));
                }
                return acts;
            }
        });
        InsertionData iData = routeInserter.getInsertionData(route,s4,route.getVehicle(),route.getDepartureTime(),route.getDriver(),Double.MAX_VALUE);
View Full Code Here

        routeInserter.setJobActivityFactory(new JobActivityFactory() {
            @Override
            public List<AbstractActivity> createActivities(Job job) {
                List<AbstractActivity> acts = activityFactory.createActivities(job);
                if(acts.isEmpty()){
                    acts.add(new PickupService(s4));
                }
                return acts;
            }
        });
        InsertionData iData = routeInserter.getInsertionData(emptyroute,s4,route.getVehicle(),route.getDepartureTime(),route.getDriver(),Double.MAX_VALUE);
View Full Code Here

        routeInserter.setJobActivityFactory(new JobActivityFactory() {
            @Override
            public List<AbstractActivity> createActivities(Job job) {
                List<AbstractActivity> acts = activityFactory.createActivities(job);
                if(acts.isEmpty()){
                    acts.add(new PickupService(s4));
                }
                return acts;
            }
        });
        InsertionData iData = routeInserter.getInsertionData(emptyroute,s4,route.getVehicle(),route.getDepartureTime(),route.getDriver(),Double.MAX_VALUE);
View Full Code Here

    constraint = new PickupAndDeliverShipmentLoadActivityLevelConstraint(stateManager);
  }
 
  @Test
  public void whenPickupActivityIsInsertedAndLoadIsSufficient_returnFullFilled(){
    PickupService pickupService = (PickupService) vrp.getActivities(s1).get(0);
    PickupService anotherService = (PickupService) vrp.getActivities(s2).get(0);
    PickupShipment pickupShipment = (PickupShipment) vrp.getActivities(shipment).get(0);
   
    assertEquals(ConstraintsStatus.FULFILLED,constraint.fulfilled(iFacts, pickupService, pickupShipment, anotherService, 0.0));
  }
View Full Code Here

    assertEquals(ConstraintsStatus.FULFILLED,constraint.fulfilled(iFacts, pickupService, pickupShipment, anotherService, 0.0));
  }
 
  @Test
  public void whenPickupActivityIsInsertedAndLoadIsNotSufficient_returnNOT_FullFilled(){
        PickupService pickupService = (PickupService) vrp.getActivities(s1).get(0);
        PickupService anotherService = (PickupService) vrp.getActivities(s2).get(0);
        PickupShipment pickupShipment = (PickupShipment) vrp.getActivities(shipment).get(0);

        stateManager.putInternalTypedActivityState(pickupService, InternalStates.LOAD, Capacity.Builder.newInstance().addDimension(0, 2).build());
//    when(stateManager.getActivityState(pickupService, StateFactory.LOAD)).thenReturn(StateFactory.createState(2.0));
    assertEquals(ConstraintsStatus.NOT_FULFILLED,constraint.fulfilled(iFacts, pickupService, pickupShipment, anotherService, 0.0));
View Full Code Here

    assertEquals(ConstraintsStatus.NOT_FULFILLED,constraint.fulfilled(iFacts, pickupService, pickupShipment, anotherService, 0.0));
  }

  @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));
View Full Code Here

TOP

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

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.