Skip to content

Commit

Permalink
Merge pull request #24 from SchweizerischeBundesbahnen/bugfix/missing…
Browse files Browse the repository at this point in the history
…-network-mode

Bugfix/missing network mode
  • Loading branch information
munterfi authored Dec 9, 2024
2 parents 43b6c02 + 4c8e3bc commit 1ef808e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
13 changes: 13 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.2</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ TransitRoute createTransitRoute(TransitLine transitLine, String id, List<Id<Link
}

log.debug("Creating TransitRoute {} and adding to TransitLine {}", routeId, transitLine.getId());
transitRoute = sf.createTransitRoute(routeId, networkRoute, stops, Default.LINK_MODE);
transitRoute = sf.createTransitRoute(routeId, networkRoute, stops, Default.NETWORK_MODE);
transitLine.addRoute(transitRoute);

return transitRoute;
Expand Down Expand Up @@ -133,7 +133,7 @@ Link createLink(LinkType linkType, Node fromNode, Node toNode, double length, Ma

log.debug("Creating Link {}", linkId);
link = nf.createLink(linkId, fromNode, toNode);
link.setAllowedModes(new HashSet<>(List.of(Default.LINK_MODE)));
link.setAllowedModes(new HashSet<>(List.of(Default.NETWORK_MODE)));
link.setLength(length);
link.setFreespeed(Default.LINK_FREESPEED);
link.setCapacity(Default.LINK_CAPACITY);
Expand Down Expand Up @@ -175,6 +175,7 @@ VehicleType getOrCreateVehicleType(String id, double length, double maxVelocity,
vehicleType.getCapacity().setStandingRoom(standingRoom);
vehicleType.setMaximumVelocity(maxVelocity);
vehicleType.setLength(length);
vehicleType.setNetworkMode(Default.NETWORK_MODE);
VehicleUtils.setDoorOperationMode(vehicleType, VehicleType.DoorOperationMode.parallel);
VehicleUtils.setAccessTime(vehicleType, Default.VEHICLE_ACCESS_TIME);
VehicleUtils.setEgressTime(vehicleType, Default.VEHICLE_EGRESS_TIME);
Expand All @@ -201,10 +202,10 @@ Vehicle getOrCreateVehicle(VehicleType vehicleType, String id) {
}

private static class Default {
private static final String NETWORK_MODE = "pt";
private static final double LINK_FREESPEED = 10000.;
private static final double LINK_CAPACITY = 10000.;
private static final double LINK_LANES = 1.;
private static final String LINK_MODE = "rail";
private static final double VEHICLE_ACCESS_TIME = 1.;
private static final double VEHICLE_EGRESS_TIME = 1.;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class TransitScheduleXmlWriter implements ConverterSink<Scenario> {

private static final String CONFIG_FILE = "config.xml";
private static final String NETWORK_FILE = "network.xml.gz";
private static final String NETWORK_FILE = "transitNetwork.xml.gz";
private static final String TRANSIT_SCHEDULE_FILE = "transitSchedule.xml.gz";
private static final String TRANSIT_VEHICLE_FILE = "transitVehicles.xml.gz";

Expand Down

0 comments on commit 1ef808e

Please sign in to comment.