Examples of TimeWindow


Examples of rinde.sim.util.TimeWindow

    @Override
    public VanLon14Scenario create(List<TimedEvent> events,
        ScenarioGenerator<VanLon14Scenario> generator, int instanceNumber) {

      final TimeWindow tw = new TimeWindow(0, generator.getScenarioLength());
      final Point min = generator.getMinPoint();
      final Point max = generator.getMaxPoint();
      final long tickSize = generator.getTickSize();
      return new VanLon14Scenario(events, tw, min, max, tickSize, pc,
          instanceNumber);
View Full Code Here

Examples of rinde.sim.util.TimeWindow

  @Test
  public void convertTWtest() {
    final UnitConverter timeConverter = MILLI(SECOND).getConverterTo(SECOND);

    final int[] tw1 = convertTW(new TimeWindow(300, 800), 5, timeConverter);
    assertEquals(0, tw1[0]);
    assertEquals(1, tw1[1]);

    final int[] tw2 = convertTW(new TimeWindow(7300, 8800), 0, timeConverter);
    assertEquals(8, tw2[0]);
    assertEquals(8, tw2[1]);

    final int[] tw3 = convertTW(new TimeWindow(7300, 8800), 7300, timeConverter);
    assertEquals(0, tw3[0]);
    assertEquals(1, tw3[1]);
  }
View Full Code Here

Examples of rinde.sim.util.TimeWindow

    sim.register(new PDPRoadModel(new PlaneRoadModel(new Point(0, 0),
        new Point(10, 10), 50), false));
    sim.configure();

    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);
    sim.register(dp1);
View Full Code Here

Examples of rinde.sim.util.TimeWindow

    final String[] firstLine = ordersFileReader.readLine().split(";");
    final int numVehicles = Integer.parseInt(firstLine[0]);
    final int capacity = Integer.parseInt(firstLine[1]);
    final long startTime = Long.parseLong(firstLine[2]);
    final long endTime = Long.parseLong(firstLine[3]);
    final TimeWindow timeWindow = new TimeWindow(startTime, endTime);

    sb.addEvent(new TimedEvent(PDPScenarioEvent.TIME_OUT, endTime));

    // for (int i = 0; i < numVehicles; i++) {
    // sb.addEvent(new AddVehicleEvent(0, new VehicleDTO(coordinates.get(0),
    // 1.0, capacity, timeWindow)));
    // }
    final VehicleDTO defaultVehicle = new VehicleDTO(coordinates.get(0), 1.0,
        capacity, timeWindow);

    // Nr. des Pickup-Orts; Nr. des Delivery-Orts; untere Zeitfenstergrenze
    // Pickup; obere Zeitfenstergrenze Pickup; untere Zeitfenstergrenze
    // Delivery; obere Zeitfenstergrenze Delivery; benötigte Kapazität;
    // Anrufzeit; Servicezeit Pickup; Servicezeit Delivery
    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]));

      sb.addEvent(new AddParcelEvent(o));
    }
View Full Code Here

Examples of rinde.sim.util.TimeWindow

      }
      final String xy = reader.nextString();
      final String[] parts = xy.split(",");
      final long x = Long.parseLong(parts[0]);
      final long y = Long.parseLong(parts[1]);
      return new TimeWindow(x, y);
    }
View Full Code Here

Examples of rinde.sim.util.TimeWindow

    // System.out.println(deliverLeft);
    // }

    // System.out.println(pickRight - pickLeft);
    return ImmutableList
        .of(new TimeWindow(pickLeft, pickRight), new TimeWindow(deliverLeft,
            deliverRight));
  }
View Full Code Here

Examples of rinde.sim.util.TimeWindow

    // System.out.println(deliverRemainingTime);
    // System.out.println(deliverLeft);
    // }

    return ImmutableList
        .of(new TimeWindow(pickLeft, pickRight), new TimeWindow(deliverLeft,
            deliverRight));
  }
View Full Code Here

Examples of rinde.sim.util.TimeWindow

  static class LoadPart {
    private final double load;
    private final TimeWindow tw;

    LoadPart(long st, long end, double value) {
      tw = new TimeWindow(st, end);
      load = value;
    }
View Full Code Here

Examples of rinde.sim.util.TimeWindow

      }
      final String xy = reader.nextString();
      final String[] parts = xy.split(",");
      final long x = Long.parseLong(parts[0]);
      final long y = Long.parseLong(parts[1]);
      return new TimeWindow(x, y);
    }
View Full Code Here

Examples of rinde.sim.util.TimeWindow

          scenarioLength > maxRequiredTime,
          "The scenario length must be long enough such that there is enough time for a vehicle to service a pickup at one end of the environment and to service a delivery at an opposite end of the environment and be back in time at the depot.");

      final VehicleDTO vehicleDto = new VehicleDTO(depotLocation,
          vehicleSpeed,
          VEHICLE_CAPACITY, new TimeWindow(0, scenarioLength));

      if (arrivalTimesGenerator == null) {
        arrivalTimesGenerator = new PoissonProcessArrivalTimes(
            latestOrderAnnounceTime,
            globalAnnouncementIntensity, ordersPerAnnouncement);
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.