Package jsprit.core.problem.vehicle

Examples of jsprit.core.problem.vehicle.VehicleImpl$NoVehicle


  public void whenWritingVehicleV2_readingAgainAssignsCorrectType(){
    Builder builder = VehicleRoutingProblem.Builder.newInstance();
   
    VehicleTypeImpl type1 = VehicleTypeImpl.Builder.newInstance("vehType").addCapacityDimension(0, 20).build();
    VehicleTypeImpl type2 = VehicleTypeImpl.Builder.newInstance("vehType2").addCapacityDimension(0, 200).build();
        VehicleImpl v1 = VehicleImpl.Builder.newInstance("v1").setReturnToDepot(false).setStartLocationId("loc").setType(type1).build();
        VehicleImpl v2 = VehicleImpl.Builder.newInstance("v2").setStartLocationId("loc").setType(type2).build();
   
    builder.addVehicle(v1);
    builder.addVehicle(v2);
   
    Service s1 = Service.Builder.newInstance("1").addSizeDimension(0, 1).setLocationId("loc").setServiceTime(2.0).build();
View Full Code Here


  public void whenWritingVehicleV2_readingItsLocationsAgainReturnsCorrectLocations(){
    Builder builder = VehicleRoutingProblem.Builder.newInstance();
   
    VehicleTypeImpl type1 = VehicleTypeImpl.Builder.newInstance("vehType").addCapacityDimension(0, 20).build();
    VehicleTypeImpl type2 = VehicleTypeImpl.Builder.newInstance("vehType2").addCapacityDimension(0, 200).build();
        VehicleImpl v1 = VehicleImpl.Builder.newInstance("v1").setReturnToDepot(false).setStartLocationId("loc").setType(type1).build();
        VehicleImpl v2 = VehicleImpl.Builder.newInstance("v2").setStartLocationId("startLoc").setStartLocationCoordinate(Coordinate.newInstance(1, 2))
        .setEndLocationId("endLoc").setEndLocationCoordinate(Coordinate.newInstance(4, 5)).setType(type2).build();
   
    builder.addVehicle(v1);
    builder.addVehicle(v2);
   
View Full Code Here

  public void whenWritingVehicleV2_readingItsLocationsCoordsAgainReturnsCorrectLocationsCoords(){
    Builder builder = VehicleRoutingProblem.Builder.newInstance();
   
    VehicleTypeImpl type1 = VehicleTypeImpl.Builder.newInstance("vehType").addCapacityDimension(0, 20).build();
    VehicleTypeImpl type2 = VehicleTypeImpl.Builder.newInstance("vehType2").addCapacityDimension(0, 200).build();
        VehicleImpl v1 = VehicleImpl.Builder.newInstance("v1").setReturnToDepot(false).setStartLocationId("loc").setType(type1).build();
        VehicleImpl v2 = VehicleImpl.Builder.newInstance("v2").setStartLocationId("startLoc").setStartLocationCoordinate(Coordinate.newInstance(1, 2))
        .setEndLocationId("endLoc").setEndLocationCoordinate(Coordinate.newInstance(4, 5)).setType(type2).build();
   
    builder.addVehicle(v1);
    builder.addVehicle(v2);
   
View Full Code Here

        .addCapacityDimension(0, 100)
        .addCapacityDimension(1, 1000)
        .addCapacityDimension(2, 10000)
        .build();

        VehicleImpl v2 = VehicleImpl.Builder.newInstance("v").setStartLocationId("startLoc").setStartLocationCoordinate(Coordinate.newInstance(1, 2))
        .setEndLocationId("endLoc").setEndLocationCoordinate(Coordinate.newInstance(4, 5)).setType(type2).build();
    builder.addVehicle(v2);

    VehicleRoutingProblem vrp = builder.build();
    new VrpXMLWriter(vrp, null).write(infileName);
View Full Code Here

    public void itShouldSolveProblemWithIniSolutionExternallyCreated(){

        Service s1 = Service.Builder.newInstance("s1").setCoord(Coordinate.newInstance(10,0)).build();
        Service s2 = Service.Builder.newInstance("s2").setCoord(Coordinate.newInstance(0,10)).build();

        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("v1").setStartLocationCoordinate(Coordinate.newInstance(0,0)).build();

        VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().addJob(s1).addJob(s2).addVehicle(vehicle).build();

        VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "src/test/resources/algorithm_without_construction.xml");

        VehicleImpl vehicle2 = VehicleImpl.Builder.newInstance("v1").setStartLocationCoordinate(Coordinate.newInstance(0,0)).build();
        /*
        create ini sol
         */
        VehicleRoute route1 = VehicleRoute.Builder.newInstance(vehicle).setJobActivityFactory(vrp.getJobActivityFactory()).addService(s1).build();

View Full Code Here

        .addCapacityDimension(0, 100)
        .addCapacityDimension(1, 1000)
        .addCapacityDimension(10, 10000)
        .build();

        VehicleImpl v2 = VehicleImpl.Builder.newInstance("v").setStartLocationId("startLoc").setStartLocationCoordinate(Coordinate.newInstance(1, 2))
        .setEndLocationId("endLoc").setEndLocationCoordinate(Coordinate.newInstance(4, 5)).setType(type2).build();
    builder.addVehicle(v2);

    VehicleRoutingProblem vrp = builder.build();
    new VrpXMLWriter(vrp, null).write(infileName);
View Full Code Here

    @Test
    public void activityTimesShouldIgnoreTimeWindows(){
        Service service = Service.Builder.newInstance("s").setCoord(Coordinate.newInstance(20, 0))
                .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();
        VehicleRoutingAlgorithm vra = vraBuilder.build(); //this should ignore any constraints
        vra.setMaxIterations(10);
View Full Code Here

    @Test
    public void whenNotActivatingViaStateManager_activityTimesShouldConsiderTimeWindows(){
        Service service = Service.Builder.newInstance("s").setCoord(Coordinate.newInstance(20, 0))
                .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);
View Full Code Here

    @Test
    public void activityTimesShouldConsiderTimeWindows(){
        Service service = Service.Builder.newInstance("s").setCoord(Coordinate.newInstance(20, 0))
                .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.addCoreConstraints();
        vraBuilder.addDefaultCostCalculators();
        VehicleRoutingAlgorithm vra = vraBuilder.build(); //this should ignore any constraints
View Full Code Here

    @Test
    public void whenActivatingViaStateManager_activityTimesShouldConsiderTimeWindows(){
        Service service = Service.Builder.newInstance("s").setCoord(Coordinate.newInstance(20, 0))
                .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();
View Full Code Here

TOP

Related Classes of jsprit.core.problem.vehicle.VehicleImpl$NoVehicle

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.