matsim-org / matsim-code-examples

A repository containing code examples around MATSim
GNU General Public License v3.0
83 stars 179 forks source link

Bug Report (Maybe?) for SwissRailRaptorModule #494

Open jingjunL opened 3 years ago

jingjunL commented 3 years ago

Hi everyone,

Maybe I have encountered a bug when using the SwissRailRaptorModule(), so I would like to report here. But please forgive me if it's a mistake on my side :P

This bug happens when you rerun your scenario and not deleting the previous output folder. In principle, if I have added OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists into my config, this should not be a problem since the previous folder is automatically deleted. However, after adding the SwissRailRaptorModule, there will be an error message saying the tmp directory could not be created. More detailly, the error message is:

Error injecting constructor, java.lang.RuntimeException: The tmp directory ./output/TestForNewFeatures/tmp could not be created.
  at org.matsim.core.controler.OutputDirectoryHierarchy.<init>(OutputDirectoryHierarchy.java:55)
  at org.matsim.core.controler.NewControlerModule.install(NewControlerModule.java:34) (via modules: com.google.inject.util.Modules$CombinedModule -> com.google.inject.util.Modules$CombinedModule -> org.matsim.core.controler.AbstractModule$4 -> com.google.inject.util.Modules$OverrideModule -> org.matsim.core.controler.Controler$2 -> org.matsim.core.controler.NewControlerModule)
  while locating org.matsim.core.controler.OutputDirectoryHierarchy
    for the 3rd parameter of org.matsim.core.controler.corelisteners.EventsHandlingImpl.<init>(EventsHandlingImpl.java:67)
  at org.matsim.core.controler.corelisteners.EventsHandlingImpl.class(EventsHandlingImpl.java:49)
  while locating org.matsim.core.controler.corelisteners.EventsHandlingImpl
  while locating org.matsim.core.controler.corelisteners.EventsHandling
    for the 6th parameter of org.matsim.core.controler.NewControler.<init>(NewControler.java:64)
  while locating org.matsim.core.controler.NewControler
  at org.matsim.core.controler.NewControlerModule.install(NewControlerModule.java:29) (via modules: com.google.inject.util.Modules$CombinedModule -> com.google.inject.util.Modules$CombinedModule -> org.matsim.core.controler.AbstractModule$4 -> com.google.inject.util.Modules$OverrideModule -> org.matsim.core.controler.Controler$2 -> org.matsim.core.controler.NewControlerModule)
  while locating org.matsim.core.controler.ControlerI

If you deleted your previous folder, the simulation could run smoothly :) However, with this bug, I feel like the previous deleteDirectoryIfExists becomes meaningless since I need to delete it manually.

Just a small bug report and I hope this can help some people :P

mrieser commented 3 years ago

I doubt it has anything to do with the SwissRailRaptor. Could you share your main-method, how you set everything up? There is probably something else mixed up.

jingjunL commented 3 years ago

I doubt it has anything to do with the SwissRailRaptor. Could you share your main-method, how you set everything up? There is probably something else mixed up.

Hello Marcel,

Ah, it reminds me that I added a setPcuThresholdForFlowCapacityEasing in my config since I heard I need to set it to scale down my pt capacity. Maybe that's the reason for this issue?

The code is config.qsim().setPcuThresholdForFlowCapacityEasing(0.01);

Otherwise, there is no differences between my runMATSim and the standard config, scenario and controller :)