From 3f22d5fb74e6dbc2bdaf0eddf2e754b6716517f5 Mon Sep 17 00:00:00 2001 From: Valentin LE BESCOND Date: Mon, 4 Jul 2022 12:12:29 +0200 Subject: [PATCH 1/2] make emissions analysis classes public --- .../matsim/contrib/emissions/analysis/EmissionsByPollutant.java | 2 +- .../contrib/emissions/analysis/EmissionsOnLinkEventHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsByPollutant.java b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsByPollutant.java index e5be2f3b76c..c9f200ccb97 100644 --- a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsByPollutant.java +++ b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsByPollutant.java @@ -31,7 +31,7 @@ * Sums up emissions by pollutant. Basically wraps a hash map but is here for better * readability of {@link org.matsim.contrib.emissions.analysis.EmissionsOnLinkEventHandler} */ -class EmissionsByPollutant { +public class EmissionsByPollutant { // The EmissionsByPollutant potentially adds up the same emissions coming from cold and warm. Thus, this cannot be combined into the enum approach // without some thinking. kai, jan'20 // yyyy todo I think that this now can be done. kai, jan'20 diff --git a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsOnLinkEventHandler.java b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsOnLinkEventHandler.java index 11fe32d8bd1..d7cacde6ca0 100644 --- a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsOnLinkEventHandler.java +++ b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsOnLinkEventHandler.java @@ -36,7 +36,7 @@ /** * Collects Warm- and Cold-Emission-Events by time bin and by link-id */ -class EmissionsOnLinkEventHandler implements WarmEmissionEventHandler, ColdEmissionEventHandler { +public class EmissionsOnLinkEventHandler implements WarmEmissionEventHandler, ColdEmissionEventHandler { private final TimeBinMap, EmissionsByPollutant>> timeBins; From 6774f9773064759f344c8b4c34d06267997ea844 Mon Sep 17 00:00:00 2001 From: Valentin LE BESCOND Date: Fri, 8 Jul 2022 11:52:23 +0200 Subject: [PATCH 2/2] make class methods public too --- .../emissions/analysis/EmissionsByPollutant.java | 10 +++++----- .../analysis/EmissionsOnLinkEventHandler.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsByPollutant.java b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsByPollutant.java index c9f200ccb97..6b1eda64b73 100644 --- a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsByPollutant.java +++ b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsByPollutant.java @@ -38,23 +38,23 @@ public class EmissionsByPollutant { private final Map emissionByPollutant; - EmissionsByPollutant(Map emissions) { + public EmissionsByPollutant(Map emissions) { this.emissionByPollutant = emissions; } - void addEmissions( Map emissions ) { + public void addEmissions( Map emissions ) { emissions.forEach(this::addEmission); } - double addEmission(Pollutant pollutant, double value) { + public double addEmission(Pollutant pollutant, double value) { return emissionByPollutant.merge(pollutant, value, Double::sum); } - Map getEmissions() { + public Map getEmissions() { return emissionByPollutant; } - double getEmission(Pollutant pollutant) { + public double getEmission(Pollutant pollutant) { return emissionByPollutant.get(pollutant); } diff --git a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsOnLinkEventHandler.java b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsOnLinkEventHandler.java index d7cacde6ca0..b9728885582 100644 --- a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsOnLinkEventHandler.java +++ b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/analysis/EmissionsOnLinkEventHandler.java @@ -40,7 +40,7 @@ public class EmissionsOnLinkEventHandler implements WarmEmissionEventHandler, Co private final TimeBinMap, EmissionsByPollutant>> timeBins; - EmissionsOnLinkEventHandler(double timeBinSizeInSeconds) { + public EmissionsOnLinkEventHandler(double timeBinSizeInSeconds) { this.timeBins = new TimeBinMap<>(timeBinSizeInSeconds); } @@ -50,7 +50,7 @@ public class EmissionsOnLinkEventHandler implements WarmEmissionEventHandler, Co * * @return Collected emissions by time bin and by link id */ - TimeBinMap, EmissionsByPollutant>> getTimeBins() { + public TimeBinMap, EmissionsByPollutant>> getTimeBins() { return timeBins; }