Skip to content

Commit

Permalink
Merge pull request #94 from moia-oss/master
Browse files Browse the repository at this point in the history
merge master into deployment 07.05
  • Loading branch information
mfrawley-moia authored May 7, 2024
2 parents a041bf7 + 6f9a62f commit 463b59d
Show file tree
Hide file tree
Showing 89 changed files with 4,279 additions and 1,319 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ matsimExamples
matsim/docs/doxygen/html
matsim/src/main/java/Doxyfile

# VS Code files
.vscode

# ignore output directories:
output/
35 changes: 34 additions & 1 deletion contribs/application/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<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">
<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">

<parent>
<groupId>org.matsim</groupId>
Expand All @@ -20,12 +21,21 @@
</repository>
</repositories>

<properties>
<avro.version>1.11.3</avro.version>
</properties>

<dependencies>

<dependency>
<groupId>tech.tablesaw</groupId>
<artifactId>tablesaw-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>${avro.version}</version>
</dependency>

<dependency>
<groupId>org.matsim.contrib</groupId>
Expand Down Expand Up @@ -140,4 +150,27 @@
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>${avro.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
47 changes: 47 additions & 0 deletions contribs/application/src/main/avro/xyt.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"namespace": "org.matsim.application.avro",
"type": "record",
"name": "XYTData",
"fields": [
{
"name": "crs",
"type": "string",
"doc": "Coordinate reference system"
},
{
"name": "xCoords",
"doc": "List of x coordinates",
"type": {
"type": "array",
"items": "float"
}
},
{
"name": "yCoords",
"doc": "List of y coordinates",
"type": {
"type": "array",
"items": "float"
}
},
{
"name": "timestamps",
"doc": "List of timestamps in seconds",
"type": {
"type": "array",
"items": "int"
}
},
{
"name": "data",
"doc": "XYT data for each dataset. The key is the name, the data is stored in one chunk of data.",
"type": {
"type": "map",
"values": {
"type": "array",
"items": "float"
}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ private Config prepareConfig() {
config.transit().setTransitScheduleFile(ApplicationUtils.matchInput("transitSchedule", input.getRunDirectory()).toAbsolutePath().toString());
config.transit().setVehiclesFile(ApplicationUtils.matchInput("transitVehicles", input.getRunDirectory()).toAbsolutePath().toString());
config.plans().setInputFile(null);
config.facilities().setInputFile(null);
config.eventsManager().setNumberOfThreads(null);
config.eventsManager().setEstimatedNumberOfEvents(null);
config.global().setNumberOfThreads(1);
Expand Down Expand Up @@ -337,8 +338,8 @@ private void writeTimeDependentRaster(Network network, Config config, EmissionsO
Coord coord = raster.getCoordForIndex(xi, yi);
double value = timeBin.getValue().get(Pollutant.CO2_TOTAL).getValueByIndex(xi, yi);

// if (value == 0)
// continue;
if (value == 0)
continue;

printer.print(timeBin.getStartTime());
printer.print(coord.getX());
Expand Down
Loading

0 comments on commit 463b59d

Please sign in to comment.