Skip to content

Commit

Permalink
start parking capacities implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
GregorRyb committed Jan 23, 2024
1 parent 208331e commit e0aff50
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/main/java/org/matsim/run/prepare/ParkingCapacities.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package org.matsim.run.prepare;

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 picocli.CommandLine;

public class ParkingCapacities implements MATSimAppCommand {


@CommandLine.Option(names = "--network", description = "Path to network file", required = true)
private static String networkFile;

@CommandLine.Option(names = "--output", description = "Output path of the prepared network", required = true)
private String outputPath;

public static void main(String[] args) {
Network network = NetworkUtils.readNetwork(networkFile);

for (Link l: network.getLinks().values()) {
double useAbleLength = (l.getLength() - 10) * 0.9;

double capacity =0;
if (useAbleLength > 0) {
capacity = useAbleLength / 6;
}

l.getAttributes().putAttribute("parkingCapacity", capacity);


}





}

@Override
public Integer call() throws Exception {
return null;
}


Record parkingCapacity(String linkId, int capacity) {
return null;
}
}

0 comments on commit e0aff50

Please sign in to comment.