Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I want to route walk mode, MATSim gives com.google.inject.ProvisionException: Unable to provision, see the following errors: #3468

Open
federicobigi opened this issue Sep 10, 2024 · 0 comments

Comments

@federicobigi
Copy link

Goodmorning,
I am trying to run a very small scenario, where as for now my goal is to route walking as a mode. This because, when I set walking as teleportation mode, I get insanely small distances, which makes the scoring on that mode completely wrong. Just to show an example:

<person id="14">
	<plan score="44.389566662396184" selected="yes">
		<activity type="home" link="2525" x="6.219104482" y="49.59367221" end_time="17:01:00" >
		</activity>
		<leg mode="walk" dep_time="17:01:00" trav_time="00:00:00">
			<attributes>
				<attribute name="routingMode" class="java.lang.String">walk</attribute>
			</attributes>
			<route type="generic" start_link="2525" end_link="498" trav_time="00:00:00" distance="0.026617553823122156"></route>
		</leg>
		<activity type="work" link="498" x="6.208117641" y="49.60118306" start_time="17:01:00" >
		</activity>
	</plan>

</person>

Here walk mode does not provide me any distance or time, but a similar distance covered by car, which is routed, gives me:

<person id="15">
	<plan score="26.693985664154305" selected="yes">
		<activity type="home" link="2089" x="6.223954421" y="49.59455333" end_time="16:22:00" >
		</activity>
		<leg mode="car" dep_time="16:22:00" trav_time="00:09:27">
			<attributes>
				<attribute name="enterVehicleTime" class="java.lang.Double">58920.0</attribute>
				<attribute name="routingMode" class="java.lang.String">car</attribute>
			</attributes>
			<route type="links" start_link="2089" end_link="498" trav_time="00:09:27" distance="1564.9658261353998" vehicleRefId="null">2089 2087 2085 2083 2081 2079 2077 2075 2073 2071 2069 2067 2065 2063 2061 2059 2057 2055 2053 2051 2049 2047 2045 2043 2041 2039 2037 2035 2033 2031 2029 2027 2414 2415 2416 134 135 1582 1583 1584 1585 1586 133 125 126 127 128 129 130 131 132 1964 2274 497 498</route>
		</leg>
		<activity type="work" link="498" x="6.208117641" y="49.60118306" start_time="16:31:27" >
		</activity>
	</plan>

</person>

Now, I tried to implement the multimodal network, I changed the config_file accordingly, nonetheless this error keeps popping up:

2024-09-10T13:52:51,853 ERROR MatsimRuntimeModifications:76 Getting uncaught Exception in Thread main
com.google.inject.ProvisionException: Unable to provision, see the following errors:

  1. [Guice/ErrorInjectingConstructor]: RuntimeException: Object is null; follow stack trace
    at DefaultRaptorParametersForPerson.(DefaultRaptorParametersForPerson.java:38)
    while locating DefaultRaptorParametersForPerson
    at SwissRailRaptorFactory.(SwissRailRaptorFactory.java:60)
    _ for 3rd parameter
    at SwissRailRaptorFactory.class(SwissRailRaptorFactory.java:38)
    while locating SwissRailRaptorFactory
    at SwissRailRaptorRoutingModuleProvider.(SwissRailRaptorRoutingModuleProvider.java:43)
    _ for 1st parameter
    while locating SwissRailRaptorRoutingModuleProvider
    while locating RoutingModule annotated with @nAmed("pt")
    while locating RoutingModule annotated with @element(setName=,uniqueId=98, type=MAPBINDER, keyType=String)
    at TripRouter.(TripRouter.java:102)
    while locating TripRouter

Learn more:
https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR

1 error

======================
Full classname legend:

DefaultRaptorParametersForPerson: "ch.sbb.matsim.routing.pt.raptor.DefaultRaptorParametersForPerson"
Element: "com.google.inject.internal.Element"
Named: "com.google.inject.name.Named"
RoutingModule: "org.matsim.core.router.RoutingModule"
SwissRailRaptorFactory: "ch.sbb.matsim.routing.pt.raptor.SwissRailRaptorFactory"
SwissRailRaptorRoutingModuleProvider: "ch.sbb.matsim.routing.pt.raptor.SwissRailRaptorRoutingModuleProvider"
TripRouter: "org.matsim.core.router.TripRouter"

End of classname legend:

    at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251) ~[rsrc:guice-7.0.0.jar:?]       
    at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1151) ~[rsrc:guice-7.0.0.jar:?]
    at org.matsim.core.controler.PrepareForSimImpl.lambda$run$0(PrepareForSimImpl.java:197) ~[rsrc:matsim-16.0-2024w10.jar:?]
    at org.matsim.core.population.algorithms.ParallelPersonAlgorithmUtils.run(ParallelPersonAlgorithmUtils.java:87) ~[rsrc:matsim-16.0-2024w10.jar:?]  
    at org.matsim.core.controler.PrepareForSimImpl.run(PrepareForSimImpl.java:196) ~[rsrc:matsim-16.0-2024w10.jar:?]
    at org.matsim.core.controler.NewControler.prepareForSim(NewControler.java:114) ~[rsrc:matsim-16.0-2024w10.jar:?]
    at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:83) ~[rsrc:matsim-16.0-2024w10.jar:?]
    at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:70) [rsrc:matsim-16.0-2024w10.jar:?]
    at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:53) [rsrc:matsim-16.0-2024w10.jar:?]
    at org.matsim.core.controler.AbstractController.run(AbstractController.java:92) [rsrc:matsim-16.0-2024w10.jar:?]
    at org.matsim.core.controler.NewControler.run(NewControler.java:83) [rsrc:matsim-16.0-2024w10.jar:?]
    at org.matsim.core.controler.Controler.run(Controler.java:259) [rsrc:matsim-16.0-2024w10.jar:?]
    at org.matsim.maas.drt.RunMatsim_Dynamic.main(RunMatsim_Dynamic.java:63) [rsrc:./:?]
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61) [matsim_contern_scenario_dynamic_3.jar:?]

Caused by: java.lang.RuntimeException: Object is null; follow stack trace
at org.matsim.core.gbl.Gbl.assertNotNull(Gbl.java:214) ~[rsrc:matsim-16.0-2024w10.jar:?]
at org.matsim.pt.router.TransitRouterConfig.(TransitRouterConfig.java:123) ~[rsrc:matsim-16.0-2024w10.jar:?]
at org.matsim.pt.router.TransitRouterConfig.(TransitRouterConfig.java:106) ~[rsrc:matsim-16.0-2024w10.jar:?]
at ch.sbb.matsim.routing.pt.raptor.RaptorUtils.createParameters(RaptorUtils.java:85) ~[rsrc:matsim-16.0-2024w10.jar:?]
at ch.sbb.matsim.routing.pt.raptor.DefaultRaptorParametersForPerson.(DefaultRaptorParametersForPerson.java:39) ~[rsrc:matsim-16.0-2024w10.jar:?]

I tried with both hermes and qsim encountering the same error. I believe I am missing something in the config file, if someone can help me it would really be appriciated! :)
help_small_scenario.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant