Package rinde.sim.scenario

Examples of rinde.sim.scenario.TimedEvent


        .neededCapacity(0)
        .arrivalTime(2400)
        .pickupDuration(200)
        .deliveryDuration(800)
        .build()));
    sb.addEvent(new TimedEvent(PDPScenarioEvent.TIME_OUT, 200000));

    final VanLon14Scenario s = sb
        .build(new ScenarioCreator<VanLon14Scenario>() {
          @Override
          public VanLon14Scenario create(List<TimedEvent> eventList,
View Full Code Here


    sb.addEvent(new AddVehicleEvent(125, new VehicleDTO(new Point(6, 9), 3d, 1,
        new TimeWindow(500, 10000L))));
    sb.addEvent(new AddParcelEvent(new ParcelDTO(new Point(0, 0), new Point(1,
        1), new TimeWindow(2500, 10000), new TimeWindow(5000, 10000), 0, 2400,
        200, 800)));
    sb.addEvent(new TimedEvent(PDPScenarioEvent.TIME_OUT, 200000));

    final TestScenario s = sb.build(new ScenarioCreator<TestScenario>() {
      @Override
      public TestScenario create(List<TimedEvent> eventList,
          Set<Enum<?>> eventTypes) {
View Full Code Here

  /**
   * Checks for the absence of a creator for AddVehicleEvent.
   */
  @Test(expected = IllegalStateException.class)
  public void noVehicleCreator() {
    final Set<TimedEvent> events = newHashSet(new TimedEvent(
        PDPScenarioEvent.ADD_DEPOT, 10));
    new DynamicPDPTWProblem(new DummyScenario(events), 123).simulate();
  }
View Full Code Here

    new DynamicPDPTWProblem(new DummyScenario(events), 123).simulate();
  }

  @Test
  public void testStopCondition() {
    final Set<TimedEvent> events = newHashSet(new TimedEvent(
        PDPScenarioEvent.ADD_DEPOT, 10));
    final DynamicPDPTWProblem prob = new DynamicPDPTWProblem(new DummyScenario(
        events), 123);
    prob.addCreator(AddVehicleEvent.class, DUMMY_ADD_VEHICLE_EVENT_CREATOR);
View Full Code Here

    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));

    return sb.build(new ScenarioCreator<Gendreau06Scenario>() {
      @Override
      public Gendreau06Scenario create(List<TimedEvent> eventList,
          Set<Enum<?>> eventTypes) {
View Full Code Here

    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)));
    // }
View Full Code Here

            .getAsJsonObject().get("vehicleDTO"), VehicleDTO.class));
      case ADD_PARCEL:
        return new AddParcelEvent((ParcelDTO) context.deserialize(json
            .getAsJsonObject().get("parcelDTO"), ParcelDTO.class));
      case TIME_OUT:
        return new TimedEvent(type, time);
      }
      throw new IllegalStateException();
    }
View Full Code Here

            .getAsJsonObject().get("vehicleDTO"), VehicleDTO.class));
      case ADD_PARCEL:
        return new AddParcelEvent((ParcelDTO) context.deserialize(json
            .getAsJsonObject().get("parcelDTO"), ParcelDTO.class));
      case TIME_OUT:
        return new TimedEvent(type, time);
      }
      throw new IllegalStateException();
    }
View Full Code Here

              .neededCapacity(0)
              .arrivalTime(time)
              .serviceDuration(serviceTime)
              .build()));
    }
    sb.addEvent(new TimedEvent(PDPScenarioEvent.TIME_OUT, length));
    if (scenarioCreator != null) {
      return sb.build(new FactoryWrapper<T>(scenarioCreator, this, num));
    }
    else {
      return (T) sb.build();
View Full Code Here

          truckSpeed, 0, TimeWindow.ALWAYS)));
    }

    events.addAll(asList(parcelEvents));

    events.add(new TimedEvent(PDPScenarioEvent.TIME_OUT, endTime));

    final Set<Enum<?>> eventTypes = new HashSet<Enum<?>>(
        asList(PDPScenarioEvent.values()));
    return new Gendreau06Scenario(events, eventTypes, 1000L,
        GendreauProblemClass.LONG_LOW_FREQ, 1, false);
View Full Code Here

TOP

Related Classes of rinde.sim.scenario.TimedEvent

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.