Skip to content

Commit 463b59d

Browse files
Merge pull request #94 from moia-oss/master
merge master into deployment 07.05
2 parents a041bf7 + 6f9a62f commit 463b59d

File tree

89 files changed

+4279
-1319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+4279
-1319
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ matsimExamples
1212
matsim/docs/doxygen/html
1313
matsim/src/main/java/Doxyfile
1414

15+
# VS Code files
16+
.vscode
17+
1518
# ignore output directories:
1619
output/

contribs/application/pom.xml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
23

34
<parent>
45
<groupId>org.matsim</groupId>
@@ -20,12 +21,21 @@
2021
</repository>
2122
</repositories>
2223

24+
<properties>
25+
<avro.version>1.11.3</avro.version>
26+
</properties>
27+
2328
<dependencies>
2429

2530
<dependency>
2631
<groupId>tech.tablesaw</groupId>
2732
<artifactId>tablesaw-core</artifactId>
2833
</dependency>
34+
<dependency>
35+
<groupId>org.apache.avro</groupId>
36+
<artifactId>avro</artifactId>
37+
<version>${avro.version}</version>
38+
</dependency>
2939

3040
<dependency>
3141
<groupId>org.matsim.contrib</groupId>
@@ -140,4 +150,27 @@
140150
</dependency>
141151

142152
</dependencies>
153+
154+
<build>
155+
<plugins>
156+
<plugin>
157+
<groupId>org.apache.avro</groupId>
158+
<artifactId>avro-maven-plugin</artifactId>
159+
<version>${avro.version}</version>
160+
<executions>
161+
<execution>
162+
<phase>generate-sources</phase>
163+
<goals>
164+
<goal>schema</goal>
165+
</goals>
166+
<configuration>
167+
<sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
168+
<outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
169+
</configuration>
170+
</execution>
171+
</executions>
172+
</plugin>
173+
</plugins>
174+
</build>
175+
143176
</project>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"namespace": "org.matsim.application.avro",
3+
"type": "record",
4+
"name": "XYTData",
5+
"fields": [
6+
{
7+
"name": "crs",
8+
"type": "string",
9+
"doc": "Coordinate reference system"
10+
},
11+
{
12+
"name": "xCoords",
13+
"doc": "List of x coordinates",
14+
"type": {
15+
"type": "array",
16+
"items": "float"
17+
}
18+
},
19+
{
20+
"name": "yCoords",
21+
"doc": "List of y coordinates",
22+
"type": {
23+
"type": "array",
24+
"items": "float"
25+
}
26+
},
27+
{
28+
"name": "timestamps",
29+
"doc": "List of timestamps in seconds",
30+
"type": {
31+
"type": "array",
32+
"items": "int"
33+
}
34+
},
35+
{
36+
"name": "data",
37+
"doc": "XYT data for each dataset. The key is the name, the data is stored in one chunk of data.",
38+
"type": {
39+
"type": "map",
40+
"values": {
41+
"type": "array",
42+
"items": "float"
43+
}
44+
}
45+
}
46+
]
47+
}

contribs/application/src/main/java/org/matsim/application/analysis/emissions/AirPollutionAnalysis.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ private Config prepareConfig() {
142142
config.transit().setTransitScheduleFile(ApplicationUtils.matchInput("transitSchedule", input.getRunDirectory()).toAbsolutePath().toString());
143143
config.transit().setVehiclesFile(ApplicationUtils.matchInput("transitVehicles", input.getRunDirectory()).toAbsolutePath().toString());
144144
config.plans().setInputFile(null);
145+
config.facilities().setInputFile(null);
145146
config.eventsManager().setNumberOfThreads(null);
146147
config.eventsManager().setEstimatedNumberOfEvents(null);
147148
config.global().setNumberOfThreads(1);
@@ -337,8 +338,8 @@ private void writeTimeDependentRaster(Network network, Config config, EmissionsO
337338
Coord coord = raster.getCoordForIndex(xi, yi);
338339
double value = timeBin.getValue().get(Pollutant.CO2_TOTAL).getValueByIndex(xi, yi);
339340

340-
// if (value == 0)
341-
// continue;
341+
if (value == 0)
342+
continue;
342343

343344
printer.print(timeBin.getStartTime());
344345
printer.print(coord.getX());

0 commit comments

Comments
 (0)