@Override public Capacity getSize() { return shipment.getSize(); }
public DeliverShipment(Shipment shipment) { super(); this.shipment = shipment; this.capacity = Capacity.invert(shipment.getSize()); }
@Override public boolean fulfilled(JobInsertionContext insertionContext) { Shipment shipment2insert = ((Shipment) insertionContext.getJob()); if (insertionContext.getNewVehicle().getId().equals("wheelchair_bus")) { if (shipment2insert.getSize().get(PASSENGERSEATS_INDEX) > 0) { if (shipment2insert.getPickupLocation().getCoordinate().getX() > 15. || shipment2insert.getDeliveryLocation().getCoordinate().getX() > 15.) { return false; } } } return true; } };
@Override public Capacity getSize() { return shipment.getSize(); }
public DeliverShipment(Shipment shipment) { super(); this.shipment = shipment; this.capacity = Capacity.invert(shipment.getSize()); }
for (int i = 0; i < shipment.getSize().getNuOfDimensions(); i++) { xmlConfig.setProperty(shipmentPathString + "(" + counter + ").capacity-dimensions.dimension(" + i + ")[@index]", i); xmlConfig.setProperty(shipmentPathString + "(" + counter + ").capacity-dimensions.dimension(" + i + ")", shipment.getSize().get(i));
/** * Creates (MATSim) {@link CarrierShipment} from a (jsprit) {@link Shipment} * * @param shipment to be transformed to MATSim * @return CarrierShipment * @see CarrierShipment, Shipment */ static CarrierShipment createCarrierShipment(Shipment shipment) { return CarrierShipment.Builder.newInstance(Id.create(shipment.getId(), CarrierShipment.class), Id.createLinkId(shipment.getPickupLocation().getId()), Id.createLinkId(shipment.getDeliveryLocation().getId()), shipment.getSize().get(0)) .setDeliveryServiceTime(shipment.getDeliveryServiceTime()) .setDeliveryTimeWindow(TimeWindow.newInstance(shipment.getDeliveryTimeWindow().getStart(), shipment.getDeliveryTimeWindow().getEnd())) .setPickupServiceTime(shipment.getPickupServiceTime()) .setPickupTimeWindow(TimeWindow.newInstance(shipment.getPickupTimeWindow().getStart(), shipment.getPickupTimeWindow().getEnd())) .build(); }
for (int i = 0; i < shipment.getSize().getNuOfDimensions(); i++) { xmlConfig.setProperty(shipmentPathString + "(" + counter + ").capacity-dimensions.dimension(" + i + ")[@index]", i); xmlConfig.setProperty(shipmentPathString + "(" + counter + ").capacity-dimensions.dimension(" + i + ")", shipment.getSize().get(i));