Package jsprit.core.algorithm.state

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


   
      VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
      new VrpXMLReader(builder).read("src/test/resources/pd_solomon_r101.xml");
      vrp = builder.build();
     
      final StateManager stateManager = new StateManager(vrp);
     
      ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
      constraintManager.addTimeWindowConstraint();
      constraintManager.addLoadConstraint();
     
      VehicleFleetManager fleetManager = new InfiniteFleetManagerFactory(vrp.getVehicles()).createFleetManager();
     
      BestInsertionBuilder iBuilder = new BestInsertionBuilder(vrp, fleetManager, stateManager, constraintManager);
//      iBuilder.setConstraintManager(constraintManger);
      InsertionStrategy bestInsertion = iBuilder.build();
       
      RuinStrategy radial = new RadialRuinStrategyFactory( 0.15, new AvgServiceDistance(vrp.getTransportCosts())).createStrategy(vrp);
      RuinStrategy random = new RandomRuinStrategyFactory(0.25).createStrategy(vrp);
     
      SolutionCostCalculator solutionCostCalculator = new SolutionCostCalculator() {
       
        @Override
        public double getCosts(VehicleRoutingProblemSolution solution) {
          double costs = 0.0;
          for(VehicleRoute route : solution.getRoutes()){
                        Double cost_of_route = stateManager.getRouteState(route, InternalStates.COSTS, Double.class);
                        if(cost_of_route == null) cost_of_route = 0.;
                        costs += cost_of_route;
          }
          return costs;
        }
View Full Code Here


                .setTimeWindow(TimeWindow.newInstance(40,50)).build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationCoordinate(Coordinate.newInstance(0,0)).build();
        VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().addJob(service).addVehicle(vehicle).build();
        VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(vrp,"src/test/resources/algorithmConfig.xml");
        vraBuilder.addDefaultCostCalculators();
        StateManager stateManager = new StateManager(vrp);
        ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm vra = vraBuilder.build(); //this should ignore any constraints
        vra.setMaxIterations(10);
        Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
View Full Code Here

                .setTimeWindow(TimeWindow.newInstance(40,50)).build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationCoordinate(Coordinate.newInstance(0,0)).build();
        VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().addJob(service).addVehicle(vehicle).build();
        VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(vrp,"src/test/resources/algorithmConfig.xml");
        vraBuilder.addDefaultCostCalculators();
        StateManager stateManager = new StateManager(vrp);
        stateManager.updateTimeWindowStates();
        ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
        constraintManager.addTimeWindowConstraint();
        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm vra = vraBuilder.build(); //this should ignore any constraints
        vra.setMaxIterations(10);
View Full Code Here

                return vrp.copyAndGetActivities(job);
            }

        }).addService(s1).addService(s2).addService(s3).build();

        stateManager = new StateManager(vrp);
        stateManager.addStateUpdater(new UpdateVariableCosts(activityCosts,routingCosts,stateManager));
        stateManager.informInsertionStarts(Arrays.asList(route), Collections.<Job>emptyList());
    }
View Full Code Here

    VehicleRoutingProblem problem = vrpBuilder.build();

        VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(problem,"input/algorithmConfig.xml");
        vraBuilder.addCoreConstraints();
        vraBuilder.addDefaultCostCalculators();
        StateManager stateManager = new StateManager(problem);
        ConstraintManager constraintManager = new ConstraintManager(problem,stateManager);
        constraintManager.addConstraint(new ServiceDeliveriesFirstConstraint(), ConstraintManager.Priority.CRITICAL);
        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm algorithm = vraBuilder.build();
View Full Code Here

    };

    //build the problem
    VehicleRoutingProblem problem = vrpBuilder.build();

    StateManager stateManager = new StateManager(problem);
   
    ConstraintManager constraintManager = new ConstraintManager(problem, stateManager);
    constraintManager.addConstraint(wheelchair_bus_passenger_pickup_constraint);
   
    /*
 
View Full Code Here

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

        StateManager stateManager = new StateManager(skillProblem);
        stateManager.updateSkillStates();

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

        VehicleRoutingAlgorithm vra = vraBuilder.build();
View Full Code Here

     * build the algorithm
     */
        VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(problem,"input/algorithmConfig.xml");
        vraBuilder.addCoreConstraints();
        vraBuilder.addDefaultCostCalculators();
        StateManager stateManager = new StateManager(problem);
        ConstraintManager constraintManager = new ConstraintManager(problem,stateManager);
        constraintManager.addConstraint(new ServiceDeliveriesFirstConstraint(), ConstraintManager.Priority.CRITICAL);
        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm algorithm = vraBuilder.build();
   
View Full Code Here

        VehicleRoutingProblem vrp = vrpBuilder.build();

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

//        StateManager stateManager = new StateManager(vrp.getTransportCosts());  //v1.3.1
        StateManager stateManager = new StateManager(vrp); //head of development - upcoming release (v1.4)

//        StateFactory.StateId distanceStateId = StateFactory.createId("distance"); //v1.3.1
        StateId distanceStateId = stateManager.createStateId("distance"); //head of development - upcoming release (v1.4)
        stateManager.addStateUpdater(new DistanceUpdater(distanceStateId, stateManager, costMatrix));
//        stateManager.updateLoadStates();

        ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
        constraintManager.addConstraint(new DistanceConstraint(120.,distanceStateId,stateManager,costMatrix), ConstraintManager.Priority.CRITICAL);
//        constraintManager.addLoadConstraint();
View Full Code Here

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

        StateManager stateManager = new StateManager(problem);
        ConstraintManager constraintManager = new ConstraintManager(problem,stateManager);
        constraintManager.addConstraint(geoClusterConstraint);

        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm algorithm = vraBuilder.build();
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.