Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the updates from matsim 14 emissions contrib #140

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
public class IDFConfigurator extends EqasimConfigurator {
public void adjustScenario(Scenario scenario) {
// if there is a vehicles file defined in config, manually assign them to their agents
// TODO : since matsim 14 it is now possible to assign vehicles directly in the xml file.
// That should be the preferred way of assigning vehicles.
Config config = scenario.getConfig();
if (config.qsim().getVehiclesSource() == QSimConfigGroup.VehiclesSource.fromVehiclesData) {
for (Person person : scenario.getPopulation().getPersons().values()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.eqasim.ile_de_france.emissions;
// this is a modified copy of a private contribs.emissions class
// TODO: will need to be updated after the matsim 14 release to profit from https://github.com/matsim-org/matsim-libs/pull/1859
// TODO: will need to be updated after the matsim 15 release to profit from https://github.com/matsim-org/matsim-libs/pull/2081

import org.matsim.contrib.emissions.Pollutant;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.eqasim.ile_de_france.emissions;
// this is a modified copy of a private contribs.emissions class
// TODO: will need to be updated after the matsim 14 release to profit from https://github.com/matsim-org/matsim-libs/pull/1859
// TODO: will need to be updated after the matsim 15 release to profit from https://github.com/matsim-org/matsim-libs/pull/2081

import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.network.Link;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.eqasim.ile_de_france.IDFConfigurator;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.network.NetworkWriter;
import org.matsim.contrib.emissions.EmissionModule;
import org.matsim.contrib.emissions.OsmHbefaMapping;
import org.matsim.contrib.emissions.utils.EmissionsConfigGroup;
import org.matsim.core.api.experimental.events.EventsManager;
import org.matsim.core.config.CommandLine;
Expand Down Expand Up @@ -35,9 +35,8 @@ public static void main(String[] args) throws CommandLine.ConfigurationException
Config config = ConfigUtils.loadConfig(cmd.getOptionStrict("config-path"), configGroups);
cmd.applyConfiguration(config);

EmissionsConfigGroup emissionsConfig = (EmissionsConfigGroup) config.getModule("emissions");
EmissionsConfigGroup emissionsConfig = (EmissionsConfigGroup) config.getModules().get("emissions");
emissionsConfig.setHbefaVehicleDescriptionSource(EmissionsConfigGroup.HbefaVehicleDescriptionSource.asEngineInformationAttributes);
emissionsConfig.setHbefaRoadTypeSource(EmissionsConfigGroup.HbefaRoadTypeSource.fromLinkAttributes);
emissionsConfig.setDetailedVsAverageLookupBehavior(
EmissionsConfigGroup.DetailedVsAverageLookupBehavior.tryDetailedThenTechnologyAverageThenAverageTable);
emissionsConfig.setNonScenarioVehicles(EmissionsConfigGroup.NonScenarioVehicles.abort);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import org.matsim.core.utils.gis.ShapeFileReader;
import org.opengis.feature.simple.SimpleFeature;

// TODO: will need to be updated after the matsim 14 release to profit from https://github.com/matsim-org/matsim-libs/pull/1859

public class RunComputeEmissionsGrid {

public static void main(String[] args) throws CommandLine.ConfigurationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import java.util.*;

// TODO: will need to be updated after the matsim 14 release to profit from https://github.com/matsim-org/matsim-libs/pull/1859
// TODO: will need to be updated after the matsim 15 release to profit from https://github.com/matsim-org/matsim-libs/pull/2081

public class RunExportEmissionsNetwork {

Expand All @@ -45,6 +45,7 @@ public static void main(String[] args) throws CommandLine.ConfigurationException
int timeBinSize = Integer.parseInt(cmd.getOption("time-bin-size").orElse("3600"));

EventsManager eventsManager = EventsUtils.createEventsManager();

EmissionsOnLinkEventHandler handler = new EmissionsOnLinkEventHandler(timeBinSize);

EmissionEventsReader eventsReader = new EmissionEventsReader(eventsManager);
Expand Down