21 package org.matsim.pt.utils;
52 private final Map<Tuple<Node, Node>,
Link>
links =
new HashMap<>();
53 private final Map<TransitStopFacility, Node>
nodes =
new HashMap<>();
60 this.prefix = networkIdPrefix;
61 this.linkFreeSpeed = 100.0 / 3.6;
62 this.linkCapacity = 100000.0;
66 final double linkFreeSpeed,
final double linkCapacity) {
69 this.prefix = networkIdPrefix;
78 List<Tuple<TransitLine, TransitRoute>> toBeRemoved =
new LinkedList<>();
82 if (tRoute.getStops().size() < 2) {
83 System.err.println(
"Line " + tLine.getId() +
" route " + tRoute.getId() +
" has less than two stops. Removing this route from schedule.");
84 toBeRemoved.add(
new Tuple<>(tLine, tRoute));
88 List<Id<Link>> routeLinks =
new ArrayList<>();
92 if (prevStop != null) {
94 routeLinks.add(link.
getId());
98 routeLinks.add(
getLoopLink(stop.getStopFacility()).getId());
103 tRoute.setRoute(route);
108 remove.getFirst().removeRoute(
remove.getSecond());
116 this.nodes.put(stop, node);
127 stop.setLinkId(loopLink.
getId());
128 this.network.
addLink(loopLink);
130 this.links.put(connection, loopLink);
138 Node node = this.nodes.get(stop);
140 return this.links.get(connection);
147 Node fromNode = this.nodes.get(fromFacility);
148 Node toNode = this.nodes.get(toFacility);
151 Link link = this.links.get(connection);
170 this.links.put(connection, link);
final TransitSchedule schedule
void setNumberOfLanes(double lanes)
final double linkFreeSpeed
void setFreespeed(double freespeed)
CreatePseudoNetworkWithLoopLinks(final TransitSchedule schedule, final Network network, final String networkIdPrefix, final double linkFreeSpeed, final double linkCapacity)
Map< Id< TransitStopFacility >, TransitStopFacility > getFacilities()
static double calcEuclideanDistance(Coord coord, Coord other)
Link createAndAddLink(Tuple< Node, Node > connection)
Link getNetworkLink(final TransitRouteStop fromStop, final TransitRouteStop toStop)
static Id< Link > createLinkId(final long key)
final Map< Tuple< Node, Node >, Link > links
CreatePseudoNetworkWithLoopLinks(final TransitSchedule schedule, final Network network, final String networkIdPrefix)
NetworkFactory getFactory()
Link getLoopLink(final TransitStopFacility stop)
final Map< TransitStopFacility, Node > nodes
final double linkCapacity
final Set< String > transitModes
Link createLink(final Id< Link > id, final Node fromNode, final Node toNode)
void setLength(double length)
static NetworkRoute createNetworkRoute(List< Id< Link >> routeLinkIds, Network network)
abstract TransitStopFacility getStopFacility()
Node createNode(final Id< Node > id, final Coord coord)
void setAllowedModes(Set< String > modes)
Map< Id< TransitLine >, TransitLine > getTransitLines()
void createStopNodesAndLoopLinks()
static Id< Node > createNodeId(final long key)
void setCapacity(double capacity)