21 package org.matsim.pt.router;
23 import java.util.Collection;
24 import java.util.LinkedHashMap;
25 import java.util.LinkedList;
26 import java.util.List;
30 import org.apache.logging.log4j.LogManager;
31 import org.apache.logging.log4j.Logger;
88 return this.ingoingLinks;
93 return this.outgoingLinks;
98 throw new UnsupportedOperationException();
103 throw new UnsupportedOperationException();
130 return this.
id.toString();
150 throw new UnsupportedOperationException();
170 this.fromNode = fromNode;
171 this.toNode = toNode;
174 this.length = length;
183 return this.fromNode;
198 return getCapacity();
208 return getFreespeed();
223 return getNumberOfLanes();
233 throw new UnsupportedOperationException();
238 throw new UnsupportedOperationException();
243 throw new UnsupportedOperationException();
248 throw new UnsupportedOperationException();
253 throw new UnsupportedOperationException();
258 throw new UnsupportedOperationException();
263 throw new UnsupportedOperationException();
273 throw new UnsupportedOperationException();
286 return "[" + this.
id.toString() +
" (" + this.getFromNode().id +
" > " + this.getToNode().id +
")]";
291 throw new UnsupportedOperationException();
296 throw new UnsupportedOperationException();
302 this.nodes.put(node.
getId(), node);
308 this.links.put(link.
getId(), link);
309 fromNode.outgoingLinks.put(link.
getId(), link);
310 toNode.ingoingLinks.put(link.
getId(), link);
325 double minX = Double.POSITIVE_INFINITY;
326 double minY = Double.POSITIVE_INFINITY;
327 double maxX = Double.NEGATIVE_INFINITY;
328 double maxY = Double.NEGATIVE_INFINITY;
331 Coord c = node.stop.getStopFacility().getCoord();
332 if (c.
getX() < minX) {
335 if (c.
getY() < minY) {
338 if (c.
getX() > maxX) {
341 if (c.
getY() > maxY) {
348 Coord c = node.stop.getStopFacility().getCoord();
351 this.qtNodes = quadTree;
379 throw new UnsupportedOperationException();
384 throw new UnsupportedOperationException();
389 throw new UnsupportedOperationException();
394 throw new UnsupportedOperationException();
398 log.info(
"start creating transit network");
409 if (prevNode != null) {
424 log.info(
"add transfer links");
426 List<Tuple<TransitRouterNetworkNode, TransitRouterNetworkNode>> toBeAdded =
new LinkedList<Tuple<TransitRouterNetworkNode, TransitRouterNetworkNode>>();
429 if (node.getInLinks().size() > 0) {
431 if ((node != node2) && (node2.getOutLinks().size() > 0)) {
432 if ((node.line != node2.line) || (node.stop.getStopFacility() != node2.stop.getStopFacility())) {
440 log.info(toBeAdded.size() +
" transfer links to be added.");
442 network.
createLink(tuple.getFirst(), tuple.getSecond(), null, null);
446 log.info(
"transit router network statistics:");
447 log.info(
" # nodes: " + network.
getNodes().size());
448 log.info(
" # links total: " + network.
getLinks().size());
449 log.info(
" # transfer links: " + toBeAdded.size());
486 throw new UnsupportedOperationException();
void setEffectiveLaneWidth(double effectiveLaneWidth)
Map< Id< TransitRoute >, TransitRoute > getRoutes()
void setCapacityPeriod(double capPeriod)
final Map< Id< Node >, TransitRouterNetworkNode > nodes
boolean setFromNode(final Node node)
static double calcEuclideanDistance(Coord coord, Coord other)
TransitRouterNetworkLink createLink(final TransitRouterNetworkNode fromNode, final TransitRouterNetworkNode toNode, final TransitRoute route, final TransitLine line)
void setName(String name)
Map< Id< Node >, ? extends TransitRouterNetworkNode > getNodes()
Link removeLink(Id< Link > linkId)
Node removeNode(Id< Node > nodeId)
double getCapacity(final double time)
NetworkFactory getFactory()
void setLength(final double length)
Link removeInLink(Id< Link > linkId)
Map< Id< Link >, ? extends Link > getOutLinks()
void setAllowedModes(final Set< String > modes)
Map< Id< Link >, ? extends Link > getInLinks()
double getCapacityPeriod()
double getNumberOfLanes()
TransitRouterNetworkLink(final Id< Link > id, final TransitRouterNetworkNode fromNode, final TransitRouterNetworkNode toNode, final TransitRoute route, final TransitLine line)
double getEffectiveLaneWidth()
final TransitRouterNetworkNode toNode
void setCapacity(final double capacity)
static< T > Id< T > create(final long key, final Class< T > type)
TransitRouterNetworkNode getToNode()
TransitRouterNetworkNode createNode(final TransitRouteStop stop, final TransitRoute route, final TransitLine line)
boolean setToNode(final Node node)
List< TransitRouteStop > getStops()
static TransitRouterNetwork createFromSchedule(final TransitSchedule schedule, final double maxBeelineWalkConnectionDistance)
final TransitRouterNetworkNode fromNode
boolean put(final double x, final double y, final T value)
final TransitRouteStop stop
boolean addOutLink(final Link link)
Attributes getAttributes()
TransitRouterNetworkLink(final Id< Link > id, final TransitRouterNetworkNode fromNode, final TransitRouterNetworkNode toNode, final TransitRoute route, final TransitLine line, double length)
T getClosest(final double x, final double y)
void setNumberOfLanes(final double lanes)
QuadTree< TransitRouterNetworkNode > qtNodes
TransitRouterNetworkNode getFromNode()
abstract TransitStopFacility getStopFacility()
Collection< TransitRouterNetworkNode > getNearestNodes(final Coord coord, final double distance)
void setCoord(Coord coord)
boolean addInLink(final Link link)
double getFreespeed(final double time)
Link removeOutLink(Id< Link > outLinkId)
TransitRouterNetworkNode getNearestNode(final Coord coord)
Collection< T > getDisk(final double x, final double y, final double distance)
void setFreespeed(final double freespeed)
double getCapacityPeriod()
final Map< Id< Link >, TransitRouterNetworkLink > links
Map< Id< TransitLine >, TransitLine > getTransitLines()
TransitRouteStop getStop()
TransitRouterNetworkNode(final Id< Node > id, final TransitRouteStop stop, final TransitRoute route, final TransitLine line)
double getEffectiveCellSize()
double getNumberOfLanes(final double time)
Attributes getAttributes()
void setEffectiveCellSize(double effectiveCellSize)
Map< Id< Link >, ? extends TransitRouterNetworkLink > getLinks()
Attributes getAttributes()
Set< String > getAllowedModes()