Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
fix compile errors after changes in matsim-libs. e.g. renaming of Fre…
Browse files Browse the repository at this point in the history
…ight*EventHandler to Carrier*EventHandler
  • Loading branch information
kt86 committed Nov 13, 2023
1 parent 731ffa8 commit 449ecac
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
import org.matsim.freight.carriers.controler.CarrierStrategyManager;
import org.matsim.freight.carriers.events.CarrierServiceEndEvent;
import org.matsim.freight.carriers.events.CarrierTourEndEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.FreightTourEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierTourEndEventHandler;
import org.matsim.vehicles.VehicleType;

import java.util.*;
Expand Down Expand Up @@ -511,7 +511,7 @@ private static Collection<LSPShipment> createInitialLSPShipments(Network network

enum SolutionType {onePlan_withHub, onePlan_direct, twoPlans_directAndHub}

private static class MyLSPScorer implements LSPScorer, FreightTourEndEventHandler, FreightServiceEndEventHandler {
private static class MyLSPScorer implements LSPScorer, CarrierTourEndEventHandler, CarrierServiceEndEventHandler {
private double score = 0.;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.matsim.freight.carriers.*;
import org.matsim.freight.carriers.CarrierCapabilities.FleetSize;
import org.matsim.freight.carriers.events.CarrierServiceEndEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler;
import org.matsim.vehicles.VehicleType;

import java.util.*;
Expand Down Expand Up @@ -208,7 +208,7 @@ static Config prepareConfig() {
}


/*package-private*/ static class TipScorer implements LSPScorer, LSPSimulationTracker<LSP>, FreightServiceEndEventHandler {
/*package-private*/ static class TipScorer implements LSPScorer, LSPSimulationTracker<LSP>, CarrierServiceEndEventHandler {

private static final Logger log = LogManager.getLogger(TipScorer.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import org.matsim.freight.carriers.CarrierService;
import org.matsim.freight.carriers.events.CarrierServiceEndEvent;
import org.matsim.freight.carriers.events.CarrierServiceStartEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.FreightServiceStartEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierServiceStartEventHandler;
import org.matsim.vehicles.Vehicle;
import org.matsim.vehicles.VehicleUtils;
import org.matsim.vehicles.Vehicles;
Expand All @@ -35,7 +35,7 @@
import java.util.Collection;


/*package-private*/ class CollectionServiceHandler implements FreightServiceStartEventHandler, FreightServiceEndEventHandler {
/*package-private*/ class CollectionServiceHandler implements CarrierServiceStartEventHandler, CarrierServiceEndEventHandler {

private final Collection<ServiceTuple> tuples;
private final Vehicles allVehicles;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
import org.matsim.freight.carriers.events.CarrierServiceEndEvent;
import org.matsim.freight.carriers.events.CarrierServiceStartEvent;
import org.matsim.freight.carriers.events.CarrierTourStartEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.FreightServiceStartEventHandler;
import org.matsim.freight.carriers.events.eventhandler.FreightTourStartEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierServiceStartEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierTourStartEventHandler;

import java.util.ArrayList;
import java.util.Collection;

/*package-private*/ class LinearCostTracker implements AfterMobsimListener, LSPSimulationTracker<LogisticChain>,
LinkEnterEventHandler,
VehicleLeavesTrafficEventHandler,
FreightTourStartEventHandler,
FreightServiceStartEventHandler,
FreightServiceEndEventHandler,
CarrierTourStartEventHandler,
CarrierServiceStartEventHandler,
CarrierServiceEndEventHandler,
LinkLeaveEventHandler {

private final Collection<EventHandler> eventHandlers;
Expand Down Expand Up @@ -155,22 +155,22 @@ public void reset(int iteration) {
}
@Override public void handleEvent( CarrierTourStartEvent event ){
for( EventHandler eventHandler : this.eventHandlers ){
if ( eventHandler instanceof FreightTourStartEventHandler) {
((FreightTourStartEventHandler) eventHandler).handleEvent( event );
if ( eventHandler instanceof CarrierTourStartEventHandler) {
((CarrierTourStartEventHandler) eventHandler).handleEvent( event );
}
}
}
@Override public void handleEvent( CarrierServiceEndEvent event ){
for( EventHandler eventHandler : this.eventHandlers ){
if ( eventHandler instanceof FreightServiceEndEventHandler) {
((FreightServiceEndEventHandler) eventHandler).handleEvent( event );
if ( eventHandler instanceof CarrierServiceEndEventHandler) {
((CarrierServiceEndEventHandler) eventHandler).handleEvent( event );
}
}
}
@Override public void handleEvent( CarrierServiceStartEvent event ){
for( EventHandler eventHandler : this.eventHandlers ){
if ( eventHandler instanceof FreightServiceStartEventHandler) {
((FreightServiceStartEventHandler) eventHandler).handleEvent( event );
if ( eventHandler instanceof CarrierServiceStartEventHandler) {
((CarrierServiceStartEventHandler) eventHandler).handleEvent( event );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
import org.matsim.api.core.v01.Scenario;
import org.matsim.freight.carriers.*;
import org.matsim.freight.carriers.events.CarrierTourStartEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightTourStartEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierTourStartEventHandler;

import java.util.Collection;

/*package-private*/ class TourStartHandler implements FreightTourStartEventHandler {
/*package-private*/ class TourStartHandler implements CarrierTourStartEventHandler {

private static final Logger log = LogManager.getLogger(TourStartHandler.class);
private final Carriers carriers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@

package org.matsim.freight.logistics.io;

import org.matsim.freight.logistics.*;
import org.matsim.freight.logistics.resourceImplementations.transshipmentHub.TransshipmentHubResource;
import org.matsim.freight.logistics.shipment.LSPShipment;
import org.matsim.freight.logistics.shipment.ShipmentPlanElement;
import org.matsim.freight.logistics.shipment.ShipmentUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.core.gbl.Gbl;
import org.matsim.core.utils.collections.Tuple;
import org.matsim.core.utils.io.MatsimXmlWriter;
import org.matsim.core.utils.io.UncheckedIOException;
import org.matsim.freight.logistics.LSP;
import org.matsim.freight.logistics.*;
import org.matsim.freight.logistics.resourceImplementations.transshipmentHub.TransshipmentHubResource;
import org.matsim.freight.logistics.shipment.LSPShipment;
import org.matsim.freight.logistics.shipment.ShipmentPlanElement;
import org.matsim.freight.logistics.shipment.ShipmentUtils;

import java.io.BufferedWriter;
import java.io.IOException;
Expand Down Expand Up @@ -84,7 +84,7 @@ public void write(String filename) {
}
}

private void writeRootElement() throws UncheckedIOException, IOException {
private void writeRootElement() throws IOException {
List<Tuple<String, String>> atts = new ArrayList<Tuple<String, String>>();
atts.add(createTuple(XMLNS, MatsimXmlWriter.MATSIM_NAMESPACE));
atts.add(createTuple(XMLNS + ":xsi", DEFAULTSCHEMANAMESPACELOCATION));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
import org.matsim.core.controler.listener.AfterMobsimListener;
import org.matsim.freight.carriers.CarrierService;
import org.matsim.freight.carriers.events.CarrierServiceEndEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler;

public class CollectionServiceEndEventHandler implements AfterMobsimListener, FreightServiceEndEventHandler, LSPSimulationTracker<LSPShipment> {
public class CollectionServiceEndEventHandler implements AfterMobsimListener, CarrierServiceEndEventHandler, LSPSimulationTracker<LSPShipment> {
// Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23

private final CarrierService carrierService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
import org.matsim.freight.carriers.Tour.ServiceActivity;
import org.matsim.freight.carriers.Tour.TourElement;
import org.matsim.freight.carriers.events.CarrierTourEndEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightTourEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierTourEndEventHandler;

public class CollectionTourEndEventHandler implements AfterMobsimListener, FreightTourEndEventHandler, LSPSimulationTracker<LSPShipment> {
public class CollectionTourEndEventHandler implements AfterMobsimListener, CarrierTourEndEventHandler, LSPSimulationTracker<LSPShipment> {
// Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23

private final CarrierService carrierService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
import org.matsim.core.controler.listener.AfterMobsimListener;
import org.matsim.freight.carriers.CarrierService;
import org.matsim.freight.carriers.events.CarrierServiceStartEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightServiceStartEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierServiceStartEventHandler;

public class DistributionServiceStartEventHandler implements AfterMobsimListener, FreightServiceStartEventHandler, LSPSimulationTracker<LSPShipment> {
public class DistributionServiceStartEventHandler implements AfterMobsimListener, CarrierServiceStartEventHandler, LSPSimulationTracker<LSPShipment> {
// Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23

private final CarrierService carrierService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
import org.matsim.freight.carriers.Tour.ServiceActivity;
import org.matsim.freight.carriers.Tour.TourElement;
import org.matsim.freight.carriers.events.CarrierTourStartEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightTourStartEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierTourStartEventHandler;

public class DistributionTourStartEventHandler implements FreightTourStartEventHandler, LSPSimulationTracker<LSPShipment> {
public class DistributionTourStartEventHandler implements CarrierTourStartEventHandler, LSPSimulationTracker<LSPShipment> {
// Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23

private final CarrierService carrierService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
import org.matsim.freight.carriers.Tour.ServiceActivity;
import org.matsim.freight.carriers.Tour.TourElement;
import org.matsim.freight.carriers.events.CarrierTourEndEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightTourEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierTourEndEventHandler;

public class MainRunTourEndEventHandler implements AfterMobsimListener, FreightTourEndEventHandler, LSPSimulationTracker<LSPShipment> {
public class MainRunTourEndEventHandler implements AfterMobsimListener, CarrierTourEndEventHandler, LSPSimulationTracker<LSPShipment> {
// Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23

private final CarrierService carrierService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
import org.matsim.freight.carriers.Tour.ServiceActivity;
import org.matsim.freight.carriers.Tour.TourElement;
import org.matsim.freight.carriers.events.CarrierTourStartEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightTourStartEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierTourStartEventHandler;

public class MainRunTourStartEventHandler implements AfterMobsimListener, FreightTourStartEventHandler, LSPSimulationTracker<LSPShipment> {
public class MainRunTourStartEventHandler implements AfterMobsimListener, CarrierTourStartEventHandler, LSPSimulationTracker<LSPShipment> {
// Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
import org.matsim.freight.carriers.Tour.ServiceActivity;
import org.matsim.freight.carriers.Tour.TourElement;
import org.matsim.freight.carriers.events.CarrierTourEndEvent;
import org.matsim.freight.carriers.events.eventhandler.FreightTourEndEventHandler;
import org.matsim.freight.carriers.events.eventhandler.CarrierTourEndEventHandler;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class TransshipmentHubTourEndEventHandler implements AfterMobsimListener, LSPSimulationTracker<LSPResource>, FreightTourEndEventHandler {
public class TransshipmentHubTourEndEventHandler implements AfterMobsimListener, LSPSimulationTracker<LSPResource>, CarrierTourEndEventHandler {
// Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23

private final Scenario scenario;
Expand Down

0 comments on commit 449ecac

Please sign in to comment.