Examples of VehicleStateObject


Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

        .build();

    final ImmutableList<VehicleStateObject> vehicles = ImmutableList
        .<VehicleStateObject> builder()
        .add(
            new VehicleStateObject(
                vd1,
                new Point(7, 9),
                ImmutableSet.<ParcelDTO> of(a),
                0L,
                null,
                null))
        .add(new VehicleStateObject(
            vd1,
            new Point(3, 2),
            ImmutableSet.<ParcelDTO> of(d),
            0L,
            null,
View Full Code Here

Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

    for (int i = 0; i < expected.size(); i++) {

      final TestVehicle vehicle = expected.get(i);
      final VehicleDTO dto = vehicle.dto;
      final VehicleStateObject vs = states.get(i);

      assertEquals(dto.availabilityTimeWindow, vs.availabilityTimeWindow);
      assertEquals(dto.capacity, vs.capacity);
      assertEquals(dto.speed, vs.speed, 0);
      assertEquals(dto.startPosition, vs.startPosition);
View Full Code Here

Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

    final ImmutableList.Builder<ImmutableList<Long>> arrivalTimesBuilder = ImmutableList
        .builder();

    for (int i = 0; i < state.vehicles.size(); i++) {
      final VehicleStateObject vso = state.vehicles.get(i);
      checkArgument(r.isPresent() || vso.route.isPresent());

      final ImmutableList.Builder<Long> truckArrivalTimesBuilder = ImmutableList
          .builder();
      truckArrivalTimesBuilder.add(state.time);
View Full Code Here

Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

    @Nullable
    ImmutableList<ParcelDTO> r = null;
    if (route != null) {
      r = toDtoList(route);
    }
    return new VehicleStateObject(vehicle.getDTO(), rm.getPosition(vehicle),
        contents.keySet(), remainingServiceTime, destination == null ? null
            : destination.dto, r);
  }
View Full Code Here

Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

  }

  @Test(expected = IllegalArgumentException.class)
  @SuppressWarnings("null")
  public void validateNegativeRemainingTime() {
    final VehicleStateObject vs1 = new VehicleStateObject(vdto(), null, null,
        -1, null, null);
    final GlobalStateObject state = new GlobalStateObject(null,
        ImmutableList.of(vs1), 0, null, null, null);
    SolverValidator.validateInputs(state);
  }
View Full Code Here

Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

  @Test(expected = IllegalArgumentException.class)
  @SuppressWarnings("null")
  public void validateZeroSpeed() {
    final VehicleDTO dto1 = new VehicleDTO(null, 0, 1, null);
    final VehicleStateObject vs1 = new VehicleStateObject(dto1, null, null, 0,
        null, null);
    final GlobalStateObject state = new GlobalStateObject(null,
        ImmutableList.of(vs1), 0, null, null, null);
    SolverValidator.validateInputs(state);
  }
View Full Code Here

Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

  }

  @SuppressWarnings("null")
  @Test(expected = IllegalArgumentException.class)
  public void validateParcelAvailableAndInInventory() {
    final VehicleStateObject vs1 = new VehicleStateObject(vdto(), null,
        ImmutableSet.of(p1), 0, null, null);
    final GlobalStateObject state = new GlobalStateObject(ImmutableSet.of(p1),
        ImmutableList.of(vs1), 0, null, null, null);
    SolverValidator.validateInputs(state);
  }
View Full Code Here

Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

  }

  @SuppressWarnings("null")
  @Test(expected = IllegalArgumentException.class)
  public void validateParcelInTwoInventories() {
    final VehicleStateObject vs1 = new VehicleStateObject(vdto(), null,
        ImmutableSet.of(p1), 0, null, null);
    final VehicleStateObject vs2 = new VehicleStateObject(vdto(), null,
        ImmutableSet.of(p1), 0, null, null);
    final ImmutableSet<ParcelDTO> empty = ImmutableSet.of();
    final GlobalStateObject state = new GlobalStateObject(empty,
        ImmutableList.of(vs1, vs2), 0, null, null, null);
    SolverValidator.validateInputs(state);
View Full Code Here

Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

  @SuppressWarnings("null")
  @Test(expected = IllegalArgumentException.class)
  public void valiateInputsDestinationNotInContents() {
    final ImmutableSet<ParcelDTO> empty = ImmutableSet.of();
    final VehicleStateObject vs1 = new VehicleStateObject(vdto(), null, empty,
        0, p1, null);
    final VehicleStateObject vs2 = new VehicleStateObject(vdto(), null,
        ImmutableSet.of(p2, p1), 0, null, null);

    final GlobalStateObject state = new GlobalStateObject(empty,
        ImmutableList.of(vs1, vs2), 0, null, null, null);
    SolverValidator.validateInputs(state);
View Full Code Here

Examples of rinde.sim.pdptw.central.GlobalStateObject.VehicleStateObject

   * One route is present, one is not.
   */
  @Test(expected = IllegalArgumentException.class)
  public void validateInvalidCurrentRoute1() {
    final Point p = new Point(0, 0);
    final VehicleStateObject vs1 = new VehicleStateObject(vdto(), p,
        ImmutableSet.of(p1), 0, p1, ImmutableList.of(p1));
    final VehicleStateObject vs2 = new VehicleStateObject(vdto(), p,
        ImmutableSet.of(p2), 0, null, null);
    final ImmutableSet<ParcelDTO> available = ImmutableSet.of(p3);
    final GlobalStateObject state = new GlobalStateObject(available,
        ImmutableList.of(vs1, vs2), 0, SI.SECOND, SI.METERS_PER_SECOND,
        SI.METER);
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.