diff --git a/core/src/main/java/org/eqasim/core/analysis/run/RunLegAnalysis.java b/core/src/main/java/org/eqasim/core/analysis/run/RunLegAnalysis.java index d95427ef0..8c6d6d4c9 100644 --- a/core/src/main/java/org/eqasim/core/analysis/run/RunLegAnalysis.java +++ b/core/src/main/java/org/eqasim/core/analysis/run/RunLegAnalysis.java @@ -6,7 +6,8 @@ import java.util.Optional; import java.util.stream.Collectors; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.eqasim.core.analysis.DefaultPersonAnalysisFilter; import org.eqasim.core.analysis.DistanceUnit; import org.eqasim.core.analysis.PersonAnalysisFilter; @@ -28,7 +29,7 @@ import org.matsim.facilities.MatsimFacilitiesReader; public class RunLegAnalysis { - private final static Logger logger = Logger.getLogger(RunLegAnalysis.class); + private final static Logger logger = LogManager.getLogger(RunLegAnalysis.class); static public void main(String[] args) throws IOException, ConfigurationException { CommandLine cmd = new CommandLine.Builder(args) // diff --git a/core/src/main/java/org/eqasim/core/analysis/run/RunTripAnalysis.java b/core/src/main/java/org/eqasim/core/analysis/run/RunTripAnalysis.java index f25438a3e..0c9f32f90 100644 --- a/core/src/main/java/org/eqasim/core/analysis/run/RunTripAnalysis.java +++ b/core/src/main/java/org/eqasim/core/analysis/run/RunTripAnalysis.java @@ -6,7 +6,8 @@ import java.util.Optional; import java.util.stream.Collectors; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.eqasim.core.analysis.DefaultPersonAnalysisFilter; import org.eqasim.core.analysis.DistanceUnit; import org.eqasim.core.analysis.PersonAnalysisFilter; @@ -30,7 +31,7 @@ import org.matsim.facilities.MatsimFacilitiesReader; public class RunTripAnalysis { - private final static Logger logger = Logger.getLogger(RunTripAnalysis.class); + private final static Logger logger = LogManager.getLogger(RunTripAnalysis.class); static public void main(String[] args) throws IOException, ConfigurationException { CommandLine cmd = new CommandLine.Builder(args) // diff --git a/core/src/main/java/org/eqasim/core/components/headway/HeadwayCalculator.java b/core/src/main/java/org/eqasim/core/components/headway/HeadwayCalculator.java index 94ee33343..cae3293f8 100644 --- a/core/src/main/java/org/eqasim/core/components/headway/HeadwayCalculator.java +++ b/core/src/main/java/org/eqasim/core/components/headway/HeadwayCalculator.java @@ -4,6 +4,8 @@ import org.matsim.facilities.Facility; import org.matsim.utils.objectattributes.attributable.Attributes; +import org.matsim.utils.objectattributes.attributable.AttributesImpl; +import org.matsim.utils.objectattributes.attributable.AttributesUtils; import ch.sbb.matsim.routing.pt.raptor.RaptorRoute; import ch.sbb.matsim.routing.pt.raptor.RaptorRoute.RoutePart; @@ -26,7 +28,7 @@ public double calculateHeadway_min(Facility originFacility, Facility destination double latestDepartureTime = departureTime + afterDepartureOffset; List routes = raptor.calcRoutes(originFacility, destinationFacilty, earliestDepartureTime, - departureTime, latestDepartureTime, null, new Attributes()); + departureTime, latestDepartureTime, null, new AttributesImpl()); int numberOfPtRoutes = 0; diff --git a/core/src/main/java/org/eqasim/core/components/transit/events/PublicTransitEvent.java b/core/src/main/java/org/eqasim/core/components/transit/events/PublicTransitEvent.java index 2c5831a05..9b4938c90 100644 --- a/core/src/main/java/org/eqasim/core/components/transit/events/PublicTransitEvent.java +++ b/core/src/main/java/org/eqasim/core/components/transit/events/PublicTransitEvent.java @@ -4,8 +4,8 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; +import org.matsim.api.core.v01.events.HasPersonId; import org.matsim.api.core.v01.population.Person; -import org.matsim.core.api.internal.HasPersonId; import org.matsim.pt.transitSchedule.api.TransitLine; import org.matsim.pt.transitSchedule.api.TransitRoute; import org.matsim.pt.transitSchedule.api.TransitStopFacility; diff --git a/core/src/main/java/org/eqasim/core/misc/ParallelProgress.java b/core/src/main/java/org/eqasim/core/misc/ParallelProgress.java index d376043ef..2d7f32601 100644 --- a/core/src/main/java/org/eqasim/core/misc/ParallelProgress.java +++ b/core/src/main/java/org/eqasim/core/misc/ParallelProgress.java @@ -1,9 +1,10 @@ package org.eqasim.core.misc; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public class ParallelProgress { - private final Logger logger = Logger.getLogger(ParallelProgress.class); + private final Logger logger = LogManager.getLogger(ParallelProgress.class); private final Thread thread; private final long totalCount; diff --git a/core/src/main/java/org/eqasim/core/scenario/cutter/facilities/FacilitiesCutter.java b/core/src/main/java/org/eqasim/core/scenario/cutter/facilities/FacilitiesCutter.java index 6f2d99e2e..1c54bbfb1 100644 --- a/core/src/main/java/org/eqasim/core/scenario/cutter/facilities/FacilitiesCutter.java +++ b/core/src/main/java/org/eqasim/core/scenario/cutter/facilities/FacilitiesCutter.java @@ -4,7 +4,8 @@ import java.util.HashSet; import java.util.Iterator; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.eqasim.core.scenario.cutter.extent.ScenarioExtent; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.population.Activity; @@ -16,7 +17,7 @@ import org.matsim.facilities.ActivityFacility; public class FacilitiesCutter { - private final static Logger log = Logger.getLogger(FacilitiesCutter.class); + private final static Logger log = LogManager.getLogger(FacilitiesCutter.class); private final ScenarioExtent extent; private final Collection> usedFacilityIds = new HashSet<>(); diff --git a/core/src/main/java/org/eqasim/core/scenario/cutter/network/NetworkCutter.java b/core/src/main/java/org/eqasim/core/scenario/cutter/network/NetworkCutter.java index 7b49c49b1..6496b7ca9 100644 --- a/core/src/main/java/org/eqasim/core/scenario/cutter/network/NetworkCutter.java +++ b/core/src/main/java/org/eqasim/core/scenario/cutter/network/NetworkCutter.java @@ -8,7 +8,8 @@ import java.util.Optional; import java.util.Set; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.eqasim.core.scenario.cutter.extent.ScenarioExtent; import org.eqasim.core.scenario.cutter.extent.ShapeScenarioExtent; import org.matsim.api.core.v01.Id; @@ -36,7 +37,7 @@ import org.matsim.pt.transitSchedule.api.TransitStopFacility; public class NetworkCutter { - private final static Logger log = Logger.getLogger(NetworkCutter.class); + private final static Logger log = LogManager.getLogger(NetworkCutter.class); private final ScenarioExtent extent; private final MinimumNetworkFinder minimumNetworkFinder; diff --git a/core/src/main/java/org/eqasim/core/scenario/cutter/transit/TransitScheduleCutter.java b/core/src/main/java/org/eqasim/core/scenario/cutter/transit/TransitScheduleCutter.java index b8151b3cc..d940a5eb6 100644 --- a/core/src/main/java/org/eqasim/core/scenario/cutter/transit/TransitScheduleCutter.java +++ b/core/src/main/java/org/eqasim/core/scenario/cutter/transit/TransitScheduleCutter.java @@ -7,7 +7,8 @@ import java.util.Set; import java.util.stream.Collectors; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.eqasim.core.scenario.cutter.extent.ScenarioExtent; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; @@ -25,7 +26,7 @@ import org.matsim.pt.transitSchedule.api.TransitStopFacility; public class TransitScheduleCutter { - private final static Logger log = Logger.getLogger(TransitScheduleCutter.class); + private final static Logger log = LogManager.getLogger(TransitScheduleCutter.class); private final ScenarioExtent extent; private final StopSequenceCrossingPointFinder crossingPointFinder; diff --git a/core/src/main/java/org/eqasim/core/scenario/cutter/transit/TransitVehiclesCutter.java b/core/src/main/java/org/eqasim/core/scenario/cutter/transit/TransitVehiclesCutter.java index ef15d0370..be6a844f5 100644 --- a/core/src/main/java/org/eqasim/core/scenario/cutter/transit/TransitVehiclesCutter.java +++ b/core/src/main/java/org/eqasim/core/scenario/cutter/transit/TransitVehiclesCutter.java @@ -3,7 +3,8 @@ import java.util.HashSet; import java.util.Set; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.matsim.pt.transitSchedule.api.Departure; import org.matsim.pt.transitSchedule.api.TransitLine; import org.matsim.pt.transitSchedule.api.TransitRoute; @@ -12,7 +13,7 @@ import org.matsim.vehicles.Vehicles; public class TransitVehiclesCutter { - private final static Logger log = Logger.getLogger(TransitVehiclesCutter.class); + private final static Logger log = LogManager.getLogger(TransitVehiclesCutter.class); private final TransitSchedule schedule; diff --git a/core/src/main/java/org/eqasim/core/scenario/preparation/AdjustLinkLength.java b/core/src/main/java/org/eqasim/core/scenario/preparation/AdjustLinkLength.java index 9cc99520e..da9e61013 100644 --- a/core/src/main/java/org/eqasim/core/scenario/preparation/AdjustLinkLength.java +++ b/core/src/main/java/org/eqasim/core/scenario/preparation/AdjustLinkLength.java @@ -1,12 +1,13 @@ package org.eqasim.core.scenario.preparation; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; import org.matsim.core.utils.geometry.CoordUtils; public class AdjustLinkLength { - private final Logger logger = Logger.getLogger(AdjustLinkLength.class); + private final Logger logger = LogManager.getLogger(AdjustLinkLength.class); public void run(Network network) { int infiniteSpeedCount = 0; diff --git a/core/src/main/java/org/eqasim/core/scenario/validation/ScenarioValidator.java b/core/src/main/java/org/eqasim/core/scenario/validation/ScenarioValidator.java index 7d33003c0..7e6751c17 100644 --- a/core/src/main/java/org/eqasim/core/scenario/validation/ScenarioValidator.java +++ b/core/src/main/java/org/eqasim/core/scenario/validation/ScenarioValidator.java @@ -1,6 +1,7 @@ package org.eqasim.core.scenario.validation; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Coord; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; @@ -15,7 +16,7 @@ import org.matsim.facilities.ActivityFacility; public class ScenarioValidator { - private final static Logger logger = Logger.getLogger(ScenarioValidator.class); + private final static Logger logger = LogManager.getLogger(ScenarioValidator.class); public boolean checkSpatialConsistency(Scenario scenario) { boolean errorsFound = false; diff --git a/core/src/main/java/org/eqasim/core/simulation/calibration/CalibrationOutputListener.java b/core/src/main/java/org/eqasim/core/simulation/calibration/CalibrationOutputListener.java index c5b8e761b..569d335e0 100644 --- a/core/src/main/java/org/eqasim/core/simulation/calibration/CalibrationOutputListener.java +++ b/core/src/main/java/org/eqasim/core/simulation/calibration/CalibrationOutputListener.java @@ -9,7 +9,8 @@ import java.io.OutputStreamWriter; import java.nio.file.Files; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.eqasim.core.analysis.trips.TripListener; import org.eqasim.core.components.config.EqasimConfigGroup; import org.matsim.core.config.groups.ControlerConfigGroup; @@ -25,7 +26,7 @@ @Singleton public class CalibrationOutputListener implements IterationEndsListener, ShutdownListener { - private final Logger logger = Logger.getLogger(CalibrationOutputListener.class); + private final Logger logger = LogManager.getLogger(CalibrationOutputListener.class); private static final String OUTPUT_FILE_NAME_JSON = "calibration.json"; private static final String OUTPUT_FILE_NAME_HTML = "calibration.html"; diff --git a/core/src/main/java/org/eqasim/core/simulation/mode_choice/ParameterDefinition.java b/core/src/main/java/org/eqasim/core/simulation/mode_choice/ParameterDefinition.java index 515cec1fd..ee1dd11b8 100644 --- a/core/src/main/java/org/eqasim/core/simulation/mode_choice/ParameterDefinition.java +++ b/core/src/main/java/org/eqasim/core/simulation/mode_choice/ParameterDefinition.java @@ -6,7 +6,8 @@ import java.util.HashMap; import java.util.Map; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.matsim.core.config.CommandLine; import org.matsim.core.config.CommandLine.ConfigurationException; @@ -16,7 +17,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; public interface ParameterDefinition { - final static Logger logger = Logger.getLogger(ParameterDefinition.class); + final static Logger logger = LogManager.getLogger(ParameterDefinition.class); static public void applyCommandLine(String prefix, CommandLine cmd, ParameterDefinition parameterDefinition) { Map values = new HashMap<>(); diff --git a/core/src/main/java/org/eqasim/core/tools/routing/RunBatchPublicTransportRouter.java b/core/src/main/java/org/eqasim/core/tools/routing/RunBatchPublicTransportRouter.java index 410382945..fecaf654c 100644 --- a/core/src/main/java/org/eqasim/core/tools/routing/RunBatchPublicTransportRouter.java +++ b/core/src/main/java/org/eqasim/core/tools/routing/RunBatchPublicTransportRouter.java @@ -11,7 +11,8 @@ import java.util.Set; import org.apache.commons.lang3.tuple.Pair; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.eqasim.core.components.headway.HeadwayCalculator; import org.eqasim.core.components.headway.HeadwayImputerModule; import org.eqasim.core.misc.InjectorBuilder; @@ -50,7 +51,7 @@ import ch.sbb.matsim.config.SwissRailRaptorConfigGroup; public class RunBatchPublicTransportRouter { - private final static Logger logger = Logger.getLogger(RunBatchPublicTransportRouter.class); + private final static Logger logger = LogManager.getLogger(RunBatchPublicTransportRouter.class); static public void main(String[] args) throws ConfigurationException, JsonGenerationException, JsonMappingException, IOException, InterruptedException { diff --git a/core/src/test/java/org/eqasim/mode_choice/TestSpecialModeChoiceCases.java b/core/src/test/java/org/eqasim/mode_choice/TestSpecialModeChoiceCases.java index 167023d44..29d1f93a8 100644 --- a/core/src/test/java/org/eqasim/mode_choice/TestSpecialModeChoiceCases.java +++ b/core/src/test/java/org/eqasim/mode_choice/TestSpecialModeChoiceCases.java @@ -42,7 +42,7 @@ import org.matsim.core.router.RoutingRequest; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.timing.TimeInterpretationModule; -import org.matsim.utils.objectattributes.attributable.Attributes; +import org.matsim.utils.objectattributes.attributable.AttributesImpl; import com.google.inject.Inject; import com.google.inject.Injector; @@ -188,7 +188,7 @@ static private void appendTrip(List trips, String preced destinationActivity.setMaximumDuration(3600.0); DiscreteModeChoiceTrip trip = new DiscreteModeChoiceTrip(originActivity, destinationActivity, "walk", - Collections.emptyList(), 0, trips.size(), trips.size(), new Attributes()); + Collections.emptyList(), 0, trips.size(), trips.size(), new AttributesImpl()); trips.add(trip); } diff --git a/examples/src/main/java/org/eqasim/examples/corsica_drt/RunCorsicaDrtSimulation.java b/examples/src/main/java/org/eqasim/examples/corsica_drt/RunCorsicaDrtSimulation.java index 38a7d840d..e34ec37df 100644 --- a/examples/src/main/java/org/eqasim/examples/corsica_drt/RunCorsicaDrtSimulation.java +++ b/examples/src/main/java/org/eqasim/examples/corsica_drt/RunCorsicaDrtSimulation.java @@ -74,18 +74,18 @@ static public void main(String[] args) throws ConfigurationException { config.addModule(multiModeDrtConfig); DrtConfigGroup drtConfig = new DrtConfigGroup(); - drtConfig.setMode("drt"); - drtConfig.setOperationalScheme(OperationalScheme.door2door); - drtConfig.setStopDuration(15.0); - drtConfig.setMaxWaitTime(600.0); - drtConfig.setMaxTravelTimeAlpha(1.5); - drtConfig.setMaxTravelTimeBeta(300.0); - drtConfig.setVehiclesFile(Resources.getResource("corsica_drt/drt_vehicles.xml").toString()); + drtConfig.mode = "drt"; + drtConfig.operationalScheme = OperationalScheme.door2door; + drtConfig.stopDuration = 15.0; + drtConfig.maxWaitTime = 600.0; + drtConfig.maxTravelTimeAlpha = 1.5; + drtConfig.maxTravelTimeBeta = 300.0; + drtConfig.vehiclesFile = Resources.getResource("corsica_drt/drt_vehicles.xml").toString(); DrtInsertionSearchParams searchParams = new SelectiveInsertionSearchParams(); drtConfig.addDrtInsertionSearchParams(searchParams); - multiModeDrtConfig.addDrtConfig(drtConfig); + multiModeDrtConfig.addParameterSet(drtConfig); DrtConfigs.adjustMultiModeDrtConfig(multiModeDrtConfig, config.planCalcScore(), config.plansCalcRoute()); // Additional requirements diff --git a/pom.xml b/pom.xml index 392b6d3bb..ff5d9c37b 100644 --- a/pom.xml +++ b/pom.xml @@ -20,9 +20,9 @@ - 11 - 11 - 14.0 + 17 + 17 + 15.0