Package rinde.sim.core.model.road

Examples of rinde.sim.core.model.road.RoadModel.moveTo()


      // RoadModel, we cannot go to curr anymore.
      if (!inCargo && !rm.containsObject(curr.get())) {
        curr = Optional.absent();
      } else if (inCargo) {
        // if it is in cargo, go to its destination
        rm.moveTo(this, curr.get().getDestination(), time);
        if (rm.getPosition(this).equals(curr.get().getDestination())) {
          // deliver when we arrive
          pm.deliver(this, curr.get(), time);
        }
      } else {
View Full Code Here


          // deliver when we arrive
          pm.deliver(this, curr.get(), time);
        }
      } else {
        // it is still available, go there as fast as possible
        rm.moveTo(this, curr.get(), time);
        if (rm.equalPosition(this, curr.get())) {
          // pickup customer
          pm.pickup(this, curr.get(), time);
        }
      }
View Full Code Here

                && pm.getParcelState(((DefaultParcel) input)) == ParcelState.AVAILABLE;
          }
        });

    if (closest != null) {
      rm.moveTo(this, closest, time);
      if (rm.equalPosition(closest, this)
          && pm
              .getTimeWindowPolicy()
              .canPickup(closest.getPickupTimeWindow(), time.getTime(),
                  closest.getPickupDuration())) {
View Full Code Here

    if (delivery != null) {
      if (delivery.getDestination().equals(getPosition())
          && pm.getVehicleState(this) == VehicleState.IDLE) {
        pm.deliver(this, delivery, time);
      } else {
        rm.moveTo(this, delivery.getDestination(), time);
      }
      return;
    }

    // Otherwise, Check if we can pickup nearby
View Full Code Here

        if (newSize <= getCapacity()) {
          pm.pickup(this, closest, time);
        }
      } else {
        rm.moveTo(this, rm.getPosition(closest), time);
      }
      return;
    }

    if (rm.getObjectsOfType(Parcel.class).isEmpty()) {
View Full Code Here

      }
      return;
    }

    if (rm.getObjectsOfType(Parcel.class).isEmpty()) {
      rm.moveTo(this, dto.startPosition, time);
      return;
    }

    // If none of the above, let the gradient field guide us!
    @Nullable
View Full Code Here

    // If none of the above, let the gradient field guide us!
    @Nullable
    final Point p = gradientModel.getTargetFor(this);
    if (p != null) {
      rm.moveTo(this, p, time);
    }
  }

  @Nullable
  public Parcel getDelivery(TimeLapse time, int distance) {
View Full Code Here

                && pm.getParcelState(((DefaultParcel) input)) == ParcelState.AVAILABLE;
          }
        });

    if (closest != null) {
      rm.moveTo(this, closest, time);
      if (rm.equalPosition(closest, this)
          && pm.getTimeWindowPolicy().canPickup(closest.getPickupTimeWindow(),
              time.getTime(), closest.getPickupDuration())) {
        pm.pickup(this, closest, time);
      }
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.