Package jsprit.core.algorithm.recreate.listener

Examples of jsprit.core.algorithm.recreate.listener.InsertionListeners


    this.random = random;
  }
 
  public BestInsertion(JobInsertionCostsCalculator jobInsertionCalculator, VehicleRoutingProblem vehicleRoutingProblem) {
    super();
    this.insertionsListeners = new InsertionListeners();
    inserter = new Inserter(insertionsListeners, vehicleRoutingProblem);
    bestInsertionCostCalculator = jobInsertionCalculator;
    logger.info("initialise " + this);
  }
View Full Code Here


    this.random = random;
  }
 
  public BestInsertionConcurrent(JobInsertionCostsCalculator jobInsertionCalculator, ExecutorService executorService, int nuOfBatches, VehicleRoutingProblem vehicleRoutingProblem) {
    super();
    this.insertionsListeners = new InsertionListeners();
    this.nuOfBatches = nuOfBatches;
    inserter = new Inserter(insertionsListeners, vehicleRoutingProblem);
    bestInsertionCostCalculator = jobInsertionCalculator;
    completionService = new ExecutorCompletionService<Insertion>(executorService);
    logger.info("initialise " + this);
View Full Code Here

        final VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().addJob(delivery).addJob(pickup).addVehicle(vehicle).build();

        VehicleRoute route = VehicleRoute.emptyRoute();
    route.setVehicleAndDepartureTime(vehicle, 0.0);
   
    Inserter inserter = new Inserter(new InsertionListeners(), vrp);
        inserter.insertJob(delivery, new InsertionData(0,0,0,vehicle,null), route);

        JobActivityFactory activityFactory = new JobActivityFactory() {
            @Override
            public List<AbstractActivity> createActivities(Job job) {
View Full Code Here

  public void whenCalculatingInsertionIntoExistingRoute_itShouldReturnCorrectCosts(){
    Shipment shipment = Shipment.Builder.newInstance("s").addSizeDimension(0, 1).setPickupLocationId("0,10").setDeliveryLocationId("10,0").build();
    Shipment shipment2 = Shipment.Builder.newInstance("s2").addSizeDimension(0, 1).setPickupLocationId("10,10").setDeliveryLocationId("0,0").build();
    VehicleRoute route = VehicleRoute.emptyRoute();
    when(vehicleRoutingProblem.copyAndGetActivities(shipment)).thenReturn(getTourActivities(shipment));
        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));
View Full Code Here

  public void whenInsertingShipmentInRouteWithNotEnoughCapacity_itShouldReturnNoInsertion(){
    Shipment shipment = Shipment.Builder.newInstance("s").addSizeDimension(0, 1).setPickupLocationId("0,10").setDeliveryLocationId("10,0").build();
    Shipment shipment2 = Shipment.Builder.newInstance("s2").addSizeDimension(0, 1).setPickupLocationId("10,10").setDeliveryLocationId("0,0").build();
    VehicleRoute route = VehicleRoute.emptyRoute();
        when(vehicleRoutingProblem.copyAndGetActivities(shipment)).thenReturn(getTourActivities(shipment));
    new Inserter(new InsertionListeners(), vehicleRoutingProblem).insertJob(shipment, new InsertionData(0,0,0,vehicle,null), route);
    createInsertionCalculator(new HardRouteConstraint() {
     
      @Override
      public boolean fulfilled(JobInsertionContext insertionContext) {
        return false;
View Full Code Here

    Shipment shipment3 = Shipment.Builder.newInstance("s3").addSizeDimension(0, 1).setPickupLocationId("0,0").setDeliveryLocationId("9,10").build();
   
    VehicleRoute route = VehicleRoute.emptyRoute();
        when(vehicleRoutingProblem.copyAndGetActivities(shipment)).thenReturn(getTourActivities(shipment));
        when(vehicleRoutingProblem.copyAndGetActivities(shipment2)).thenReturn(getTourActivities(shipment2));
    Inserter inserter = new Inserter(new InsertionListeners(),vehicleRoutingProblem );
    inserter.insertJob(shipment, new InsertionData(0,0,0,vehicle,null), route);
    inserter.insertJob(shipment2, new InsertionData(0,1,2,vehicle,null),route);

        JobActivityFactory activityFactory = mock(JobActivityFactory.class);
        List<AbstractActivity> activities = new ArrayList<AbstractActivity>();
View Full Code Here

    Shipment shipment2 = Shipment.Builder.newInstance("s2").addSizeDimension(0, 1).setPickupLocationId("10,10").setDeliveryLocationId("0,0").build();
    Shipment shipment3 = Shipment.Builder.newInstance("s3").addSizeDimension(0, 1).setPickupLocationId("0,0").setDeliveryLocationId("9,9").build();
        when(vehicleRoutingProblem.copyAndGetActivities(shipment)).thenReturn(getTourActivities(shipment));
        when(vehicleRoutingProblem.copyAndGetActivities(shipment2)).thenReturn(getTourActivities(shipment2));
    VehicleRoute route = VehicleRoute.emptyRoute();
    Inserter inserter = new Inserter(new InsertionListeners(), vehicleRoutingProblem);
    inserter.insertJob(shipment, new InsertionData(0,0,0,vehicle,null), route);
    inserter.insertJob(shipment2, new InsertionData(0,1,2,vehicle,null),route);

        JobActivityFactory activityFactory = mock(JobActivityFactory.class);
        List<AbstractActivity> activities = new ArrayList<AbstractActivity>();
View Full Code Here

        VehicleRoutingProblem vrp = vrpBuilder.addJob(shipment).addJob(shipment2).addJob(shipment3).build();

        VehicleRoute route = VehicleRoute.emptyRoute();
    route.setVehicleAndDepartureTime(vehicle, 0.0);
   
    Inserter inserter = new Inserter(new InsertionListeners(), vrp);
    inserter.insertJob(shipment, new InsertionData(0,0,0,vehicle,null), route);
    inserter.insertJob(shipment2, new InsertionData(0,1,2,vehicle,null), route);

        StateManager stateManager = new StateManager(vrp);
    stateManager.updateLoadStates();   
View Full Code Here

        VehicleRoutingProblem vrp = vrpBuilder.addJob(shipment).addJob(shipment2).build();

        VehicleRoute route = VehicleRoute.emptyRoute();
    route.setVehicleAndDepartureTime(vehicle, 0.0);

    Inserter inserter = new Inserter(new InsertionListeners(), vrp);
   
    inserter.insertJob(shipment, new InsertionData(0,0,0,vehicle,null), route);
    inserter.insertJob(shipment2, new InsertionData(0,1,2,vehicle,null), route);

    StateManager stateManager = new StateManager(vrp);
View Full Code Here

TOP

Related Classes of jsprit.core.algorithm.recreate.listener.InsertionListeners

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.