Examples of VehicleType


Examples of jsprit.core.problem.vehicle.VehicleType

 
 
 
  @Test
  public void whenAddingTimeAndDistanceToAsymmetricMatrixUsingStringAsKey_itShouldReturnCorrectCostValues(){
    VehicleType type = VehicleTypeImpl.Builder.newInstance("t").setCostPerDistance(2.).setCostPerTime(1.).build();
    Vehicle vehicle = mock(Vehicle.class);
    when(vehicle.getType()).thenReturn(type);
    VehicleRoutingTransportCostsMatrix.Builder matrixBuilder = VehicleRoutingTransportCostsMatrix.Builder.newInstance(false);
    matrixBuilder.addTransportTime("from", "to", 2.);
    matrixBuilder.addTransportDistance("from", "to", 3.);
View Full Code Here

Examples of jsprit.core.problem.vehicle.VehicleType

    matrixBuilder.addTransportDistance("to", "from", 1.);
    matrixBuilder.addTransportTime("to", "from", 2.);
   
    VehicleRoutingTransportCostsMatrix matrix = matrixBuilder.build();
    Vehicle vehicle = mock(Vehicle.class);
    VehicleType type = VehicleTypeImpl.Builder.newInstance("t").setCostPerDistance(1.).setCostPerTime(0.).build();
    when(vehicle.getType()).thenReturn(type);
    assertEquals(1.,matrix.getDistance("from", "to"),0.1);
    assertEquals(1.,matrix.getDistance("to", "from"),0.1);
    assertEquals(1.,matrix.getTransportCost("from", "to", 0.0, null, vehicle),0.1);
    assertEquals(1.,matrix.getTransportCost("to", "from", 0.0, null, vehicle),0.1);
View Full Code Here

Examples of jsprit.core.problem.vehicle.VehicleType

        };
        Service s1 = Service.Builder.newInstance("s1").setLocationId("10,0").setTimeWindow(TimeWindow.newInstance(10.,10.)).build();
        Service s2 = Service.Builder.newInstance("s2").setLocationId("20,0").setTimeWindow(TimeWindow.newInstance(20.,20.)).build();
        Service s3 = Service.Builder.newInstance("s3").setLocationId("30,0").setTimeWindow(TimeWindow.newInstance(30.,30.)).build();

        VehicleType type = VehicleTypeImpl.Builder.newInstance("type").build();
        Vehicle vehicle = VehicleImpl.Builder.newInstance("vehicle").setStartLocationId("0,0").setType(type).build();

        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
        final VehicleRoutingProblem vrp = vrpBuilder.addJob(s1).addJob(s2).addJob(s3).build();
View Full Code Here

Examples of simulation.VehicleType

      return;
    }

    //Create new vehicle type
    if (currentVehicleType == null) {
      currentVehicleType = new VehicleType(txtName.getText(), Float.parseFloat(txtAcceleration.getText()), Float.parseFloat(txtDeceleration.getText()), Float.parseFloat(txtDriverImperfection.getText()), Integer.parseInt(txtLength.getText()), Integer.parseInt(txtMaximumSpeed.getText()));
    }
    //Modify editing vehicle type
    else {
      currentVehicleType.setName(txtName.getText());
      currentVehicleType.setAcceleration(Float.parseFloat(txtAcceleration.getText()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.