Package jsprit.core.algorithm.state

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


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

        StateManager stateManager = new StateManager(vrp);
        StateId keyPicked = stateManager.createStateId("key-picked");
        StateId keyUsed = stateManager.createStateId("key-used");
        StateId keyDelivered = stateManager.createStateId("key-delivered");
        stateManager.addStateUpdater(new KeyStatusUpdater(stateManager,keyPicked,keyUsed,keyDelivered));

        ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
        constraintManager.addConstraint(new GetUseAndDeliverKeySimpleHardActivityConstraint(stateManager,keyPicked,keyUsed,keyDelivered), ConstraintManager.Priority.CRITICAL);
        constraintManager.addConstraint(new GetUseAndDeliverHardRouteContraint(stateManager,keyPicked,keyUsed,keyDelivered));
View Full Code Here


     * The algorithm can be defined and configured in an xml-file.
     */
        VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(vrp,"input/algorithmConfig_solomon.xml");
        vraBuilder.addCoreConstraints();
        vraBuilder.addDefaultCostCalculators();
        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();
        vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
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

         */
        //map mapping nearest messengers, i.e. for each envelope the direct-delivery-time with the fastest messenger is stored here
        Map<String,Double> nearestMessengers = getNearestMessengers(routingCosts, problemBuilder.getAddedJobs(), problemBuilder.getAddedVehicles());

        //define stateManager to update the required activity-state: "latest-activity-start-time"
        StateManager stateManager = new StateManager(bicycleMessengerProblem);
        //create state
        StateId latest_act_arrival_time_stateId = stateManager.createStateId("latest-act-arrival-time");
        //and make sure you update the activity-state "latest-activity-start-time" the way it is defined above
        stateManager.addStateUpdater(new UpdateLatestActivityStartTimes(latest_act_arrival_time_stateId, stateManager, routingCosts, nearestMessengers));
        stateManager.updateLoadStates();

        ConstraintManager constraintManager = new ConstraintManager(bicycleMessengerProblem,stateManager);
        constraintManager.addLoadConstraint();
        constraintManager.addConstraint(new ThreeTimesLessThanBestDirectRouteConstraint(latest_act_arrival_time_stateId,nearestMessengers,routingCosts,stateManager), ConstraintManager.Priority.CRITICAL);
        constraintManager.addConstraint(new IgnoreMessengerThatCanNeverMeetTimeRequirements(nearestMessengers, routingCosts));
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.