Skip to content

faq 109075420

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

Issues with mixed traffic example

by Sashi Gurram on 2017-04-23 18:52:04


Dear All,


I am trying to run a scenario with both public transit (buses) and other modes of travel including walk, bike, school bus etc. So, I decided to start off by using the example mixed traffic scenario but it seems to be giving some issues. I downloaded the example mixed traffic scenario from here: https://github.com/matsim-org/matsim/tree/master/examples/scenarios/equil-mixedTraffic

First, under the qsim params, the configuration file has

  <param name="vehiclesSource" value="modeVehicleTypesFromVehiclesData" />

Using this, resulted in the following error.

Exception in thread "main" java.lang.IllegalArgumentException: Error trying to set value modeVehicleTypesFromVehiclesData for type org.matsim.core.config.groups.QSimConfigGroup$VehiclesSource: possible values are defaultVehicle, fromVehiclesData at org.matsim.core.config.ReflectiveConfigGroup.invokeSetter(ReflectiveConfigGroup.java:328).............

So, I changed it to

  <param name="vehiclesSource" value="fromVehiclesData" />

But, now I am getting new errors as shown below.

2017-04-23 14:50:40,422 ERROR MatsimRuntimeModifications:54 Getting uncaught Exception in Thread main
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error in custom provider, java.lang.RuntimeException: No TravelDisutilityFactory bound for mode bicycle.
at org.matsim.core.router.TripRouterModule.install(TripRouterModule.java:59) (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$1 -> org.matsim.core.controler.ControlerDefaultsModule -> org.matsim.core.router.TripRouterModule)
while locating org.matsim.core.router.RoutingModule annotated with @com.google.inject.name.Named(value=bicycle)
while locating org.matsim.core.router.RoutingModule annotated with @com.google.inject.multibindings.Element(setName=,uniqueId=54, type=MAPBINDER, keyType=java.lang.String)
at org.matsim.core.router.TripRouter.<init>(TripRouter.java:66)
while locating org.matsim.core.router.TripRouter

1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
at org.matsim.core.controler.PrepareForSimImpl$1.getPersonAlgorithm(PrepareForSimImpl.java:76)
at org.matsim.core.controler.PrepareForSimImpl$1.getPersonAlgorithm(PrepareForSimImpl.java:73)
at org.matsim.population.algorithms.ParallelPersonAlgorithmRunner.run(ParallelPersonAlgorithmRunner.java:85)
at org.matsim.core.controler.PrepareForSimImpl.run(PrepareForSimImpl.java:72).....

 


Comments: 1


Re: Issues with mixed traffic example

by Renan Grace on 2017-04-24 00:34:32

You need to add the following code, as described in the tutorial here (crossed out at the bottom). Note this is not needed for the snapshot version (0.9.0) but it seems you are using an earlier version. Alternatively you could upgrade to 0.9.0

controler.addOverridingModule(new AbstractModule() {

@Override

public void install() {

addTravelTimeBinding("bicycle").to(networkTravelTime());

addTravelDisutilityFactoryBinding("bicycle").to(carTravelDisutilityFactoryKey());

}

});

Hope this helps.

Renan.

Clone this wiki locally