Package jsprit.core.problem.cost

Examples of jsprit.core.problem.cost.VehicleRoutingActivityCosts


 
  @Test
  public void whenSettingActivityCosts_vrpShouldContainIt(){
    VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
    builder.setActivityCosts(new VehicleRoutingActivityCosts(){

      @Override
      public double getActivityCost(TourActivity tourAct,double arrivalTime, Driver driver, Vehicle vehicle) {
        return 4.0;
      }
View Full Code Here


        VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();

        routingCosts = CostFactory.createEuclideanCosts();
        vrpBuilder.setRoutingCost(routingCosts);

        activityCosts = new VehicleRoutingActivityCosts() {

            @Override
            public double getActivityCost(TourActivity tourAct, double arrivalTime, Driver driver, Vehicle vehicle) {
                return Math.max(0.,arrivalTime - tourAct.getTheoreticalLatestOperationStartTime());
            }
View Full Code Here

   
    ConstraintManager cManager = new ConstraintManager(vrp,states);
    cManager.addLoadConstraint();
    cManager.addTimeWindowConstraint();
   
    VehicleRoutingActivityCosts actCosts = mock(VehicleRoutingActivityCosts.class);
   
    serviceInsertion = new ServiceInsertionCalculator(costs, new LocalActivityInsertionCostsCalculator(costs, actCosts), cManager);
    serviceInsertion.setJobActivityFactory(new JobActivityFactory() {
            @Override
            public List<AbstractActivity> createActivities(Job job) {
View Full Code Here

    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    vrpBuilder.setActivityCosts(new VehicleRoutingActivityCosts(){

      @Override
      public double getActivityCost(TourActivity tourAct, double arrivalTime, Driver driver, Vehicle vehicle) {
        double waiting = Math.max(0, tourAct.getTheoreticalEarliestOperationStartTime() - arrivalTime)*1;
        double late = Math.max(0, arrivalTime - tourAct.getTheoreticalLatestOperationStartTime())*100;
 
View Full Code Here

    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    vrpBuilder.setActivityCosts(new VehicleRoutingActivityCosts(){

      @Override
      public double getActivityCost(TourActivity tourAct, double arrivalTime, Driver driver, Vehicle vehicle) {
        double waiting = Math.max(0, tourAct.getTheoreticalEarliestOperationStartTime() - arrivalTime)*1;
        double late = Math.max(0, arrivalTime - tourAct.getTheoreticalLatestOperationStartTime())*100;
 
View Full Code Here

    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    vrpBuilder.setActivityCosts(new VehicleRoutingActivityCosts(){

      @Override
      public double getActivityCost(TourActivity tourAct, double arrivalTime, Driver driver, Vehicle vehicle) {
        double waiting = Math.max(0, tourAct.getTheoreticalEarliestOperationStartTime() - arrivalTime)*1;
        double late = Math.max(0, arrivalTime - tourAct.getTheoreticalLatestOperationStartTime())*100;
 
View Full Code Here

    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    vrpBuilder.setActivityCosts(new VehicleRoutingActivityCosts(){

      @Override
      public double getActivityCost(TourActivity tourAct, double arrivalTime, Driver driver, Vehicle vehicle) {
        double waiting = Math.max(0, tourAct.getTheoreticalEarliestOperationStartTime() - arrivalTime)*1;
        double late = Math.max(0, arrivalTime - tourAct.getTheoreticalLatestOperationStartTime())*100;
 
View Full Code Here

   
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    vrpBuilder.setActivityCosts(new VehicleRoutingActivityCosts(){

      @Override
      public double getActivityCost(TourActivity tourAct, double arrivalTime, Driver driver, Vehicle vehicle) {
        double waiting = Math.max(0, tourAct.getTheoreticalEarliestOperationStartTime() - arrivalTime)*1;
        double late = Math.max(0, arrivalTime - tourAct.getTheoreticalLatestOperationStartTime())*100;
 
View Full Code Here

   
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
    vrpBuilder.setActivityCosts(new VehicleRoutingActivityCosts(){

      @Override
      public double getActivityCost(TourActivity tourAct, double arrivalTime, Driver driver, Vehicle vehicle) {
        double waiting = Math.max(0, tourAct.getTheoreticalEarliestOperationStartTime() - arrivalTime)*1;
        double late = Math.max(0, arrivalTime - tourAct.getTheoreticalLatestOperationStartTime())*100;
 
View Full Code Here

    @Before
    public void doBefore(){
        routingCosts = CostFactory.createEuclideanCosts();

        activityCosts = new VehicleRoutingActivityCosts() {

            @Override
            public double getActivityCost(TourActivity tourAct, double arrivalTime, Driver driver, Vehicle vehicle) {
                return Math.max(0.,arrivalTime - tourAct.getTheoreticalLatestOperationStartTime());
            }
View Full Code Here

TOP

Related Classes of jsprit.core.problem.cost.VehicleRoutingActivityCosts

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.