Skip to content

Commit

Permalink
satisfy checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
GregorRyb committed Jan 24, 2024
1 parent fcff89c commit 3ab9085
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/main/java/org/matsim/run/prepare/ParkingCapacities.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
package org.matsim.run.prepare;

import org.matsim.analysis.ParkingLocation;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.application.MATSimAppCommand;
import org.matsim.core.network.NetworkUtils;
import org.matsim.core.utils.io.IOUtils;
import picocli.CommandLine;

import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* This class writes out a network and a tsv file with the parking capacites of Leipzig according to a simplified calculation based on the RASt.
*
*
*/

public class ParkingCapacities {
public final class ParkingCapacities {

private static Network network = NetworkUtils.readNetwork("https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/leipzig/leipzig-v1.2/input/leipzig-v1.2-network-with-pt.xml.gz");
private static List<ParkingCapacities.ParkingCapacityRecord> listOfParkingCapacities = new ArrayList<>();
private ParkingCapacities() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}

public static void main(String[] args) throws IOException {

Network network = NetworkUtils.readNetwork("https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/leipzig/leipzig-v1.2/input/leipzig-v1.2-network-with-pt.xml.gz");
List<ParkingCapacities.ParkingCapacityRecord> listOfParkingCapacities = new ArrayList<>();

public static void main(String[] args) throws IOException {
for (Link l: network.getLinks().values()) {

//skip motorways and non car links
Expand All @@ -52,14 +53,14 @@ private static void writeResults(Path outputFolder, List<ParkingCapacities.Parki
BufferedWriter writer = IOUtils.getBufferedWriter(outputFolder.resolve("parkingCapacities.tsv").toString());
writer.write("linkId\tmaxCapacity\tminCapacity");
writer.newLine();

for (ParkingCapacities.ParkingCapacityRecord pd : listOfParkingCapacities) {
writer.write(pd.linkId + "\t" + pd.maxCapacity + "\t" + pd.minCapacity);
writer.newLine();
}
writer.close();

}

private record ParkingCapacityRecord(String linkId, int maxCapacity, int minCapacity) { }


}

0 comments on commit 3ab9085

Please sign in to comment.