/** * Merges all qualifying links, ignoring length threshold. * @param network */ public void run(final Network network){ run(network, Double.POSITIVE_INFINITY, ThresholdExceeded.EITHER); }
public static void runNetworkSimplifier( Network network ) { new NetworkSimplifier().run(network) ; } public static void writeNetwork(Network network, String string) {
@Override public void run(final Network network) { Map<Id<Node>, Node> biggestCluster = this.searchBiggestCluster(network); reduceToBiggestCluster(network, biggestCluster); }
@Test public void testFilter_NoCommonModes() { final Fixture f = new Fixture(); TransportModeNetworkFilter filter = new TransportModeNetworkFilter(f.scenario.getNetwork()); Network subNetwork = ScenarioUtils.createScenario(ConfigUtils.createConfig()).getNetwork(); filter.filter(subNetwork, createHashSet(TransportMode.pt, "motorbike")); Assert.assertEquals("wrong number of nodes.", 0, subNetwork.getNodes().size()); Assert.assertEquals("wrong number of links", 0, subNetwork.getLinks().size()); }
public static void runNetworkCleaner( Network network ) { new org.matsim.core.network.algorithms.NetworkCleaner().run( network ); } public static void runNetworkSimplifier( Network network ) {
@Override public NetworkRoute getNetworkRouteInstance(final Id<Link> fromLinkId, final Id<Link> toLinkId, final Network network) { SubsequentLinksAnalyzer subsequent = new SubsequentLinksAnalyzer(network); return new CompressedNetworkRouteImpl(fromLinkId, toLinkId, network, subsequent.getSubsequentLinks()); }
LinkToLinkRoutingModule(final String mode, final PopulationFactory populationFactory, Network network, LeastCostPathCalculatorFactory leastCostPathCalcFactory, TravelDisutilityFactory travelCostCalculatorFactory, LinkToLinkTravelTime l2ltravelTimes, NetworkTurnInfoBuilderI turnInfoBuilder) { this.network = network; this.populationFactory = populationFactory; this.mode = mode; invertedNetwork = new NetworkInverter(network, turnInfoBuilder.createAllowedTurnInfos()).getInvertedNetwork(); // convert l2ltravelTimes into something that can be used by the inverted network router: TravelTimesInvertedNetworkProxy invertedTravelTimes = new TravelTimesInvertedNetworkProxy(network, l2ltravelTimes); // (method that takes a getLinkTravelTime( link , ...) with a link from the inverted network, converts it into links on the // original network, and looks up the link2link tttime in the l2ltravelTimes data structure) TravelDisutility travelCost = travelCostCalculatorFactory.createTravelDisutility(invertedTravelTimes); leastCostPathCalculator = leastCostPathCalcFactory.createPathCalculator(invertedNetwork, travelCost, invertedTravelTimes); }
private boolean topoTypeAllowed(Link link) { if(this.topoTypesForStops == null){ // flag not set or null in config return true; } Integer topoType = this.networkCalcTopoType.getTopoType(link.getToNode()); return this.topoTypesForStops.contains(topoType); }
public NetworkExpandNode(final Network network, final double expRadius, final double offset) { if (network == null) { throw new IllegalArgumentException("network must not be null."); } this.network = network; this.setExpRadius(expRadius); this.setOffset(offset); }
@Inject public NetworkWithSignalsTurnInfoBuilder(Scenario scenario) { this.scenario = scenario ; delegate = new NetworkTurnInfoBuilder( scenario ) ; }
/** * Modifies the network such that the subnetwork containing only links that have at least * one of the specified transport modes in their set of allowed transport modes is strongly * connected (=every link/node can be reached by every other link/node). If multiple modes * are given, the algorithm does <em>not</em> guarantee that the resulting network is strongly * connected for each of the modes individually! Nodes having links connected to them before * cleaning, but none after cleaning, are removed from the network. * * @param modes */ public void run(final Set<String> modes) { run(modes, new HashSet<String>()); }
private static final void printSetting() { reader.printInfo(" "); if (srModule != null) { srModule.printInfo(" "); } if (mrModule != null) { mrModule.printInfo(" "); } System.out.println(" output:"); System.out.println(" outputDir: "+outputDir); System.out.println(" writeNetworkXmlFile: "+writeNetworkXmlFile); System.out.println(" writeNetworkTxtFile: "+writeNetworkTxtFile); System.out.println(" writeNetworkShapeFile: "+writeNetworkShapeFile); }
public Network getInvertedNetwork() { if (this.invertedNetwork == null){ invertNetwork(); } return this.invertedNetwork; }
public SubsequentLinksAnalyzer(final Network network) { this.network = network; compute(); }
private static DoubleFlagRole getDoubleFlag(final Node n, final Map<Node, DoubleFlagRole> nodeRoles) { DoubleFlagRole r = nodeRoles.get(n); if (null == r) { r = new DoubleFlagRole(); nodeRoles.put(n, r); } return r; }
/** * Linear search for the TurnInfo describing the turn to the outLinkId */ static TurnInfo getTurnInfoForOutlinkId(List<TurnInfo> turnInfoList, Id<Link> outLinkId) { for (TurnInfo ti : turnInfoList) { if (ti.getToLinkId().equals(outLinkId)) { return ti; } } return null; }
private static DoubleFlagRole getDoubleFlag(final Link l, final Map<Id<Link>, DoubleFlagRole> linkRoles) { DoubleFlagRole r = linkRoles.get(l.getId()); if (null == r) { r = new DoubleFlagRole(); linkRoles.put(l.getId(), r); } return r; }
/** * Merges all qualifying links while ensuring no link is shorter than the * given threshold. * <br/> * Comments:<ul> * <li>I would argue against setting the thresholdLength to anything different from POSITIVE_INFINITY, since * the result of the method depends on the sequence in which the algorithm goes through the nodes. </li> * </ul> * @param network * @param thresholdLength */ @Deprecated public void run(final Network network, double thresholdLength){ run(network, thresholdLength, ThresholdExceeded.BOTH); run(network, thresholdLength, ThresholdExceeded.EITHER); }
private boolean topoTypeAllowed(Link link) { if(this.topoTypesForStops == null){ // flag not set or null in config return true; } Integer topoType = this.networkCalcTopoType.getTopoType(link.getToNode()); return this.topoTypesForStops.contains(topoType); }