From bb3974efc4006f560c82ec24fa945c15fa257780 Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Mon, 4 Mar 2024 23:40:04 +0100 Subject: [PATCH] again debugging --- .../EmissionsPerVehicleEventHandler.java | 16 +++++++++------- .../vsp/emissions/RunFoodEmissions2024.java | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/matsim/vsp/emissions/EmissionsPerVehicleEventHandler.java b/src/main/java/org/matsim/vsp/emissions/EmissionsPerVehicleEventHandler.java index e90aa65..0a36693 100644 --- a/src/main/java/org/matsim/vsp/emissions/EmissionsPerVehicleEventHandler.java +++ b/src/main/java/org/matsim/vsp/emissions/EmissionsPerVehicleEventHandler.java @@ -24,6 +24,7 @@ import java.util.LinkedHashMap; import java.util.Map; import org.matsim.api.core.v01.Id; +import org.matsim.api.core.v01.events.Event; import org.matsim.contrib.emissions.Pollutant; import org.matsim.contrib.emissions.analysis.EmissionsByPollutant; import org.matsim.contrib.emissions.events.ColdEmissionEvent; @@ -78,15 +79,15 @@ public void reset(int iteration) { @Override public void handleEvent(WarmEmissionEvent event) { - handleEmissionEvent(event.getVehicleId(), event.getWarmEmissions()); + handleEmissionEvent( event.getVehicleId(), event.getWarmEmissions(), event); } @Override public void handleEvent(ColdEmissionEvent event) { - handleEmissionEvent(event.getVehicleId(), event.getColdEmissions()); + handleEmissionEvent(event.getVehicleId(), event.getColdEmissions(), event); } - private void handleEmissionEvent(Id vehicleId, Map emissions) { + private void handleEmissionEvent(Id vehicleId, Map emissions, Event event) { EmissionsByPollutant emissionsByPollutant = new EmissionsByPollutant(emissions); @@ -103,9 +104,10 @@ private void handleEmissionEvent(Id vehicleId, Map e // System.out.println("### vehicle2Pollutants " + vehicle2pollutants.get(vehicleId.toString()).toString()); // } -// if ( vehicle2pollutants.get(FREIGHT_REWE_VERBRAUCHERMARKT_TROCKEN_VEH_MEDIUM_18_T_ELECTRO_160444_1).get(Pollutant.CO).doubleValue() != tempValue.doubleValue()){ -// System.out.println("JETZT wurde was modifiziert: " + time + "vehid: " + vehicleId + "; emissions: "+ emissions.toString()); -// tempValue = vehicle2pollutants.get(FREIGHT_REWE_VERBRAUCHERMARKT_TROCKEN_VEH_MEDIUM_18_T_ELECTRO_160444_1).get(Pollutant.CO); -// } + if ( vehicle2pollutants.get(FREIGHT_REWE_VERBRAUCHERMARKT_TROCKEN_VEH_MEDIUM_18_T_ELECTRO_160444_1).getEmission(Pollutant.CO) != tempValue.doubleValue()){ + System.out.println("JETZT wurde was modifiziert: " + "vehid: " + vehicleId + "; emissions: "+ emissions.toString()); + System.out.println("EVENT:" + event.toString()); + tempValue = vehicle2pollutants.get(FREIGHT_REWE_VERBRAUCHERMARKT_TROCKEN_VEH_MEDIUM_18_T_ELECTRO_160444_1).getEmission(Pollutant.CO); + } } } diff --git a/src/main/java/org/matsim/vsp/emissions/RunFoodEmissions2024.java b/src/main/java/org/matsim/vsp/emissions/RunFoodEmissions2024.java index d93ed94..93187ff 100644 --- a/src/main/java/org/matsim/vsp/emissions/RunFoodEmissions2024.java +++ b/src/main/java/org/matsim/vsp/emissions/RunFoodEmissions2024.java @@ -39,7 +39,7 @@ public class RunFoodEmissions2024 { public static void main(String[] args) throws IOException { - final String runDirectory = "/Users/kturner/git-and-svn/shared-svn/projects/freight/studies/UpdateEventsfromEarlierStudies/foodRetailing_wo_rangeConstraint/71_ICEVBEV_NwCE_BVWP_10000it_DCoff_noTax"; //KMT + final String runDirectory = "/Users/kturner/git-and-svn/shared-svn/projects/freight/studies/UpdateEventsfromEarlierStudies/foodRetailing_wo_rangeConstraint/72_ICEVBEV_NwCE_BVWP_10000it_DCoff_Tax25"; //KMT final String hbefaFileWarmDet = "original-input-data/HBEFA_summarized_final2.csv"; //TODO: In verschlüsselte Dateien integrieren und ins public SVN laden. DAbei nochmal auf Spalten achten. mMn ist hier emConcept und Technology verdreht -.- //Tabelle mit Endung2 hat die Spalten korrigiert.