Package rinde.sim.pdptw.common

Examples of rinde.sim.pdptw.common.ParcelDTO


  public void convertDecompositionTest() {
    final VehicleDTO vd1 = new VehicleDTO(
        new Point(5, 5), 30, 0,
        new TimeWindow(100L, 100000L));

    final ParcelDTO a = ParcelDTO.builder(new Point(0, 0), new Point(10, 10))
        .pickupTimeWindow(new TimeWindow(0, 30))
        .deliveryTimeWindow(new TimeWindow(70, 80))
        .pickupDuration(5000L)
        .deliveryDuration(10000L)
        .build();

    final ParcelDTO b = ParcelDTO.builder(new Point(5, 0), new Point(10, 7))
        .pickupTimeWindow(new TimeWindow(0, 30))
        .deliveryTimeWindow(new TimeWindow(70, 80))
        .pickupDuration(5000L)
        .deliveryDuration(10000L)
        .build();

    final ParcelDTO c = ParcelDTO.builder(new Point(3, 0), new Point(6, 7))
        .pickupTimeWindow(new TimeWindow(0, 30))
        .deliveryTimeWindow(new TimeWindow(70, 80))
        .pickupDuration(5000L)
        .deliveryDuration(10000L)
        .build();

    final ParcelDTO d = ParcelDTO.builder(new Point(3, 0), new Point(6, 2))
        .pickupTimeWindow(new TimeWindow(0, 30))
        .deliveryTimeWindow(new TimeWindow(70, 80))
        .pickupDuration(5000L)
        .deliveryDuration(10000L)
        .build();
View Full Code Here


  static final double EPSILON = 0.00001;

  @Test
  public void testLoad1() {
    // distance is 1 km which is traveled in 2 minutes with 30km/h
    final ParcelDTO dto = ParcelDTO.builder(new Point(0, 0), new Point(0, 1))
        .pickupTimeWindow(new TimeWindow(0, 10))
        .deliveryTimeWindow(new TimeWindow(10, 20))
        .neededCapacity(0)
        .arrivalTime(0)
        .serviceDuration(5)
View Full Code Here

  }

  @Test
  public void testLoad2() {
    // distance is 10km which is travelled in 20 minutes with 30km/h
    final ParcelDTO dto = ParcelDTO.builder(new Point(0, 0), new Point(0, 10))
        .pickupTimeWindow(new TimeWindow(15, 15))
        .deliveryTimeWindow(new TimeWindow(15, 15))
        .neededCapacity(0)
        .arrivalTime(0)
        .serviceDuration(5)
View Full Code Here

  }

  @Test
  public void testLoad3() {
    // distance is 3 km which is traveled in 6 minutes with 30km/h
    final ParcelDTO dto = new ParcelDTO(new Point(0, 0), new Point(0, 3),
        new TimeWindow(10, 30), new TimeWindow(50, 75), 0, 0, 5, 5);

    final List<LoadPart> parts = measureLoad(new AddParcelEvent(dto), 30);
    assertEquals(3, parts.size());
View Full Code Here

    assertSame(p1.dto, res.state.vehicles.get(0).destination);
    assertEquals(v1.getServiceState(), v1.getState());
  }

  static DefaultParcel createParcel(Point origin, Point dest) {
    return new DefaultParcel(new ParcelDTO(origin, dest, new TimeWindow(380001,
        380002), new TimeWindow(0, 1000), 0, 0, 3000, 3000));
  }
View Full Code Here

              RoundingMode.HALF_EVEN);

          // when an offline scenario is desired, all times are set to -1
          final long arrTime = online ? requestArrivalTime : -1;

          final ParcelDTO dto = ParcelDTO.builder(new Point(pickupX, pickupY),
              new Point(deliveryX, deliveryY)).
              pickupTimeWindow(new TimeWindow(
                  pickupTimeWindowBegin, pickupTimeWindowEnd))
              .deliveryTimeWindow(new TimeWindow(
                  deliveryTimeWindowBegin, deliveryTimeWindowEnd))
View Full Code Here

      Point vehicleLocation = vso.location;
      final Measure<Double, Velocity> speed = Measure.valueOf(vso.speed,
          state.speedUnit);
      final Set<ParcelDTO> seen = newHashSet();
      for (int j = 0; j < route.size(); j++) {
        final ParcelDTO cur = route.get(j);
        final boolean inCargo = vso.contents.contains(cur)
            || seen.contains(cur);
        seen.add(cur);
        if (vso.destination != null && j == 0) {
          checkArgument(
View Full Code Here

    final Solver solver = SolverValidator.wrap(new FakeSolver(routes));
    solver.solve(state);
  }

  static ParcelDTO parcel() {
    return new ParcelDTO(new Point(0, 0), new Point(0, 0), TimeWindow.ALWAYS,
        TimeWindow.ALWAYS, 0, 0, 0, 0);
  }
View Full Code Here

    } else if (state.availableParcels.size() + inCargo.size() == 1) {
      // if there is only one order, the solution is trivial
      if (!state.availableParcels.isEmpty()) {
        // parcels on the map require two visits (one for pickup, one
        // for delivery)
        final ParcelDTO dto = state.availableParcels.iterator().next();
        return ImmutableList.of(ImmutableList.of(dto, dto));
      } // else
      return ImmutableList.of(ImmutableList.copyOf(inCargo));
    }
    // else, we are going to look for the optimal solution
View Full Code Here

    final RouteFollowingVehicle rfv = new RouteFollowingVehicle(new VehicleDTO(
        new Point(1, 1), 50, 10, new TimeWindow(0, 1000000)), false);
    final Depot depot = new DefaultDepot(new Point(5, 5));

    final DefaultParcel dp1 = new DefaultParcel(new ParcelDTO(new Point(2, 2),
        new Point(3, 3), new TimeWindow(0, 1000), new TimeWindow(0, 1000), 0,
        0L, 5L, 5L));
    final DefaultParcel dp2 = new DefaultParcel(new ParcelDTO(new Point(2, 2),
        new Point(3, 3), new TimeWindow(0, 1000), new TimeWindow(0, 1000), 0,
        0L, 5L, 5L));

    sim.register(depot);
    sim.register(rfv);
View Full Code Here

TOP

Related Classes of rinde.sim.pdptw.common.ParcelDTO

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.