Package jsprit.core.algorithm.state

Examples of jsprit.core.algorithm.state.StateManager$States_


   * <p>If algorithmConfigFile is set, it reads the configuration.
   *
   * @return the algorithm
   */
  public VehicleRoutingAlgorithm build() {
    if(stateManager == null) stateManager = new StateManager(vrp);
    if(constraintManager == null) constraintManager = new ConstraintManager(vrp,stateManager);
    //add core updater
    stateManager.addStateUpdater(new UpdateEndLocationIfRouteIsOpen());
//    stateManager.addStateUpdater(new OpenRouteStateVerifier());

View Full Code Here


                return vrp.copyAndGetActivities(job);
            }

        }).addService(service).addService(service2).addService(service3).build();

        stateManager = new StateManager(vrp);

        Collection<Vehicle> vehicles = new ArrayList<Vehicle>();
        vehicles.add(vehicle);
        vehicles.add(v2);
        vehicles.add(v3);
View Full Code Here

                return vrp.copyAndGetActivities(job);
            }

        }).addService(service).addService(service2).addService(service3).build();

        stateManager = new StateManager(vrp);

        Collection<Vehicle> vehicles = new ArrayList<Vehicle>();
        vehicles.add(vehicle);
        vehicles.add(v2);
        vehicles.add(v3);
View Full Code Here

                return shipmentProblem.copyAndGetActivities(job);
            }
        });
        shipment_route = shipmentRouteBuilder.addPickup(shipment1).addPickup(shipment2).addDelivery(shipment2).addDelivery(shipment1).build();

        stateManager = new StateManager(mock(VehicleRoutingProblem.class));
        stateManager.updateLoadStates();
    }
View Full Code Here

        vrp = VehicleRoutingProblem.Builder.newInstance().addVehicle(vehicle).addVehicle(vehicle2).addJob(service)
                .addJob(service2).addJob(service3).addJob(service4).build();

        route = VehicleRoute.Builder.newInstance(vehicle).setJobActivityFactory(vrp.getJobActivityFactory()).addService(service).addService(service2).build();

        StateManager stateManager = new StateManager(vrp);
        stateManager.updateSkillStates();
        stateManager.informInsertionStarts(Arrays.asList(route),null);

        skillConstraint = new HardSkillConstraint(stateManager);
    }
View Full Code Here

        VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(vrp,"input/algorithmConfig.xml");
        vraBuilder.addCoreConstraints();
        vraBuilder.addDefaultCostCalculators();

        StateManager stateManager = new StateManager(vrp); //1.3.2-SNAPSHOT & upcoming release v1.4
//        StateManager stateManager = new StateManager(vrp.getTransportCosts()); //v1.3.1

        ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
        constraintManager.addConstraint(new NoBananasANDApplesConstraint(stateManager), ConstraintManager.Priority.CRITICAL);
//        constraintManager.addConstraint(new BananasFirst(),ConstraintManager.Priority.CRITICAL);
View Full Code Here

  private static VehicleRoutingAlgorithm buildAlgorithmFromScratch(VehicleRoutingProblem vrp) {
   
    /*
     * manages route and activity states.
     */
    StateManager stateManager = new StateManager(vrp);
    /*
     * tells stateManager to update load states
     */
    stateManager.updateLoadStates();
    /*
     * tells stateManager to update time-window states
     */
    stateManager.updateTimeWindowStates();
    /*
     * stateManager.addStateUpdater(updater);
     * lets you register your own stateUpdater
     */
   
    /*
     * updates variable costs once a vehicleRoute has changed (by removing or adding a customer)
     */
    stateManager.addStateUpdater(new UpdateVariableCosts(vrp.getActivityCosts(), vrp.getTransportCosts(), stateManager));
   
    /*
     * constructs a constraintManager that manages the various hardConstraints (and soon also softConstraints)
     */
    ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
View Full Code Here

        VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(problem,"input/algorithmConfig.xml");
        vraBuilder.addCoreConstraints();
        vraBuilder.addDefaultCostCalculators();

        //activate skill state update and constraints - it is NOT default
        StateManager stateManager = new StateManager(problem);
        stateManager.updateSkillStates();

        ConstraintManager constraintManager = new ConstraintManager(problem,stateManager);
        constraintManager.addSkillsConstraint();

        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
View Full Code Here

        VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(vrp,"input/algorithmConfig_solomon.xml");
        vraBuilder.addDefaultCostCalculators();
        vraBuilder.addCoreConstraints();

        StateManager stateManager = new StateManager(vrp);
        ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
        constraintManager.addConstraint(new ServiceDeliveriesFirstConstraint(), ConstraintManager.Priority.CRITICAL);

        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm vra = vraBuilder.build();
View Full Code Here

            public List<AbstractActivity> createActivities(Job job) {
                return vrp.copyAndGetActivities(job);
            }
        };

    StateManager stateManager = new StateManager(vrp);
    stateManager.updateLoadStates();
   
    ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
    constraintManager.addLoadConstraint();
    stateManager.informInsertionStarts(Arrays.asList(route), null);
   
    JobCalculatorSwitcher switcher = new JobCalculatorSwitcher();
    ServiceInsertionCalculator serviceInsertionCalc = new ServiceInsertionCalculator(routingCosts, activityInsertionCostsCalculator, constraintManager);
        serviceInsertionCalc.setJobActivityFactory(activityFactory);
    ShipmentInsertionCalculator insertionCalculator = new ShipmentInsertionCalculator(routingCosts, activityInsertionCostsCalculator, constraintManager);
View Full Code Here

TOP

Related Classes of jsprit.core.algorithm.state.StateManager$States_

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.