-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start parking capacities implementation
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
src/main/java/org/matsim/run/prepare/ParkingCapacities.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,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; | ||
} | ||
} |