-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/vdf-sparse-horizon
- Loading branch information
Showing
46 changed files
with
1,186 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
core/src/main/java/org/eqasim/core/components/emissions/SafeOsmHbefaMapping.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.eqasim.core.components.emissions; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.matsim.api.core.v01.network.Link; | ||
import org.matsim.contrib.emissions.HbefaRoadTypeMapping; | ||
import org.matsim.contrib.emissions.OsmHbefaMapping; | ||
import org.matsim.core.network.NetworkUtils; | ||
|
||
// This class is designed to wrap the matsim-libs emissions contrib OsmHbefaMapping by providing a default hbefa type for unknown osm keys (instead of throwing a RuntimeException | ||
public class SafeOsmHbefaMapping extends HbefaRoadTypeMapping { | ||
|
||
private final static OsmHbefaMapping osmHbefaMapping = OsmHbefaMapping.build(); | ||
private final static Logger log = LogManager.getLogger(SafeOsmHbefaMapping.class); | ||
public static String defaultType = "URB/Access/30"; | ||
|
||
@Override | ||
public String determineHbefaType(Link link) { | ||
String result; | ||
try { | ||
result = osmHbefaMapping.determineHbefaType(link); | ||
} catch (RuntimeException runtimeException) { | ||
String type = (String) link.getAttributes().getAttribute(NetworkUtils.TYPE); | ||
log.warn("'" + type + "' not in hbefa map; setting to " + defaultType); | ||
result = defaultType; | ||
} | ||
return result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.