1
0
-1

In the reality, the bus and tram may shares road with passenger cars.

As the instruction of Mixed traffic, I defined the following:

1) Some link on the network with allowed mode (car, pt), or only pt

2) For the plans, some agents are having 'pt' as leg mode.

3) I defined a vehicle file with vehicles which ID is equal to the person ID, for every person, but there is another vehicle definition as transitVehicles.xml, which includes tram and two types of train.

4) The config is set as the demonstration did.


However, it throws the following exception:

Exception in thread "main" com.google.inject.CreationException: Unable to create injector, see the following errors:
1) A binding to org.matsim.core.router.RoutingModule annotated with @com.google.inject.name.Named(value=pt) was already configured at org.matsim.core.router.TripRouterModule.install(TripRouterModule.java:65) (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).
at org.matsim.core.router.TripRouterModule.install(TripRouterModule.java:70) (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)
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:232)
at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:236)
at org.matsim.core.controler.Injector.createInjector(Injector.java:72)
at org.matsim.core.controler.Controler.run(Controler.java:192)
at NetworkFromSaturn.CreateRandomPlan.main(CreateRandomPlan.java:80)


I have read a few use cases in MATSim, like pt-tutorial but none of them combines the passenger car network with the public transit network. Therefore, how do we actually model the interaction on the road between public transit mode and car? If we would like to create a bus only link, what is the procedure to create it?

    CommentAdd your comment...

    1 answer

    1.  
      2
      1
      0

      Don't use pt as allowed mode on the links. pt is the mode the passengers use. The transit vehicles should use modes like trainbustram or something similar.


      Based on your description, it looks like you tried to assign pt to the transit vehicles, but as it is already used for the transit passengers, MATSim complains.

      1. Enoch Lee

        Thank you, now I use 'tram' as the allowed mode on the links, and the simulation runs. Also, in the last simulation result, the 'tram only' road doesn't have any other car passes through.

        Another modification I did is to remove 'tram' from the transitModes of transit of config file. Now is

        <param name="transitModes" value="pt" />
      CommentAdd your comment...