Package rinde.sim.core.model.pdp

Examples of rinde.sim.core.model.pdp.Parcel


  }

  @Test(expected = IllegalArgumentException.class)
  public void addPackageInFail3() {
    final Depot d = new TestDepot(10);
    final Parcel p1 = new TestParcel(new Point(0, 0), 0, 0, 1);
    model.register(p1);
    model.addParcelIn(d, p1);
  }
View Full Code Here


  }

  @Test(expected = IllegalArgumentException.class)
  public void addPackageInFail4() {
    final Depot d = new TestDepot(10);
    final Parcel p1 = new TestParcel(new Point(0, 0), 0, 0, 1);
    model.register(p1);
    model.register(d);
    model.addParcelIn(d, p1);
  }
View Full Code Here

  }

  @Test(expected = IllegalArgumentException.class)
  public void addPackageInFail5() {
    final Depot d = new TestDepot(10);
    final Parcel p1 = new TestParcel(new Point(0, 0), 0, 0, 11);
    model.register(p1);
    model.register(d);
    rm.addObjectAt(d, new Point(0, 0));
    model.addParcelIn(d, p1);
  }
View Full Code Here

  /**
   * Cannot register the same parcel twice.
   */
  @Test(expected = IllegalArgumentException.class)
  public void registerFail1() {
    final Parcel p = new TestParcel(new Point(0, 0), 0, 0, 1.0);
    model.register(p);
    model.register(p);
  }
View Full Code Here

        if (!pdpModel.getContents(vehicle).isEmpty()) {
          parcels.addAll(pdpModel.getContents(vehicle));
        }

        double dist = Double.POSITIVE_INFINITY;
        Parcel closest = null;
        for (final Parcel p : parcels) {
          final Point pos = pdpModel.containerContains(vehicle, p) ? p
              .getDestination() : roadModel.getPosition(p);
          final double d = Point.distance(roadModel.getPosition(vehicle), pos);
          if (d < dist) {
View Full Code Here

TOP

Related Classes of rinde.sim.core.model.pdp.Parcel

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.