matsim-org / matsim-libs

Multi-Agent Transport Simulation
www.matsim.org
461 stars 436 forks source link

Carsharing module FileNotFoundException #1903

Open TheoChd opened 2 years ago

TheoChd commented 2 years ago

Hi, I would like to report a bug in the carsharing module of matsim. I tried to run the example of the carsharing module. An error is raised with the default settings. The files "CarsharingStations.xml" and "CSMembership.xml" are not found. When changing the relative path to an absolute path, the error disappears. This path issue does not appear for other files called by config.xml (such as "network.xml" or "freefloating_areas.xml").

Exception in thread "main" org.matsim.core.utils.io.UncheckedIOException: java.io.FileNotFoundException: CarsharingStations.xml at org.matsim.core.utils.io.IOUtils.resolveFileOrResource(IOUtils.java:249) at org.matsim.core.utils.io.IOUtils.getBufferedReader(IOUtils.java:530) at org.matsim.core.utils.io.MatsimXmlParser.readFile(MatsimXmlParser.java:149) at org.matsim.contrib.carsharing.runExample.RunCarsharing.installCarSharing(RunCarsharing.java:99) at org.matsim.contrib.carsharing.runExample.RunCarsharing.main(RunCarsharing.java:80) Caused by: java.io.FileNotFoundException: CarsharingStations.xml at org.matsim.core.utils.io.IOUtils.resolveFileOrResource(IOUtils.java:247)

kainagel commented 2 years ago

Thanks. Yes, this needs to be implemented manually for each file path in the config. @balacmi , do you maybe want to do that? It should be a small number of lines; look at some other place where this works.