Package rinde.sim.pdptw.common

Examples of rinde.sim.pdptw.common.AddVehicleEvent


  public void testIO() {
    final ScenarioBuilder sb = new ScenarioBuilder(PDPScenarioEvent.ADD_DEPOT,
        PDPScenarioEvent.ADD_PARCEL, PDPScenarioEvent.ADD_VEHICLE,
        PDPScenarioEvent.TIME_OUT);

    sb.addEvent(new AddVehicleEvent(100, new VehicleDTO(new Point(7, 7), 7d, 2,
        new TimeWindow(0, 1000L))));
    sb.addEvent(new AddDepotEvent(76, new Point(3, 3)));
    sb.addEvent(new AddVehicleEvent(125, new VehicleDTO(new Point(6, 9), 3d, 1,
        new TimeWindow(500, 10000L))));
    sb.addEvent(new AddParcelEvent(ParcelDTO
        .builder(new Point(0, 0), new Point(1, 1))
        .pickupTimeWindow(new TimeWindow(2500, 10000))
        .deliveryTimeWindow(new TimeWindow(5000, 10000))
View Full Code Here


    final Point depotPosition = new Point(2.0, 2.5);
    final double truckSpeed = 30;
    sb.addEvent(new AddDepotEvent(-1, depotPosition));
    for (int i = 0; i < vehicles; i++) {
      sb.addEvent(new AddVehicleEvent(-1, new VehicleDTO(depotPosition,
          truckSpeed, 0, new TimeWindow(0, totalTime))));
    }
    sb.addEvents(parcels.get(online));
    sb.addEvent(new TimedEvent(TIME_OUT, totalTime));
View Full Code Here

  public static FabriRechtScenario fromJson(String json, int numVehicles,
      int vehicleCapacity) {
    final FabriRechtScenario scen = fromJson(json);
    final List<TimedEvent> events = newArrayList();
    for (int i = 0; i < numVehicles; i++) {
      events.add(new AddVehicleEvent(0, new VehicleDTO(
          scen.defaultVehicle.startPosition, scen.defaultVehicle.speed,
          vehicleCapacity, scen.defaultVehicle.availabilityTimeWindow)));
    }
    events.addAll(scen.asList());
    return new FabriRechtScenario(events, scen.getPossibleEventTypes(),
View Full Code Here

  public static FabriRechtScenario fromJson(Reader reader, int numVehicles,
      int vehicleCapacity) {
    final FabriRechtScenario scen = fromJson(reader);
    final List<TimedEvent> events = newArrayList();
    for (int i = 0; i < numVehicles; i++) {
      events.add(new AddVehicleEvent(0, new VehicleDTO(
          scen.defaultVehicle.startPosition, scen.defaultVehicle.speed,
          vehicleCapacity, scen.defaultVehicle.availabilityTimeWindow)));
    }
    events.addAll(scen.asList());
    return new FabriRechtScenario(events, scen.getPossibleEventTypes(),
View Full Code Here

      switch (type) {
      case ADD_DEPOT:
        return new AddDepotEvent(time, (Point) context.deserialize(json
            .getAsJsonObject().get("position"), Point.class));
      case ADD_VEHICLE:
        return new AddVehicleEvent(time, (VehicleDTO) context.deserialize(json
            .getAsJsonObject().get("vehicleDTO"), VehicleDTO.class));
      case ADD_PARCEL:
        return new AddParcelEvent((ParcelDTO) context.deserialize(json
            .getAsJsonObject().get("parcelDTO"), ParcelDTO.class));
      case TIME_OUT:
View Full Code Here

    n = numberOfVehicles;
  }

  public ImmutableList<AddVehicleEvent> generate(RandomGenerator rng) {
    return ImmutableList
        .copyOf(nCopies(n, new AddVehicleEvent(-1, vehicleDto)));
  }
View Full Code Here

    final Point depotPosition = new Point(2.0, 2.5);
    final double truckSpeed = 30;
    events.add(new AddDepotEvent(-1, depotPosition));
    for (int i = 0; i < numVehicles; i++) {
      events.add(new AddVehicleEvent(-1, new VehicleDTO(depotPosition,
          truckSpeed, 0, TimeWindow.ALWAYS)));
    }

    events.addAll(asList(parcelEvents));
View Full Code Here

TOP

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

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.