int nOfInLinks = n.getInLinks().size(); int nOfOutLinks = n.getOutLinks().size(); if ((nOfInLinks + nOfOutLinks) == 0) { setTopoType(n, EMPTY); } else if (nOfInLinks == 0) { setTopoType(n, SOURCE); } else if (nOfOutLinks == 0) {setTopoType(n, SINK); } else if (getNOfIncidentNodes(n) == 1) { setTopoType(n, DEADEND); } else if (getNOfIncidentNodes(n) == 2) { if ((nOfOutLinks == 1) && (nOfInLinks == 1)) { setTopoType(n, PASS1WAY); } else if ((nOfOutLinks == 2) && (nOfInLinks == 2)) { setTopoType(n, PASS2WAY); } else if ((nOfOutLinks == 2) && (nOfInLinks == 1)) { setTopoType(n, START1WAY); } else if ((nOfOutLinks == 1) && (nOfInLinks == 2)) { setTopoType(n, END1WAY); } setTopoType(n, INTERSECTION); setTopoType(n, INTERSECTION); cnt[getTopoType(n)]++;
public static void run(String[] args) { String input = args[0]; String output = args[1]; Network network = NetworkUtils.createNetwork(); new MatsimNetworkReader(network).readFile(input); IntersectionSimplifier ns = new IntersectionSimplifier(30.0, 2); Network newNetwork = ns.simplify(network); NetworkCalcTopoType nct = new NetworkCalcTopoType(); nct.run(newNetwork); LOG.info("Simplifying the network..."); new NetworkSimplifier().run(newNetwork); LOG.info("Cleaning the network..."); new NetworkCleaner().run(newNetwork); IntersectionSimplifier.reportNetworkStatistics(newNetwork); new NetworkWriter(newNetwork).write(output); }
NetworkCalcTopoType nodeTopo = new NetworkCalcTopoType(); nodeTopo.run(network); if(this.nodeTopoToMerge.contains(nodeTopo.getTopoType(node)) && (!this.nodesNotToMerge.contains(node.getId())) ){ nodeTopo = new NetworkCalcTopoType(); nodeTopo.run(network);
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); }
this.networkCalcTopoType = new NetworkCalcTopoType(); this.networkCalcTopoType.run(net);
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); }
this.networkCalcTopoType = new NetworkCalcTopoType(); this.networkCalcTopoType.run(net);
is.writeClustersToFile(utils.getOutputDirectory() + "clusters.csv"); NetworkCalcTopoType nct = new NetworkCalcTopoType(); nct.run(simpleNetwork); NetworkSimplifier ns = new NetworkSimplifier(); ns.run(simpleNetwork);