Package rinde.sim.pdptw.common

Examples of rinde.sim.pdptw.common.ParcelDTO


      int[] serviceTimes, int[] vehicleTravelTimes, int remainingServiceTime) {
    final int[] route = new int[vso.route.get().size() + 2];

    final Set<ParcelDTO> seen = newHashSet();
    for (int i = 0; i < vso.route.get().size(); i++) {
      final ParcelDTO dto = vso.route.get().get(i);

      if (vso.contents.contains(dto) || seen.contains(dto)) {
        // it is in cargo
        route[i + 1] = mapping.get(dto).deliveryIndex;
      } else {
View Full Code Here


        .iterator();

    final int[] destinations = new int[v];
    for (int i = 0; i < v; i++) {
      final VehicleStateObject cur = iterator.next();
      final ParcelDTO dest = cur.destination;
      if (dest != null) {
        checkArgument(sva.parcel2index.containsKey(dest));
        final boolean isInCargo = cur.contents.contains(dest);
        final ParcelIndexObj pio = sva.parcel2index.get(dest);
        final int index = isInCargo ? pio.deliveryIndex : pio.pickupIndex;
View Full Code Here

    for (int i = 0; i < v; i++) {
      final VehicleStateObject cur = iterator.next();
      final Measure<Double, Velocity> speed = Measure.valueOf(cur.speed,
          state.speedUnit);

      final ParcelDTO dest = cur.destination;
      if (dest != null) {
        // only add travel time for current dest
        for (int j = 1; j < n; j++) {
          vehicleTravelTimes[i][j] = Integer.MAX_VALUE;
        }
View Full Code Here

    while ((line = ordersFileReader.readLine()) != null) {
      final String[] parts = line.split(";");

      final int neededCapacity = 1; // Integer.parseInt(parts[6]);

      final ParcelDTO o = new ParcelDTO(coordinates.get(Integer
          .parseInt(parts[0])), coordinates.get(Integer.parseInt(parts[1])),
          new TimeWindow(Long.parseLong(parts[2]), Long.parseLong(parts[3])),
          new TimeWindow(Long.parseLong(parts[4]), Long.parseLong(parts[5])),
          neededCapacity, Long.parseLong(parts[7]), Long.parseLong(parts[8]),
          Long.parseLong(parts[9]));
View Full Code Here

  }

  @Test
  public void simpleScenario() throws IOException {
    final Gendreau06Scenario scenario = create(2, minutes(15),
        new AddParcelEvent(new ParcelDTO(new Point(2, 1), new Point(4, 1),
            new TimeWindow(0, 720000), new TimeWindow(5, 720000), 0, 0, 0, 0)));
    final StatisticsDTO dto = runProblem(scenario, useGui);

    // the second truck will turn around just one tick distance before
    // reaching the package. the reason is that it is too late since the
View Full Code Here

   * Checks whether overtime is computed correctly.
   */
  @Test
  public void overtimeScenario() {
    final Gendreau06Scenario scenario = create(1, minutes(6),
        new AddParcelEvent(new ParcelDTO(new Point(2, 1), new Point(4, 1),
            new TimeWindow(0, minutes(12)), new TimeWindow(5, minutes(12)), 0,
            0, 0, 0)));
    final StatisticsDTO dto = runProblem(scenario, useGui);

    assertTrue(dto.simFinish);
View Full Code Here

    return n * 1000;
  }

  static AddParcelEvent parcelEvent(double x1, double y1, double x2, double y2,
      long tw1b, long tw1e, long tw2b, long tw2e) {
    return new AddParcelEvent(new ParcelDTO(new Point(x1, y1),
        new Point(x2, y2), new TimeWindow(tw1b, tw1e), new TimeWindow(tw2b,
            tw2e), 0, 0, 0, 0));
  }
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.