matsim-org / matsim-code-examples

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

Error with Deprecated 'usePersonIdForMissingVehicleId' in Multimodal Scenario #1160

Open ArezHK opened 2 weeks ago

ArezHK commented 2 weeks ago

Hi,

Could someone please help me with this error?

"'usePersonIdForMissingVehicleId' is deprecated. It will be removed soon."

I encountered this error while running a multimodal scenario. Any guidance would be appreciated!

Complete error:

2024-09-02T14:57:47,749 INFO SwissRailRaptorData:85 Preparing data for SwissRailRaptor... 2024-09-02T14:57:47,745 WARN PrepareForSimImpl:229 'usePersonIdForMissingVehicleId' is deprecated. It will be removed soon. 2024-09-02T14:57:47,777 ERROR MatsimRuntimeModifications:76 Getting uncaught Exception in Thread main com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) [Guice/ErrorInCustomProvider]: NullPointerException: Cannot invoke "org.matsim.api.core.v01.network.Link.getLength()" because "link" is null while locating SwissRailRaptorFactory at SwissRailRaptorRoutingModuleProvider.(SwissRailRaptorRoutingModuleProvider.java:28) _ for 1st parameter while locating SwissRailRaptorRoutingModuleProvider while locating RoutingModule annotated with @Named("pt") while locating RoutingModule annotated with @Element(setName=,uniqueId=114, type=MAPBINDER, keyType=String) at TripRouter.(TripRouter.java:105) while locating TripRouter

Janekdererste commented 1 week ago

Your error is not related to the "userPersonIdForMissingVehicleId" log.

The error which crashes your simulation is: NullPointerException: Cannot invoke "org.matsim.api.core.v01.network.Link.getLength() because "link" is null while locating SwissRailRaptorFactory at SwissRailRaptorRoutingModuleProvider.(SwissRailRaptorRoutingModuleProvider.java:28). Usually, this is caused due to inconsistencies in your network and your public transit schedule. I would guess, that you have a link id in your schedule, which is not present in your network.

ArezHK commented 1 week ago

Dear @Janekdererste, Thank you for your response. Indeed, I modified my network and included a new mode "bicycle" for just main roads in the network and also added some totally new links specifically for that mode. The issue I'm facing is that when I use the base network without these exta bicycle paths, the simulation runs smoothly.(The new paths as additional links are connected using existing nodes). Could you please guide me on how to make the network consistent with this new mode?

Janekdererste commented 1 week ago

Could you please provide the log file of your run, that crashes?

ArezHK commented 1 week ago

Yes sure! logfile.log

ArezHK commented 1 week ago

All I have changed in the network is added the red links below for only allowed mode bicycle(as a new routed mode). By using the left map it works fine (just main roads have bicycle as allwed mode) but on the right it does not work (extra than main roads I also added new links with just bicycle as allowed mode). image