faq 295665665 - matsim-org/matsim-code-examples GitHub Wiki
by Davi Bicudo on 2018-06-27 07:04:07
Hi,
I was loading a network with the method:
Scenario scenario = ScenarioUtils.loadScenario(ConfigUtils.loadConfig(path));
Network network = scenario.getNetwork();
But then when attempting network.getLinks().get(linkId), it would return null even though I knew the link was present (checked in the xml file).
Then I tried the MatsimNetworkReader approach:
Network network = NetworkUtils.createNetwork();
new MatsimNetworkReader(network).readFile(config.network().getInputFile());
And this time the network.getLinks.get(linkId) worked as expected.
Does anyone know why this might happen?
Thanks!