Skip to content

faq 295665665

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

MatsimNetworkReader vs scenario.getNetwork()

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!


Comments: 0

Clone this wiki locally