From 7b95b054f791ab31c44f26e5b09fbbc9f35e7945 Mon Sep 17 00:00:00 2001 From: tschlenther Date: Wed, 19 Jun 2024 17:53:52 +0200 Subject: [PATCH] debug emission analysis: create injector and install EmissionModule --- ...elheimOfflineAirPollutionAnalysisByEngineInformation.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/matsim/analysis/emissions/KelheimOfflineAirPollutionAnalysisByEngineInformation.java b/src/main/java/org/matsim/analysis/emissions/KelheimOfflineAirPollutionAnalysisByEngineInformation.java index 099f658a..1d0c91c4 100644 --- a/src/main/java/org/matsim/analysis/emissions/KelheimOfflineAirPollutionAnalysisByEngineInformation.java +++ b/src/main/java/org/matsim/analysis/emissions/KelheimOfflineAirPollutionAnalysisByEngineInformation.java @@ -50,6 +50,7 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.AbstractModule; +import org.matsim.core.controler.Injector; import org.matsim.core.events.EventsUtils; import org.matsim.core.events.MatsimEventsReader; import org.matsim.core.network.NetworkUtils; @@ -159,6 +160,10 @@ public void install(){ } }; + com.google.inject.Injector injector = Injector.createInjector(config, module); + // Emissions module will be installed to the event handler + injector.getInstance(EmissionModule.class); + EmissionsOnLinkEventHandler emissionsEventHandler = new EmissionsOnLinkEventHandler(3600); eventsManager.addHandler(emissionsEventHandler); eventsManager.initProcessing();