Class NetworkCleaner
- java.lang.Object
-
- org.matsim.core.network.algorithms.NetworkCleaner
-
- All Implemented Interfaces:
NetworkRunnable
public final class NetworkCleaner extends Object implements NetworkRunnable
Ensures that each link in the network can be reached by any other link. Links that cannot be reached by some other links, or links from which it is not possible to reach all other links, are removed from the network. Nodes with no incoming or outgoing links are removed as well from the network.- Author:
- mrieser, balmermi
-
-
Constructor Summary
Constructors Constructor Description NetworkCleaner()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
reduceToBiggestCluster(Network network, Map<Id<Node>,Node> biggestCluster)
Reducing the network so it only contains nodes included in the biggest Cluster.void
run(Network network)
Map<Id<Node>,Node>
searchBiggestCluster(Network network)
Searches the biggest cluster in the given Network.
-
-
-
Constructor Detail
-
NetworkCleaner
public NetworkCleaner()
-
-
Method Detail
-
searchBiggestCluster
public Map<Id<Node>,Node> searchBiggestCluster(Network network)
Searches the biggest cluster in the given Network. The Network is not modified.
-
reduceToBiggestCluster
public static void reduceToBiggestCluster(Network network, Map<Id<Node>,Node> biggestCluster)
Reducing the network so it only contains nodes included in the biggest Cluster. Loop over all nodes and check if they are in the cluster, if not, remove them from the network
-
run
public void run(Network network)
- Specified by:
run
in interfaceNetworkRunnable
-
-