diff --git a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java index 2ebf3060e2e..6b2d6c10784 100644 --- a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java +++ b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java @@ -1188,8 +1188,8 @@ private static void combineSimilarJobs(Scenario scenario) { if (!shipmentsToRemove.containsKey(thisShipmentId)) { CarrierShipment thisShipment = thisCarrier.getShipments().get(thisShipmentId); if (baseShipment.getId() != thisShipment.getId() - && baseShipment.getFrom() == thisShipment.getFrom() - && baseShipment.getTo() == thisShipment.getTo()) { + && baseShipment.getPickupLinkId() == thisShipment.getPickupLinkId() + && baseShipment.getDeliveryLinkId() == thisShipment.getDeliveryLinkId()) { if (baseShipment.getPickupStartsTimeWindow() == thisShipment.getPickupStartsTimeWindow()) { if (baseShipment.getDeliveryStartsTimeWindow() == thisShipment.getDeliveryStartsTimeWindow()) shipmentsToConnect.put(thisShipmentId, thisShipment); } @@ -1207,7 +1207,7 @@ private static void combineSimilarJobs(Scenario scenario) { shipmentsToRemove.put(carrierShipment.getId(), carrierShipment); } CarrierShipment newShipment = CarrierShipment.Builder - .newInstance(idNewShipment, baseShipment.getFrom(), baseShipment.getTo(), demandForThisLink) + .newInstance(idNewShipment, baseShipment.getPickupLinkId(), baseShipment.getDeliveryLinkId(), demandForThisLink) .setPickupDuration(serviceTimePickup) .setPickupStartsTimeWindow(baseShipment.getPickupStartsTimeWindow()) .setDeliveryDuration(serviceTimeDelivery) @@ -1237,7 +1237,7 @@ private static void combineSimilarJobs(Scenario scenario) { if (!servicesToRemove.containsKey(thisServiceId)) { CarrierService thisService = thisCarrier.getServices().get(thisServiceId); if (baseService.getId() != thisService.getId() - && baseService.getLocationLinkId() == thisService.getLocationLinkId() && baseService + && baseService.getServiceLinkId() == thisService.getServiceLinkId() && baseService .getServiceStartTimeWindow() == thisService.getServiceStartTimeWindow()) servicesToConnect.put(thisServiceId, thisService); } @@ -1251,7 +1251,7 @@ private static void combineSimilarJobs(Scenario scenario) { servicesToRemove.put(carrierService.getId(), carrierService); } CarrierService newService = CarrierService.Builder - .newInstance(idNewService, baseService.getLocationLinkId()) + .newInstance(idNewService, baseService.getServiceLinkId()) .setServiceDuration(serviceTimeService) .setServiceStartTimeWindow(baseService.getServiceStartTimeWindow()) .setDemand(demandForThisLink).build(); diff --git a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGenerationUtils.java b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGenerationUtils.java index ede28ace76d..235789535db 100644 --- a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGenerationUtils.java +++ b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGenerationUtils.java @@ -130,23 +130,23 @@ static void createDemandLocationsFile(Controler controler) { for (Carrier thisCarrier : CarriersUtils.getCarriers(controler.getScenario()).getCarriers().values()) { for (CarrierService thisService : thisCarrier.getServices().values()) { Coord coord = FreightDemandGenerationUtils - .getCoordOfMiddlePointOfLink(network.getLinks().get(thisService.getLocationLinkId())); + .getCoordOfMiddlePointOfLink(network.getLinks().get(thisService.getServiceLinkId())); writer.write(thisCarrier.getId().toString() + thisService.getId().toString() + " " + coord.getX() + " " + coord.getY() + " " + "Service" + " " - + thisService.getLocationLinkId().toString() + " " + "\n"); + + thisService.getServiceLinkId().toString() + " " + "\n"); } for (CarrierShipment thisShipment : thisCarrier.getShipments().values()) { Coord coordFrom = FreightDemandGenerationUtils - .getCoordOfMiddlePointOfLink(network.getLinks().get(thisShipment.getFrom())); + .getCoordOfMiddlePointOfLink(network.getLinks().get(thisShipment.getPickupLinkId())); Coord coordTo = FreightDemandGenerationUtils - .getCoordOfMiddlePointOfLink(network.getLinks().get(thisShipment.getTo())); + .getCoordOfMiddlePointOfLink(network.getLinks().get(thisShipment.getDeliveryLinkId())); writer.write(thisCarrier.getId().toString() + thisShipment.getId().toString() + " " + coordFrom.getX() + " " + coordFrom.getY() + " " + "Pickup" + " " - + thisShipment.getFrom().toString() + " " + thisShipment.getTo().toString() + "\n"); + + thisShipment.getPickupLinkId().toString() + " " + thisShipment.getDeliveryLinkId().toString() + "\n"); writer.write(thisCarrier.getId().toString() + thisShipment.getId() + " " + coordTo.getX() + " " + coordTo.getY() + " " + "Delivery" + " " - + thisShipment.getFrom() + " " + thisShipment.getTo() + "\n"); + + thisShipment.getPickupLinkId() + " " + thisShipment.getDeliveryLinkId() + "\n"); } } writer.flush(); diff --git a/contribs/application/src/test/java/org/matsim/freightDemandGeneration/DemandReaderFromCSVTest.java b/contribs/application/src/test/java/org/matsim/freightDemandGeneration/DemandReaderFromCSVTest.java index d27e5d5a202..32972385d8a 100644 --- a/contribs/application/src/test/java/org/matsim/freightDemandGeneration/DemandReaderFromCSVTest.java +++ b/contribs/application/src/test/java/org/matsim/freightDemandGeneration/DemandReaderFromCSVTest.java @@ -109,9 +109,9 @@ void demandCreationWithSampleWithChangeNumberOfLocations() throws IOException { Assertions.assertEquals(TimeWindow.newInstance(8000, 50000), shipment.getPickupStartsTimeWindow()); Assertions.assertEquals(TimeWindow.newInstance(10000, 60000), shipment.getDeliveryStartsTimeWindow()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_pickup", (k) -> new HashSet<>()) - .add(shipment.getFrom().toString()); + .add(shipment.getPickupLinkId().toString()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_delivery", (k) -> new HashSet<>()) - .add(shipment.getTo().toString()); + .add(shipment.getDeliveryLinkId().toString()); } Assertions.assertEquals(20, countDemand); Assertions.assertEquals(4, countShipmentsWithCertainDemand.getInt(5)); @@ -176,9 +176,9 @@ void demandCreationWithSampleWithDemandOnLocation() throws IOException { Assertions.assertEquals(TimeWindow.newInstance(8000, 50000), shipment.getPickupStartsTimeWindow()); Assertions.assertEquals(TimeWindow.newInstance(10000, 60000), shipment.getDeliveryStartsTimeWindow()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_pickup", (k) -> new HashSet<>()) - .add(shipment.getFrom().toString()); + .add(shipment.getPickupLinkId().toString()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_delivery", (k) -> new HashSet<>()) - .add(shipment.getTo().toString()); + .add(shipment.getDeliveryLinkId().toString()); } Assertions.assertEquals(20, countDemand); Assertions.assertEquals(2, countShipmentsWithCertainDemand.getInt(10)); @@ -243,9 +243,9 @@ void demandCreationWithSampleWithDemandOnLocationWithCombiningJobs() throws IOEx Assertions.assertEquals(TimeWindow.newInstance(8000, 50000), shipment.getPickupStartsTimeWindow()); Assertions.assertEquals(TimeWindow.newInstance(10000, 60000), shipment.getDeliveryStartsTimeWindow()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_pickup", (k) -> new HashSet<>()) - .add(shipment.getFrom().toString()); + .add(shipment.getPickupLinkId().toString()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_delivery", (k) -> new HashSet<>()) - .add(shipment.getTo().toString()); + .add(shipment.getDeliveryLinkId().toString()); } Assertions.assertEquals(20, countDemand); Assertions.assertEquals(2, countShipmentsWithCertainDemand.getInt(10)); @@ -313,9 +313,9 @@ void demandCreationNoSampling() throws IOException { Assertions.assertEquals(TimeWindow.newInstance(8000, 50000), shipment.getPickupStartsTimeWindow()); Assertions.assertEquals(TimeWindow.newInstance(10000, 60000), shipment.getDeliveryStartsTimeWindow()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_pickup", (k) -> new HashSet<>()) - .add(shipment.getFrom().toString()); + .add(shipment.getPickupLinkId().toString()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_delivery", (k) -> new HashSet<>()) - .add(shipment.getTo().toString()); + .add(shipment.getDeliveryLinkId().toString()); } Assertions.assertEquals(20, countDemand); Assertions.assertEquals(2, countShipmentsWithCertainDemand.getInt(10)); @@ -480,18 +480,18 @@ private static void checkCarrier1and2(Scenario scenario, Network network, ShpOpt Assertions.assertEquals(180, service.getServiceDuration(), MatsimTestUtils.EPSILON); Assertions.assertEquals(TimeWindow.newInstance(3000, 13000), service.getServiceStartTimeWindow()); locationsPerServiceElement.computeIfAbsent("serviceElement1", (k) -> new HashSet<>()) - .add(service.getLocationLinkId().toString()); + .add(service.getServiceLinkId().toString()); } else if (service.getDemand() == 1) { Assertions.assertEquals(100, service.getServiceDuration(), MatsimTestUtils.EPSILON); Assertions.assertEquals(TimeWindow.newInstance(5000, 20000), service.getServiceStartTimeWindow()); locationsPerServiceElement.computeIfAbsent("serviceElement2", (k) -> new HashSet<>()) - .add(service.getLocationLinkId().toString()); + .add(service.getServiceLinkId().toString()); } else { if (service.getDemand() == 2) { Assertions.assertEquals(200, service.getServiceDuration(), MatsimTestUtils.EPSILON); Assertions.assertEquals(TimeWindow.newInstance(5000, 20000), service.getServiceStartTimeWindow()); locationsPerServiceElement.computeIfAbsent("serviceElement2", (k) -> new HashSet<>()) - .add(service.getLocationLinkId().toString()); + .add(service.getServiceLinkId().toString()); } else Assertions.fail("Service has a wrong demand."); } @@ -530,18 +530,18 @@ private static void checkCarrier1and2(Scenario scenario, Network network, ShpOpt Assertions.assertEquals(TimeWindow.newInstance(10000, 45000), shipment.getPickupStartsTimeWindow()); Assertions.assertEquals(TimeWindow.newInstance(11000, 44000), shipment.getDeliveryStartsTimeWindow()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_pickup", (k) -> new HashSet<>()) - .add(shipment.getFrom().toString()); + .add(shipment.getPickupLinkId().toString()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_delivery", (k) -> new HashSet<>()) - .add(shipment.getTo().toString()); + .add(shipment.getDeliveryLinkId().toString()); } else if (shipment.getDemand() == 2) { Assertions.assertEquals(400, shipment.getPickupDuration(), MatsimTestUtils.EPSILON); Assertions.assertEquals(400, shipment.getDeliveryDuration(), MatsimTestUtils.EPSILON); Assertions.assertEquals(TimeWindow.newInstance(11000, 44000), shipment.getPickupStartsTimeWindow()); Assertions.assertEquals(TimeWindow.newInstance(20000, 40000), shipment.getDeliveryStartsTimeWindow()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement2_pickup", (k) -> new HashSet<>()) - .add(shipment.getFrom().toString()); + .add(shipment.getPickupLinkId().toString()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement2_delivery", (k) -> new HashSet<>()) - .add(shipment.getTo().toString()); + .add(shipment.getDeliveryLinkId().toString()); } else { if (shipment.getDemand() == 3) { Assertions.assertEquals(600, shipment.getPickupDuration(), MatsimTestUtils.EPSILON); @@ -549,9 +549,9 @@ private static void checkCarrier1and2(Scenario scenario, Network network, ShpOpt Assertions.assertEquals(TimeWindow.newInstance(11000, 44000), shipment.getPickupStartsTimeWindow()); Assertions.assertEquals(TimeWindow.newInstance(20000, 40000), shipment.getDeliveryStartsTimeWindow()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement2_pickup", (k) -> new HashSet<>()) - .add(shipment.getFrom().toString()); + .add(shipment.getPickupLinkId().toString()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement2_delivery", (k) -> new HashSet<>()) - .add(shipment.getTo().toString()); + .add(shipment.getDeliveryLinkId().toString()); } else Assertions.fail("Shipment has an unexpected demand."); } @@ -589,12 +589,12 @@ private static void checkCarrier1and2WithCombiningJobs(Scenario scenario, Networ Assertions.assertEquals(180, service.getServiceDuration(), MatsimTestUtils.EPSILON); Assertions.assertEquals(TimeWindow.newInstance(3000, 13000), service.getServiceStartTimeWindow()); locationsPerServiceElement.computeIfAbsent("serviceElement1", (k) -> new HashSet<>()) - .add(service.getLocationLinkId().toString()); + .add(service.getServiceLinkId().toString()); } else { Assertions.assertEquals(service.getDemand() * 100, service.getServiceDuration(), MatsimTestUtils.EPSILON); Assertions.assertEquals(TimeWindow.newInstance(5000, 20000), service.getServiceStartTimeWindow()); locationsPerServiceElement.computeIfAbsent("serviceElement2", (k) -> new HashSet<>()) - .add(service.getLocationLinkId().toString()); + .add(service.getServiceLinkId().toString()); } } Assertions.assertEquals(12, countDemand); @@ -629,18 +629,18 @@ private static void checkCarrier1and2WithCombiningJobs(Scenario scenario, Networ Assertions.assertEquals(TimeWindow.newInstance(10000, 45000), shipment.getPickupStartsTimeWindow()); Assertions.assertEquals(TimeWindow.newInstance(11000, 44000), shipment.getDeliveryStartsTimeWindow()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_pickup", (k) -> new HashSet<>()) - .add(shipment.getFrom().toString()); + .add(shipment.getPickupLinkId().toString()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement1_delivery", (k) -> new HashSet<>()) - .add(shipment.getTo().toString()); + .add(shipment.getDeliveryLinkId().toString()); } else { Assertions.assertEquals(shipment.getDemand() * 200, shipment.getPickupDuration(), MatsimTestUtils.EPSILON); Assertions.assertEquals(shipment.getDemand() * 200, shipment.getDeliveryDuration(), MatsimTestUtils.EPSILON); Assertions.assertEquals(TimeWindow.newInstance(11000, 44000), shipment.getPickupStartsTimeWindow()); Assertions.assertEquals(TimeWindow.newInstance(20000, 40000), shipment.getDeliveryStartsTimeWindow()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement2_pickup", (k) -> new HashSet<>()) - .add(shipment.getFrom().toString()); + .add(shipment.getPickupLinkId().toString()); locationsPerShipmentElement.computeIfAbsent("ShipmentElement2_delivery", (k) -> new HashSet<>()) - .add(shipment.getTo().toString()); + .add(shipment.getDeliveryLinkId().toString()); } } Assertions.assertEquals(15, countDemand); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanReaderV1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanReaderV1.java index 42b2317a6cb..c22b5928899 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanReaderV1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanReaderV1.java @@ -208,16 +208,16 @@ public void startTag(String name, Attributes attributes, Stack context) case "pickup" -> { String id = attributes.getValue(SHIPMENT_ID); CarrierShipment s = currentShipments.get(id); - finishLeg(s.getFrom()); + finishLeg(s.getPickupLinkId()); currentTourBuilder.schedulePickup(s); - previousActLoc = s.getFrom(); + previousActLoc = s.getPickupLinkId(); } case "delivery" -> { String id = attributes.getValue(SHIPMENT_ID); CarrierShipment s = currentShipments.get(id); - finishLeg(s.getTo()); + finishLeg(s.getDeliveryLinkId()); currentTourBuilder.scheduleDelivery(s); - previousActLoc = s.getTo(); + previousActLoc = s.getDeliveryLinkId(); } case "end" -> { finishLeg(currentVehicle.getLinkId()); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2.java index 599c48a3886..7bbc83c9479 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2.java @@ -261,26 +261,26 @@ public void startTag(String name, Attributes atts, Stack context) { String id = atts.getValue(SHIPMENT_ID); if (id == null) throw new IllegalStateException("pickup.shipmentId is missing."); CarrierShipment s = currentShipments.get(id); - finishLeg(s.getFrom()); + finishLeg(s.getPickupLinkId()); currentTourBuilder.schedulePickup(s); - previousActLoc = s.getFrom(); + previousActLoc = s.getPickupLinkId(); } case "delivery" -> { String id = atts.getValue(SHIPMENT_ID); if (id == null) throw new IllegalStateException("delivery.shipmentId is missing."); CarrierShipment s = currentShipments.get(id); - finishLeg(s.getTo()); + finishLeg(s.getDeliveryLinkId()); currentTourBuilder.scheduleDelivery(s); - previousActLoc = s.getTo(); + previousActLoc = s.getDeliveryLinkId(); } case "service" -> { String id = atts.getValue("serviceId"); if (id == null) throw new IllegalStateException("act.serviceId is missing."); CarrierService s = serviceMap.get(Id.create(id, CarrierService.class)); if (s == null) throw new IllegalStateException("serviceId is not known."); - finishLeg(s.getLocationLinkId()); + finishLeg(s.getServiceLinkId()); currentTourBuilder.scheduleService(s); - previousActLoc = s.getLocationLinkId(); + previousActLoc = s.getServiceLinkId(); } case "end" -> { finishLeg(currentVehicle.getLinkId()); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2_1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2_1.java index a9f06abb1f4..f439d323ddd 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2_1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2_1.java @@ -263,26 +263,26 @@ public void startTag(String name, Attributes atts, Stack context) { String id = atts.getValue(SHIPMENT_ID); if (id == null) throw new IllegalStateException("pickup.shipmentId is missing."); CarrierShipment s = currentShipments.get(id); - finishLeg(s.getFrom()); + finishLeg(s.getPickupLinkId()); currentTourBuilder.schedulePickup(s); - previousActLoc = s.getFrom(); + previousActLoc = s.getPickupLinkId(); } case "delivery" -> { String id = atts.getValue(SHIPMENT_ID); if (id == null) throw new IllegalStateException("delivery.shipmentId is missing."); CarrierShipment s = currentShipments.get(id); - finishLeg(s.getTo()); + finishLeg(s.getDeliveryLinkId()); currentTourBuilder.scheduleDelivery(s); - previousActLoc = s.getTo(); + previousActLoc = s.getDeliveryLinkId(); } case "service" -> { String id = atts.getValue("serviceId"); if (id == null) throw new IllegalStateException("act.serviceId is missing."); CarrierService s = serviceMap.get(Id.create(id, CarrierService.class)); if (s == null) throw new IllegalStateException("serviceId is not known."); - finishLeg(s.getLocationLinkId()); + finishLeg(s.getServiceLinkId()); currentTourBuilder.scheduleService(s); - previousActLoc = s.getLocationLinkId(); + previousActLoc = s.getServiceLinkId(); } case "end" -> { finishLeg(currentVehicle.getLinkId()); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1.java index 5641fbc85f9..811153ead21 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1.java @@ -159,8 +159,8 @@ private void writeShipments(Carrier carrier, BufferedWriter writer) { private void writeShipment(CarrierShipment s, Id shipmentId, boolean closeElement, boolean lineBreak) { this.writeStartTag(SHIPMENT, List.of( createTuple(ID, shipmentId.toString()), - createTuple(FROM, s.getFrom().toString()), - createTuple(TO, s.getTo().toString()), + createTuple(FROM, s.getPickupLinkId().toString()), + createTuple(TO, s.getDeliveryLinkId().toString()), createTuple(SIZE, s.getDemand()), createTuple(START_PICKUP, getTime(s.getPickupStartsTimeWindow().getStart())), createTuple(END_PICKUP, getTime(s.getPickupStartsTimeWindow().getEnd())), @@ -190,7 +190,7 @@ private void writeServices(Carrier carrier, BufferedWriter writer) { private void writeService(CarrierService s, boolean closeElement, boolean lineBreak) { this.writeStartTag(SERVICE, List.of( createTuple(ID, s.getId().toString()), - createTuple(TO, s.getLocationLinkId().toString()), + createTuple(TO, s.getServiceLinkId().toString()), createTuple(CAPACITY_DEMAND, s.getDemand()), createTuple(EARLIEST_START, getTime(s.getServiceStartTimeWindow().getStart())), createTuple(LATEST_END, getTime(s.getServiceStartTimeWindow().getEnd())), diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java index 7a140a5b386..99be9a2f21f 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java @@ -141,10 +141,18 @@ public Id getId() { return id; } - public Id getLocationLinkId() { + public Id getServiceLinkId() { return serviceLinkId; } + /** + * @deprecated please inline and use {@link #getServiceLinkId()} instead + */ + @Deprecated(since = "dec'24") + public Id getLocationLinkId() { + return getServiceLinkId(); + } + public double getServiceDuration() { return serviceDuration; } diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierShipment.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierShipment.java index 1bdb0d390e2..a78e636ee49 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierShipment.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierShipment.java @@ -278,11 +278,11 @@ public Id getId() { return id; } - public Id getFrom() { + public Id getPickupLinkId() { return pickupLinkId; } - public Id getTo() { + public Id getDeliveryLinkId() { return deliveryLinkId; } @@ -317,6 +317,22 @@ public int getSize() { return getDemand(); } + /** + * @deprecated please inline and use {@link #getPickupLinkId()} instead + */ + @Deprecated(since = "dec'24") + public Id getFrom() { + return getPickupLinkId(); + } + + /** + * @deprecated please inline and use {@link #getDeliveryLinkId()} instead + */ + @Deprecated(since = "dec'24") + public Id getTo() { + return getDeliveryLinkId(); + } + /** * @deprecated please inline and use {@link #getPickupStartsTimeWindow()} instead */ diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java index 61a7ff0c27b..d82e2e0ba46 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java @@ -430,7 +430,7 @@ private static void createShipmentsFromServices(Carrier carrierWS, Carrier carri log.debug("Converting CarrierService to CarrierShipment: {}", carrierService.getId()); CarrierShipment carrierShipment = CarrierShipment.Builder .newInstance(Id.create(carrierService.getId().toString(), CarrierShipment.class), - depotServiceIsDeliveredFrom.get(carrierService.getId()), carrierService.getLocationLinkId(), + depotServiceIsDeliveredFrom.get(carrierService.getId()), carrierService.getServiceLinkId(), carrierService.getDemand()) .setDeliveryDuration(carrierService.getServiceDuration()) // .setPickupServiceTime(pickupServiceTime) //Not set yet, because in service we diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/Tour.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/Tour.java index 41325eb3920..fec5bc60655 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/Tour.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/Tour.java @@ -379,7 +379,7 @@ public String getActivityType() { @Override public Id getLocation() { - return service.getLocationLinkId(); + return service.getServiceLinkId(); } @Override @@ -544,7 +544,7 @@ public TimeWindow getTimeWindow() { @Override public Id getLocation() { - return shipment.getFrom(); + return shipment.getPickupLinkId(); } @Override @@ -602,7 +602,7 @@ public String getActivityType() { @Override public Id getLocation() { - return shipment.getTo(); + return shipment.getDeliveryLinkId(); } @Override diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java index f806248471c..17907fe74eb 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java @@ -42,7 +42,7 @@ public final class CarrierServiceEndEvent extends AbstractCarrierEvent { private final double serviceDuration; public CarrierServiceEndEvent(double time, Id carrierId, CarrierService service, Id vehicleId) { - super(time, carrierId, service.getLocationLinkId(), vehicleId); + super(time, carrierId, service.getServiceLinkId(), vehicleId); this.serviceId = service.getId(); this.serviceDuration = service.getServiceDuration(); } diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java index 02b24c5d56c..f0a2cc0fde6 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java @@ -44,7 +44,7 @@ public final class CarrierServiceStartEvent extends AbstractCarrierEvent { private final int capacityDemand; public CarrierServiceStartEvent(double time, Id carrierId, CarrierService service, Id vehicleId) { - super(time, carrierId, service.getLocationLinkId(), vehicleId); + super(time, carrierId, service.getServiceLinkId(), vehicleId); this.serviceId = service.getId(); this.serviceDuration = service.getServiceDuration(); this.capacityDemand = service.getDemand(); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java index fbd9e4ddff8..2687b550387 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java @@ -44,7 +44,7 @@ public class CarrierShipmentDeliveryEndEvent extends AbstractCarrierEvent { private final double deliveryDuration; private final int capacityDemand; public CarrierShipmentDeliveryEndEvent(double time, Id carrierId, CarrierShipment shipment, Id vehicleId) { - super(time, carrierId, shipment.getTo(), vehicleId); + super(time, carrierId, shipment.getDeliveryLinkId(), vehicleId); this.shipmentId = shipment.getId(); this.deliveryDuration = shipment.getDeliveryDuration(); this.capacityDemand = shipment.getDemand(); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java index 355b76782b0..ca4a2ec4767 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java @@ -45,7 +45,7 @@ public class CarrierShipmentDeliveryStartEvent extends AbstractCarrierEvent { private final double deliveryDuration; private final int capacityDemand; public CarrierShipmentDeliveryStartEvent(double time, Id carrierId, CarrierShipment shipment, Id vehicleId) { - super(time, carrierId, shipment.getTo(), vehicleId); + super(time, carrierId, shipment.getDeliveryLinkId(), vehicleId); this.shipmentId = shipment.getId(); this.deliveryDuration = shipment.getDeliveryDuration(); this.capacityDemand = shipment.getDemand(); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java index 1f669809087..97da9f70817 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java @@ -46,7 +46,7 @@ public class CarrierShipmentPickupEndEvent extends AbstractCarrierEvent { public CarrierShipmentPickupEndEvent(double time, Id carrierId, CarrierShipment shipment, Id vehicleId) { - super(time, carrierId, shipment.getFrom(), vehicleId); + super(time, carrierId, shipment.getPickupLinkId(), vehicleId); this.shipmentId = shipment.getId(); this.pickupDuration = shipment.getPickupDuration(); this.capacityDemand = shipment.getDemand(); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java index 9e9bb519ae1..7334a9fa8a6 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java @@ -44,7 +44,7 @@ public class CarrierShipmentPickupStartEvent extends AbstractCarrierEvent { public CarrierShipmentPickupStartEvent(double time, Id carrierId, CarrierShipment shipment, Id vehicleId) { - super(time, carrierId, shipment.getFrom(), vehicleId); + super(time, carrierId, shipment.getPickupLinkId(), vehicleId); this.shipmentId = shipment.getId(); this.pickupDuration = shipment.getPickupDuration(); this.capacityDemand = shipment.getDemand(); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java index 986eb953391..11776d0152b 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java @@ -108,13 +108,13 @@ static CarrierShipment createCarrierShipment(Shipment jspritShipment) { */ static Shipment createJspritShipment(CarrierShipment carrierShipment) { Shipment.Builder shipmentBuilder = Shipment.Builder.newInstance(carrierShipment.getId().toString()) - .setDeliveryLocation(Location.newInstance(carrierShipment.getTo().toString())) + .setDeliveryLocation(Location.newInstance(carrierShipment.getDeliveryLinkId().toString())) .setDeliveryServiceTime(carrierShipment.getDeliveryDuration()) .setDeliveryTimeWindow(com.graphhopper.jsprit.core.problem.solution.route.activity.TimeWindow .newInstance(carrierShipment.getDeliveryStartsTimeWindow().getStart(), carrierShipment.getDeliveryStartsTimeWindow().getEnd())) .setPickupServiceTime(carrierShipment.getPickupDuration()) - .setPickupLocation(Location.newInstance(carrierShipment.getFrom().toString())) + .setPickupLocation(Location.newInstance(carrierShipment.getPickupLinkId().toString())) .setPickupTimeWindow(com.graphhopper.jsprit.core.problem.solution.route.activity.TimeWindow.newInstance( carrierShipment.getPickupStartsTimeWindow().getStart(), carrierShipment.getPickupStartsTimeWindow().getEnd())) @@ -127,14 +127,14 @@ static Shipment createJspritShipment(CarrierShipment carrierShipment) { static Shipment createJspritShipment(CarrierShipment carrierShipment, Coord fromCoord, Coord toCoord) { Location.Builder fromLocationBuilder = Location.Builder.newInstance(); - fromLocationBuilder.setId(carrierShipment.getFrom().toString()); + fromLocationBuilder.setId(carrierShipment.getPickupLinkId().toString()); if (fromCoord != null) { fromLocationBuilder.setCoordinate(Coordinate.newInstance(fromCoord.getX(), fromCoord.getY())); } Location fromLocation = fromLocationBuilder.build(); Location.Builder toLocationBuilder = Location.Builder.newInstance(); - toLocationBuilder.setId(carrierShipment.getTo().toString()); + toLocationBuilder.setId(carrierShipment.getDeliveryLinkId().toString()); if (toCoord != null) { toLocationBuilder.setCoordinate(Coordinate.newInstance(toCoord.getX(), toCoord.getY())); } @@ -158,7 +158,7 @@ static Shipment createJspritShipment(CarrierShipment carrierShipment, Coord from static Service createJspritService(CarrierService carrierService, Coord locationCoord) { Location.Builder locationBuilder = Location.Builder.newInstance(); - locationBuilder.setId(carrierService.getLocationLinkId().toString()); + locationBuilder.setId(carrierService.getServiceLinkId().toString()); if (locationCoord != null) { locationBuilder.setCoordinate(Coordinate.newInstance(locationCoord.getX(), locationCoord.getY())); } @@ -515,11 +515,11 @@ public static VehicleRoutingProblem createRoutingProblem(Carrier carrier, Networ Coord coordinate = null; if (network != null) { - Link link = network.getLinks().get(service.getLocationLinkId()); + Link link = network.getLinks().get(service.getServiceLinkId()); if (link != null) { coordinate = link.getCoord(); } else - log.warn("cannot find linkId {}", service.getLocationLinkId()); + log.warn("cannot find linkId {}", service.getServiceLinkId()); } vrpBuilder.addJob(createJspritService(service, coordinate)); } @@ -530,8 +530,8 @@ public static VehicleRoutingProblem createRoutingProblem(Carrier carrier, Networ Coord fromCoordinate = null; Coord toCoordinate = null; if (network != null) { - Link fromLink = network.getLinks().get(carrierShipment.getFrom()); - Link toLink = network.getLinks().get(carrierShipment.getTo()); + Link fromLink = network.getLinks().get(carrierShipment.getPickupLinkId()); + Link toLink = network.getLinks().get(carrierShipment.getDeliveryLinkId()); if (fromLink != null && toLink != null) { // Shipment to be delivered from specified location to // specified location @@ -540,8 +540,8 @@ public static VehicleRoutingProblem createRoutingProblem(Carrier carrier, Networ vrpBuilder.addJob(createJspritShipment(carrierShipment, fromCoordinate, toCoordinate)); } else throw new IllegalStateException( - "cannot create shipment since neither fromLinkId " + carrierShipment.getTo() - + " nor toLinkId " + carrierShipment.getTo() + " exists in network."); + "cannot create shipment since neither fromLinkId " + carrierShipment.getDeliveryLinkId() + + " nor toLinkId " + carrierShipment.getDeliveryLinkId() + " exists in network."); } vrpBuilder.addJob(createJspritShipment(carrierShipment, fromCoordinate, toCoordinate)); @@ -611,9 +611,9 @@ public static VehicleRoutingProblem.Builder createRoutingProblemBuilder(Carrier log.debug("Handle CarrierService: {}", service.toString()); Coord coordinate = null; if (network != null) { - Link link = network.getLinks().get(service.getLocationLinkId()); + Link link = network.getLinks().get(service.getServiceLinkId()); if (link == null) { - throw new IllegalStateException("cannot create service since linkId " + service.getLocationLinkId() + throw new IllegalStateException("cannot create service since linkId " + service.getServiceLinkId() + " does not exists in network."); } else coordinate = link.getCoord(); @@ -628,8 +628,8 @@ public static VehicleRoutingProblem.Builder createRoutingProblemBuilder(Carrier Coord fromCoordinate = null; Coord toCoordinate = null; if (network != null) { - Link fromLink = network.getLinks().get(carrierShipment.getFrom()); - Link toLink = network.getLinks().get(carrierShipment.getTo()); + Link fromLink = network.getLinks().get(carrierShipment.getPickupLinkId()); + Link toLink = network.getLinks().get(carrierShipment.getDeliveryLinkId()); if (fromLink != null && toLink != null) { // Shipment to be delivered from specified location to // specified location @@ -638,8 +638,8 @@ public static VehicleRoutingProblem.Builder createRoutingProblemBuilder(Carrier toCoordinate = toLink.getCoord(); } else throw new IllegalStateException("cannot create shipment " + carrierShipment.getId().toString() - + " since either fromLinkId " + carrierShipment.getFrom() + " or toLinkId " - + carrierShipment.getTo() + " exists in network."); + + " since either fromLinkId " + carrierShipment.getPickupLinkId() + " or toLinkId " + + carrierShipment.getDeliveryLinkId() + " exists in network."); } vrpBuilder.addJob(createJspritShipment(carrierShipment, fromCoordinate, toCoordinate)); diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsUtils.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsUtils.java index 70abe3fedd8..8670ad977ea 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsUtils.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsUtils.java @@ -60,8 +60,8 @@ public static Collection createLSPShipmentsFromCarrierShipments(Car LspShipmentUtils.LspShipmentBuilder.newInstance( Id.create(shipment.getId().toString(), LspShipment.class)); builder.setCapacityDemand(shipment.getDemand()); - builder.setFromLinkId(shipment.getFrom()); - builder.setToLinkId(shipment.getTo()); + builder.setFromLinkId(shipment.getPickupLinkId()); + builder.setToLinkId(shipment.getDeliveryLinkId()); builder.setStartTimeWindow(shipment.getPickupStartsTimeWindow()); builder.setEndTimeWindow(shipment.getDeliveryStartsTimeWindow()); builder.setPickupServiceTime(shipment.getPickupDuration()); diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarriersUtilsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarriersUtilsTest.java index 7a784b4351d..839f2cceaef 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarriersUtilsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarriersUtilsTest.java @@ -75,14 +75,14 @@ void testAddAndGetServiceToCarrier() { Assertions.assertEquals(1, carrier.getServices().size()); CarrierService cs1a = (CarrierService) carrier.getServices().values().toArray()[0]; Assertions.assertEquals(service1, cs1a); - Assertions.assertEquals(Id.createLinkId("link0"), cs1a.getLocationLinkId()); + Assertions.assertEquals(Id.createLinkId("link0"), cs1a.getServiceLinkId()); //get Service CarrierService cs1b = CarriersUtils.getService(carrier, serviceId ); assert cs1b != null; Assertions.assertEquals(serviceId, cs1b.getId()); Assertions.assertEquals(service1.getId(), cs1b.getId()); - Assertions.assertEquals(Id.createLinkId("link0"), cs1b.getLocationLinkId()); + Assertions.assertEquals(Id.createLinkId("link0"), cs1b.getServiceLinkId()); Assertions.assertEquals(30, cs1b.getServiceDuration(), EPSILON); } @@ -97,14 +97,14 @@ void testAddAndGetShipmentToCarrier() { Assertions.assertEquals(1, carrier.getShipments().size()); CarrierShipment carrierShipment1a = (CarrierShipment) carrier.getShipments().values().toArray()[0]; Assertions.assertEquals(service1, carrierShipment1a); - Assertions.assertEquals(Id.createLinkId("link0"), carrierShipment1a.getFrom()); + Assertions.assertEquals(Id.createLinkId("link0"), carrierShipment1a.getPickupLinkId()); //get Shipment CarrierShipment carrierShipment1b = CarriersUtils.getShipment(carrier, shipmentId ); assert carrierShipment1b != null; Assertions.assertEquals(shipmentId, carrierShipment1b.getId()); Assertions.assertEquals(service1.getId(), carrierShipment1b.getId()); - Assertions.assertEquals(Id.createLinkId("link0"), carrierShipment1b.getFrom()); + Assertions.assertEquals(Id.createLinkId("link0"), carrierShipment1b.getPickupLinkId()); Assertions.assertEquals(20, carrierShipment1b.getDemand(), EPSILON); } diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java index 705f4290980..2882cec1336 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java @@ -146,7 +146,7 @@ void whenTransforming_jspritService2matsimService_isMadeCorrectly() { CarrierService service = MatsimJspritFactory.createCarrierService(carrierService); assertNotNull(service); - assertEquals("locationId", service.getLocationLinkId().toString()); + assertEquals("locationId", service.getServiceLinkId().toString()); assertEquals(30.0, service.getServiceDuration(), 0.01); assertEquals(50, service.getDemand()); assertEquals(10.0, service.getServiceStartTimeWindow().getStart(), 0.01); @@ -193,11 +193,11 @@ void whenTransforming_jspritShipment2matsimShipment_isMadeCorrectly() { CarrierShipment carrierShipment = MatsimJspritFactory.createCarrierShipment(shipment); assertNotNull(carrierShipment); - assertEquals("PickupLocationId", carrierShipment.getFrom().toString()); + assertEquals("PickupLocationId", carrierShipment.getPickupLinkId().toString()); assertEquals(30.0, carrierShipment.getPickupDuration(), 0.01); assertEquals(10.0, carrierShipment.getPickupStartsTimeWindow().getStart(), 0.01); assertEquals(20.0, carrierShipment.getPickupStartsTimeWindow().getEnd(), 0.01); - assertEquals("DeliveryLocationId", carrierShipment.getTo().toString()); + assertEquals("DeliveryLocationId", carrierShipment.getDeliveryLinkId().toString()); assertEquals(40.0, carrierShipment.getDeliveryDuration(), 0.01); assertEquals(50.0, carrierShipment.getDeliveryStartsTimeWindow().getStart(), 0.01); assertEquals(60.0, carrierShipment.getDeliveryStartsTimeWindow().getEnd(), 0.01); @@ -234,7 +234,7 @@ private Collection getJobsFrom(ScheduledTour sTour) { CarrierService carrierService = ((Tour.ServiceActivity) e) .getService(); Service service = Service.Builder.newInstance(carrierService.getId().toString()) - .setLocation(Location.newInstance(carrierService.getLocationLinkId().toString())).build(); + .setLocation(Location.newInstance(carrierService.getServiceLinkId().toString())).build(); services.add(service); } } diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java index 110ed45f27e..393f73088a3 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java @@ -244,8 +244,8 @@ void copyingOfShipmentsIsDoneCorrectly() { if (carrierShipment1.getId() == Id.create("shipment1", CarrierShipment.class)) { System.out.println("Found Shipment1"); foundShipment1 = true; - Assertions.assertEquals(Id.createLinkId("i(1,0)"), carrierShipment1.getFrom()); - Assertions.assertEquals(Id.createLinkId("i(7,6)R"), carrierShipment1.getTo()); + Assertions.assertEquals(Id.createLinkId("i(1,0)"), carrierShipment1.getPickupLinkId()); + Assertions.assertEquals(Id.createLinkId("i(7,6)R"), carrierShipment1.getDeliveryLinkId()); Assertions.assertEquals(1, carrierShipment1.getDemand()); Assertions.assertEquals(30.0, carrierShipment1.getDeliveryDuration(), 0); Assertions.assertEquals(3600.0, carrierShipment1.getDeliveryStartsTimeWindow().getStart(), 0); @@ -259,8 +259,8 @@ void copyingOfShipmentsIsDoneCorrectly() { if (carrierShipment2.getId() == Id.create("shipment2", CarrierShipment.class)) { System.out.println("Found Shipment2"); foundShipment2 = true; - Assertions.assertEquals(Id.createLinkId("i(3,0)"), carrierShipment2.getFrom()); - Assertions.assertEquals(Id.createLinkId("i(3,7)"), carrierShipment2.getTo()); + Assertions.assertEquals(Id.createLinkId("i(3,0)"), carrierShipment2.getPickupLinkId()); + Assertions.assertEquals(Id.createLinkId("i(3,7)"), carrierShipment2.getDeliveryLinkId()); Assertions.assertEquals(2, carrierShipment2.getDemand()); Assertions.assertEquals(30.0, carrierShipment2.getDeliveryDuration(), 0); Assertions.assertEquals(3600.0, carrierShipment2.getDeliveryStartsTimeWindow().getStart(), 0); @@ -282,8 +282,8 @@ void convertionOfServicesIsDoneCorrectly() { assert carrierShipment1 != null; if (carrierShipment1.getId() == Id.create("Service1", CarrierShipment.class)) { foundService1 = true; - Assertions.assertEquals(Id.createLinkId("i(6,0)"), carrierShipment1.getFrom()); - Assertions.assertEquals(Id.createLinkId("i(3,9)"), carrierShipment1.getTo()); + Assertions.assertEquals(Id.createLinkId("i(6,0)"), carrierShipment1.getPickupLinkId()); + Assertions.assertEquals(Id.createLinkId("i(3,9)"), carrierShipment1.getDeliveryLinkId()); Assertions.assertEquals(2, carrierShipment1.getDemand()); Assertions.assertEquals(31.0, carrierShipment1.getDeliveryDuration(), 0); Assertions.assertEquals(3601.0, carrierShipment1.getDeliveryStartsTimeWindow().getStart(), 0); @@ -296,8 +296,8 @@ void convertionOfServicesIsDoneCorrectly() { assert carrierShipment2 != null; if (carrierShipment2.getId() == Id.create("Service2", CarrierShipment.class)) { foundService2 = true; - Assertions.assertEquals(Id.createLinkId("i(6,0)"), carrierShipment2.getFrom()); - Assertions.assertEquals(Id.createLinkId("i(4,9)"), carrierShipment2.getTo()); + Assertions.assertEquals(Id.createLinkId("i(6,0)"), carrierShipment2.getPickupLinkId()); + Assertions.assertEquals(Id.createLinkId("i(4,9)"), carrierShipment2.getDeliveryLinkId()); Assertions.assertEquals(2, carrierShipment2.getDemand()); Assertions.assertEquals(31.0, carrierShipment2.getDeliveryDuration(), 0); Assertions.assertEquals(3601.0, carrierShipment2.getDeliveryStartsTimeWindow().getStart(), 0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java index d031c5f6d1d..ba6d1fd35e7 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java @@ -196,7 +196,7 @@ public void testCollectionLSPScheduling() { { assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler endHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(endHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(endHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(endHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(endHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(endHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -211,7 +211,7 @@ public void testCollectionLSPScheduling() { { assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler serviceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(serviceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(serviceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(serviceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(serviceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(serviceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java index 3a6a13e629a..11d49bd6c0b 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java @@ -433,7 +433,7 @@ public void testCompletedLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), shipment.getFrom()); + assertSame(service.getServiceLinkId(), shipment.getFrom()); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -460,7 +460,7 @@ public void testCompletedLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), toLinkId); + assertSame(service.getServiceLinkId(), toLinkId); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -484,7 +484,7 @@ public void testCompletedLSPScheduling() { assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler endHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(endHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(endHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(endHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(endHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(endHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -502,7 +502,7 @@ public void testCompletedLSPScheduling() { //CollectionServiceEnd assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler serviceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(serviceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(serviceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(serviceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(serviceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(serviceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -520,7 +520,7 @@ public void testCompletedLSPScheduling() { //MainRunStart assertInstanceOf(LSPTourStartEventHandler.class, eventHandlers.get(2)); LSPTourStartEventHandler mainRunStartHandler = (LSPTourStartEventHandler) eventHandlers.get(2); - assertSame(mainRunStartHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunStartHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunStartHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunStartHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunStartHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -538,7 +538,7 @@ public void testCompletedLSPScheduling() { //MainRunEnd assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.get(3)); LSPTourEndEventHandler mainRunEndHandler = (LSPTourEndEventHandler) eventHandlers.get(3); - assertSame(mainRunEndHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunEndHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunEndHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunEndHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunEndHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -556,7 +556,7 @@ public void testCompletedLSPScheduling() { //DistributionRunStart assertInstanceOf(LSPTourStartEventHandler.class, eventHandlers.get(4)); LSPTourStartEventHandler lspTourStartEventHandler = (LSPTourStartEventHandler) eventHandlers.get(4); - assertSame(lspTourStartEventHandler.getCarrierService().getLocationLinkId(), shipment.getTo()); + assertSame(lspTourStartEventHandler.getCarrierService().getServiceLinkId(), shipment.getTo()); assertEquals(lspTourStartEventHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(lspTourStartEventHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, lspTourStartEventHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -574,7 +574,7 @@ public void testCompletedLSPScheduling() { //DistributionServiceStart assertInstanceOf(DistributionServiceStartEventHandler.class, eventHandlers.get(5)); DistributionServiceStartEventHandler distributionServiceHandler = (DistributionServiceStartEventHandler) eventHandlers.get(5); - assertSame(distributionServiceHandler.getCarrierService().getLocationLinkId(), shipment.getTo()); + assertSame(distributionServiceHandler.getCarrierService().getServiceLinkId(), shipment.getTo()); assertEquals(distributionServiceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(distributionServiceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, distributionServiceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java index 5b724cf6a80..76191192a70 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java @@ -259,7 +259,7 @@ public void testFirstReloadLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), shipment.getFrom()); + assertSame(service.getServiceLinkId(), shipment.getFrom()); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -283,7 +283,7 @@ public void testFirstReloadLSPScheduling() { assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler endHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(endHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(endHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(endHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(endHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(endHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -296,7 +296,7 @@ public void testFirstReloadLSPScheduling() { assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler serviceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(serviceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(serviceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(serviceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(serviceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(serviceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java index 8d653d8e171..ce0a83639a8 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java @@ -324,7 +324,7 @@ public void testMainRunLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), shipment.getFrom()); + assertSame(service.getServiceLinkId(), shipment.getFrom()); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -350,7 +350,7 @@ public void testMainRunLSPScheduling() { assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler endHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(endHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(endHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(endHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(endHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(endHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -368,7 +368,7 @@ public void testMainRunLSPScheduling() { //CollectionServiceEnd assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler serviceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(serviceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(serviceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(serviceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(serviceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(serviceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -386,7 +386,7 @@ public void testMainRunLSPScheduling() { //MainRunTourStart assertInstanceOf(LSPTourStartEventHandler.class, eventHandlers.get(2)); LSPTourStartEventHandler mainRunStartHandler = (LSPTourStartEventHandler) eventHandlers.get(2); - assertSame(mainRunStartHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunStartHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunStartHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunStartHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunStartHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -404,7 +404,7 @@ public void testMainRunLSPScheduling() { //MainRunTourEnd assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.get(3)); LSPTourEndEventHandler mainRunEndHandler = (LSPTourEndEventHandler) eventHandlers.get(3); - assertSame(mainRunEndHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunEndHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunEndHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunEndHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunEndHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java index dd51e2d4e4a..d3fe9b5214d 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java @@ -198,7 +198,7 @@ public void testCollectionLSPScheduling() { assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler endHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(endHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(endHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(endHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(endHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(endHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -211,7 +211,7 @@ public void testCollectionLSPScheduling() { assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler serviceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(serviceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(serviceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(serviceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(serviceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(serviceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java index 481c48ec6ba..1a584b463b5 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java @@ -436,7 +436,7 @@ public void testCompletedLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), shipment.getFrom()); + assertSame(service.getServiceLinkId(), shipment.getFrom()); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -463,7 +463,7 @@ public void testCompletedLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), toLinkId); + assertSame(service.getServiceLinkId(), toLinkId); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -487,7 +487,7 @@ public void testCompletedLSPScheduling() { assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler endHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(endHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(endHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(endHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(endHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(endHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -505,7 +505,7 @@ public void testCompletedLSPScheduling() { //CollectionServiceEnd assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler serviceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(serviceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(serviceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(serviceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(serviceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(serviceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -523,7 +523,7 @@ public void testCompletedLSPScheduling() { //MainRunTourStart assertInstanceOf(LSPTourStartEventHandler.class, eventHandlers.get(2)); LSPTourStartEventHandler mainRunStartHandler = (LSPTourStartEventHandler) eventHandlers.get(2); - assertSame(mainRunStartHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunStartHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunStartHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunStartHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunStartHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -541,7 +541,7 @@ public void testCompletedLSPScheduling() { //MainRunTourEnd assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.get(3)); LSPTourEndEventHandler mainRunEndHandler = (LSPTourEndEventHandler) eventHandlers.get(3); - assertSame(mainRunEndHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunEndHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunEndHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunEndHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunEndHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -559,7 +559,7 @@ public void testCompletedLSPScheduling() { //DistributionTourStart assertInstanceOf(LSPTourStartEventHandler.class, eventHandlers.get(4)); LSPTourStartEventHandler lspTourStartEventHandler = (LSPTourStartEventHandler) eventHandlers.get(4); - assertSame(lspTourStartEventHandler.getCarrierService().getLocationLinkId(), shipment.getTo()); + assertSame(lspTourStartEventHandler.getCarrierService().getServiceLinkId(), shipment.getTo()); assertEquals(lspTourStartEventHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(lspTourStartEventHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, lspTourStartEventHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -577,7 +577,7 @@ public void testCompletedLSPScheduling() { //DistributionServiceStart assertInstanceOf(DistributionServiceStartEventHandler.class, eventHandlers.get(5)); DistributionServiceStartEventHandler distributionServiceHandler = (DistributionServiceStartEventHandler) eventHandlers.get(5); - assertSame(distributionServiceHandler.getCarrierService().getLocationLinkId(), shipment.getTo()); + assertSame(distributionServiceHandler.getCarrierService().getServiceLinkId(), shipment.getTo()); assertEquals(distributionServiceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(distributionServiceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, distributionServiceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java index eb6af700893..4d41d635e10 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java @@ -258,7 +258,7 @@ public void testFirstReloadLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), shipment.getFrom()); + assertSame(service.getServiceLinkId(), shipment.getFrom()); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -282,7 +282,7 @@ public void testFirstReloadLSPScheduling() { assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler endHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(endHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(endHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(endHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(endHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(endHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -295,7 +295,7 @@ public void testFirstReloadLSPScheduling() { assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler serviceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(serviceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(serviceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(serviceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(serviceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(serviceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java index f82bde886c8..b63c6d854d4 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java @@ -324,7 +324,7 @@ public void testMainRunLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), shipment.getFrom()); + assertSame(service.getServiceLinkId(), shipment.getFrom()); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -350,7 +350,7 @@ public void testMainRunLSPScheduling() { assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler endHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(endHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(endHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(endHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(endHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(endHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -368,7 +368,7 @@ public void testMainRunLSPScheduling() { //CollectionServiceEnd assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler serviceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(serviceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(serviceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(serviceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(serviceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(serviceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -386,7 +386,7 @@ public void testMainRunLSPScheduling() { //MainRunTourStart assertInstanceOf(LSPTourStartEventHandler.class, eventHandlers.get(2)); LSPTourStartEventHandler mainRunStartHandler = (LSPTourStartEventHandler) eventHandlers.get(2); - assertSame(mainRunStartHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunStartHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunStartHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunStartHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunStartHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -404,7 +404,7 @@ public void testMainRunLSPScheduling() { //MainRunEnd assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.get(3)); LSPTourEndEventHandler mainRunEndHandler = (LSPTourEndEventHandler) eventHandlers.get(3); - assertSame(mainRunEndHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunEndHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunEndHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunEndHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunEndHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java index 403bf619d90..03f374b15f0 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java @@ -368,7 +368,7 @@ public void testSecondReloadLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), shipment.getFrom()); + assertSame(service.getServiceLinkId(), shipment.getFrom()); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -400,7 +400,7 @@ public void testSecondReloadLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), toLinkId); + assertSame(service.getServiceLinkId(), toLinkId); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -430,7 +430,7 @@ public void testSecondReloadLSPScheduling() { { assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler collectionEndHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(collectionEndHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(collectionEndHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(collectionEndHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(collectionEndHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(collectionEndHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -449,7 +449,7 @@ public void testSecondReloadLSPScheduling() { {//CollectionServiceEnd assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler collectionServiceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(collectionServiceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(collectionServiceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(collectionServiceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(collectionServiceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(collectionServiceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -468,7 +468,7 @@ public void testSecondReloadLSPScheduling() { {//MainRunStart assertInstanceOf(LSPTourStartEventHandler.class, eventHandlers.get(2)); LSPTourStartEventHandler mainRunStartHandler = (LSPTourStartEventHandler) eventHandlers.get(2); - assertSame(mainRunStartHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunStartHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunStartHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunStartHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunStartHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -487,7 +487,7 @@ public void testSecondReloadLSPScheduling() { {//MainRunEnd assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.get(3)); LSPTourEndEventHandler mainRunEndHandler = (LSPTourEndEventHandler) eventHandlers.get(3); - assertSame(mainRunEndHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunEndHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunEndHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunEndHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunEndHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java index 08dbac36e8b..66a30fa10d4 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java @@ -368,7 +368,7 @@ public void testSecondReloadLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), shipment.getFrom()); + assertSame(service.getServiceLinkId(), shipment.getFrom()); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -406,7 +406,7 @@ public void testSecondReloadLSPScheduling() { CarrierService service = entry.getKey(); LspShipment shipment = entry.getValue().lspShipment; LogisticChainElement element = entry.getValue().logisticChainElement; - assertSame(service.getLocationLinkId(), toLinkId); + assertSame(service.getServiceLinkId(), toLinkId); assertEquals(service.getDemand(), shipment.getSize()); assertEquals(service.getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); boolean handledByTranshipmentHub = false; @@ -437,7 +437,7 @@ public void testSecondReloadLSPScheduling() { {//CollectionTourEnd assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.getFirst()); LSPTourEndEventHandler collectionEndHandler = (LSPTourEndEventHandler) eventHandlers.getFirst(); - assertSame(collectionEndHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(collectionEndHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(collectionEndHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(collectionEndHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(collectionEndHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -456,7 +456,7 @@ public void testSecondReloadLSPScheduling() { {//CollectionServiceEnd assertInstanceOf(CollectionServiceEndEventHandler.class, eventHandlers.get(1)); CollectionServiceEndEventHandler collectionServiceHandler = (CollectionServiceEndEventHandler) eventHandlers.get(1); - assertSame(collectionServiceHandler.getCarrierService().getLocationLinkId(), shipment.getFrom()); + assertSame(collectionServiceHandler.getCarrierService().getServiceLinkId(), shipment.getFrom()); assertEquals(collectionServiceHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(collectionServiceHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(collectionServiceHandler.getCarrierService().getServiceStartTimeWindow().getStart(), shipment.getPickupTimeWindow().getStart(), 0.0); @@ -475,7 +475,7 @@ public void testSecondReloadLSPScheduling() { {//MainRunStart assertInstanceOf(LSPTourStartEventHandler.class, eventHandlers.get(2)); LSPTourStartEventHandler mainRunStartHandler = (LSPTourStartEventHandler) eventHandlers.get(2); - assertSame(mainRunStartHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunStartHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunStartHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunStartHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunStartHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); @@ -494,7 +494,7 @@ public void testSecondReloadLSPScheduling() { {//MainRunEnd assertInstanceOf(LSPTourEndEventHandler.class, eventHandlers.get(3)); LSPTourEndEventHandler mainRunEndHandler = (LSPTourEndEventHandler) eventHandlers.get(3); - assertSame(mainRunEndHandler.getCarrierService().getLocationLinkId(), toLinkId); + assertSame(mainRunEndHandler.getCarrierService().getServiceLinkId(), toLinkId); assertEquals(mainRunEndHandler.getCarrierService().getServiceDuration(), shipment.getDeliveryServiceTime(), 0.0); assertEquals(mainRunEndHandler.getCarrierService().getDemand(), shipment.getSize()); assertEquals(0, mainRunEndHandler.getCarrierService().getServiceStartTimeWindow().getStart(), 0.0); diff --git a/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/ReceiverControlerListener.java b/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/ReceiverControlerListener.java index 852452663a6..a35dddecc24 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/ReceiverControlerListener.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/ReceiverControlerListener.java @@ -178,7 +178,7 @@ private void linkReceiverTimeWindowToCarrierTourPosition() throws IOException { String shipmentId = act.getShipment().getId().toString(); if (act.getActivityType().equalsIgnoreCase("delivery")) { - Id linkId = act.getShipment().getTo(); + Id linkId = act.getShipment().getDeliveryLinkId(); if (!receiverLinkMap.containsKey(linkId)) { LOG.error("Woops, the carrier is delivering a shipment to an unknown receiver!"); throw new RuntimeException("Don't know to whom delivery is."); diff --git a/contribs/small-scale-traffic-generation/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/DefaultIntegrateExistingTrafficToSmallScaleCommercialImpl.java b/contribs/small-scale-traffic-generation/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/DefaultIntegrateExistingTrafficToSmallScaleCommercialImpl.java index 6652c17b955..052fb62b9f1 100644 --- a/contribs/small-scale-traffic-generation/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/DefaultIntegrateExistingTrafficToSmallScaleCommercialImpl.java +++ b/contribs/small-scale-traffic-generation/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/DefaultIntegrateExistingTrafficToSmallScaleCommercialImpl.java @@ -372,8 +372,8 @@ public void reduceDemandBasedOnExistingCarriers(Scenario scenario, Map createListOfCarrierWithUnhandledJobs(Scenario scenario){ private void redrawAllServiceDurations(Carrier carrier, GenerateSmallScaleCommercialTrafficDemand.CarrierAttributes carrierAttributes, int additionalTravelBufferPerIterationInMinutes) { for (CarrierService service : carrier.getServices().values()) { double newServiceDuration = generator.getServiceTimePerStop(carrier, carrierAttributes, additionalTravelBufferPerIterationInMinutes); - CarrierService redrawnService = CarrierService.Builder.newInstance(service.getId(), service.getLocationLinkId()) + CarrierService redrawnService = CarrierService.Builder.newInstance(service.getId(), service.getServiceLinkId()) .setServiceDuration(newServiceDuration).setServiceStartTimeWindow(service.getServiceStartTimeWindow()).build(); carrier.getServices().put(redrawnService.getId(), redrawnService); } diff --git a/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisEventHandler.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisEventHandler.java index 2f322e8640f..3b159189bda 100644 --- a/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisEventHandler.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisEventHandler.java @@ -391,8 +391,8 @@ public void exportShipmentInfo(String path, Boolean exportGuesses) { if (shipmentTracker == null) { continue; } - Id from = shipment.getFrom(); - Id toLink = shipment.getTo(); + Id from = shipment.getPickupLinkId(); + Id toLink = shipment.getDeliveryLinkId(); // if info is not certain, export the guess if that is wanted. String carrierIdString = id2String(carrier.getId()); String shipmentIdString = id2String(shipment.getId()); diff --git a/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisServiceTracking.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisServiceTracking.java index 88ee09b7b5c..b0e668fdc2f 100644 --- a/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisServiceTracking.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisServiceTracking.java @@ -57,7 +57,7 @@ public void addTracker(CarrierService service, Id id) { public void trackServiceActivityStart(ActivityStartEvent activityStartEvent) { for (ServiceTracker.CarrierServiceTracker cst: carrierServiceTrackers.values()) { for (ServiceTracker service : cst.serviceTrackers.values()) { - if (service.service.getLocationLinkId().equals(activityStartEvent.getLinkId())) { + if (service.service.getServiceLinkId().equals(activityStartEvent.getLinkId())) { if (service.driverId == null) { // if there is no driver, but there is a service which is to be performed at the moment at this place, we guess this could be the event for it. // (Does not work well obviously as soon as there are multiple services at a location that have generous time windows, like e.g. at stores). diff --git a/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisShipmentTracking.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisShipmentTracking.java index 91613aa1d34..5673a46b530 100644 --- a/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisShipmentTracking.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/FreightAnalysisShipmentTracking.java @@ -128,8 +128,8 @@ class ShipmentTracker { public ShipmentTracker(CarrierShipment shipment) { this.id = shipment.getId(); - this.from = shipment.getFrom(); - this.to=shipment.getTo(); + this.from = shipment.getPickupLinkId(); + this.to=shipment.getDeliveryLinkId(); this.shipment=shipment; }