-
Notifications
You must be signed in to change notification settings - Fork 181
faq 109219201
by Sashi Gurram on 2017-05-03 08:43:23
I am trying to simulate a variety of modes including car, walk, bicycle, bus, ride, and school bus in MATSim. I can teleport the ride, and school bus modes as they do not significantly affect my later emissions estimation. But, I would like to simulate the rest of the modes (car, bus, bicycle, and walk) on the network and see if agents can shift from one mode (majorly car mode) to another (either bus, bicycle, or walk). But, when I tried to combine the pt with the multimodal scenario, I am running into some errors. I am running this using the nightly build MATSim-09c07b3. I also tried to do this small chunks by first running a multiomodal-only scenario (involving car, bicycle, walk) and a pt-only scenario (involving car and pt). Both of them worked fine. The trouble starts when I try to get all the modes to work in one scenario. I am posting the config below:
<?xml version="1.0"?>
<!DOCTYPE config SYSTEM "http://www.matsim.org/files/dtd/config_v2.dtd">
<config>
<!-- ====================================================================== -->
<module name="global">
<param name="coordinateSystem" value="EPSG:32617" />
</module>
<!-- ====================================================================== -->
<module name="network">
<param name="inputNetworkFile" value="P:/ENG-CEE Trans Rsch/Sashi_Research/C009251 backup/Research/Dissertation/Aim2/ABM/buffered_fileruns/Tampa_ABM_base_2010/network_allmod.xml" />
</module>
<!-- ====================================================================== -->
<module name="plans">
<param name="inputPlansFile" value="P:/ENG-CEE Trans Rsch/Sashi_Research/C009251 backup/Research/Dissertation/Aim2/ABM/buffered_fileruns/Tampa_ABM_base_2010/plansallmod_pt.xml" />
</module>
<!-- ====================================================================== -->
<module name="controler">
<param name="outputDirectory" value="C:/Users/sgurram/Desktop/matsim-0.8.1/testruns1/multiomodal_plus_transit" />
<param name="firstIteration" value="0" />
<param name="lastIteration" value="300" />
<param name="mobsim" value="qsim" />
<param name="routingAlgorithmType" value="AStarLandmarks" />
<param name="writeEventsInterval" value="10" />
<param name="snapshotFormat" value="" />
<param name="overwriteFiles" value="deleteDirectoryIfExists" />
</module>
<!-- ====================================================================== -->
<module name="qsim">
<param name="endTime" value="32:00:00" />
<param name="flowCapacityFactor" value="0.01" />
<param name="storageCapacityFactor" value="0.03" />
<param name="removeStuckVehicles" value="false" />
<param name = "snapshotperiod" value = "00:00:10"/>
<param name= "mainMode" value= "car,bus,walk,bicycle" />
<param name= "vehicleBehavior" value="wait" />
<param name="linkDynamics" value="PassingQ" />
<param name="vehiclesSource" value="modeVehicleTypesFromVehiclesData" />
<param name= "usePersonIdForMissingVehicleId" value="true" />
</module>
<!-- ====================================================================== -->
<module name="vehicles" >
<param name="vehiclesFile" value="C:/Users/sgurram/Desktop/matsim-0.8.1/testruns1/vehicles.xml" />
</module>
<!-- ====================================================================== -->
<module name="travelTimeCalculator" >
<param name="analyzedModes" value="car,bicycle,walk" />
<param name="separateModes" value="true" />
</module>
<!-- ====================================================================== -->
<module name="planscalcroute" >
<param name="networkModes" value="car,walk,bicycle" />
<parameterset type="teleportedModeParameters" >
<param name="beelineDistanceFactor" value="null" />
<param name="mode" value="ride" />
<param name="teleportedModeFreespeedFactor" value="1.2" />
<param name="teleportedModeSpeed" value="null" />
</parameterset>
<parameterset type="teleportedModeParameters" >
<param name="beelineDistanceFactor" value="null" />
<param name="mode" value="school bus" />
<param name="teleportedModeFreespeedFactor" value="1.2" />
<param name="teleportedModeSpeed" value="null" />
</parameterset>
</module>
<!-- ====================================================================== -->
<module name="planCalcScore">
<param name="learningRate" value="1.0" />
<param name="BrainExpBeta" value="2.0" />
<param name="lateArrival" value="-18" />
<param name="earlyDeparture" value="-0" />
<param name="performing" value="+6" />
<param name="traveling" value="-6" />
<param name="waiting" value="-0" />
<param name="marginalUtilityOfMoney" value="1.0" />
<param name="utilityOfLineSwitch" value="-1.0" />
<param name="waitingPt" value="-6.0" />
<param name="activityType_0" value="home" /> <!-- home -->
<param name="activityPriority_0" value="1" />
<param name="activityTypicalDuration_0" value="12:00:00" />
<param name="activityType_1" value="work" /> <!-- work -->
<param name="activityPriority_1" value="1" />
<param name="activityTypicalDuration_1" value="08:00:00" />
<param name="activityType_2" value="school" /> <!-- school -->
<param name="activityPriority_2" value="1" />
<param name="activityTypicalDuration_2" value="07:00:00" />
<param name="activityType_3" value="escort" /> <!-- escort -->
<param name="activityPriority_3" value="1" />
<param name="activityTypicalDuration_3" value="01:00:00" />
<param name="activityType_4" value="pers.bus" /> <!-- personal business -->
<param name="activityPriority_4" value="1" />
<param name="activityTypicalDuration_4" value="02:00:00" />
<param name="activityType_5" value="shop" /> <!-- shop -->
<param name="activityPriority_5" value="1" />
<param name="activityTypicalDuration_5" value="01:00:00" />
<param name="activityType_6" value="meal" /> <!-- meal -->
<param name="activityPriority_6" value="1" />
<param name="activityTypicalDuration_6" value="01:00:00" />
<param name="activityType_7" value="social" /> <!-- social -->
<param name="activityPriority_7" value="1" />
<param name="activityTypicalDuration_7" value="01:00:00" />
<param name="activityType_8" value="change-mode" /> <!-- change-mode -->
<param name="activityPriority_8" value="1" />
<param name="activityTypicalDuration_8" value="00:30:00" />
<parameterset type="modeParams" >
<param name="constant" value="0.0" />
<param name="marginalUtilityOfDistance_util_m" value="0.0" />
<param name="marginalUtilityOfTraveling_util_hr" value="-6.0" />
<param name="mode" value="car" />
<param name="monetaryDistanceRate" value="0.0" />
</parameterset>
<parameterset type="modeParams" >
<param name="constant" value="0.0" />
<param name="marginalUtilityOfDistance_util_m" value="0.0" />
<param name="marginalUtilityOfTraveling_util_hr" value="-6.0" />
<param name="mode" value="bicycle" />
<param name="monetaryDistanceRate" value="0.0" />
</parameterset>
<parameterset type="modeParams" >
<param name="constant" value="0.0" />
<param name="marginalUtilityOfDistance_util_m" value="0.0" />
<param name="marginalUtilityOfTraveling_util_hr" value="-6.0" />
<param name="mode" value="walk" />
<param name="monetaryDistanceRate" value="0.0" />
</parameterset>
<parameterset type="modeParams" >
<param name="constant" value="0.0" />
<param name="marginalUtilityOfDistance_util_m" value="0.0" />
<param name="marginalUtilityOfTraveling_util_hr" value="-6.0" />
<param name="mode" value="pt" />
<param name="monetaryDistanceRate" value="0.0" />
</parameterset>
</module>
<!-- ====================================================================== -->
<module name="TimeAllocationMutator" >
<param name="mutationAffectsDuration" value="true" />
<param name="mutationRange" value="900.0" />
</module>
<!-- ====================================================================== -->
<module name="transit" >
<param name="inputScheduleCRS" value="null" />
<param name="transitLinesAttributesFile" value="null" />
<param name="transitModes" value="pt" />
<param name="transitScheduleFile" value="P:/ENG-CEE Trans Rsch/Sashi_Research/C009251 backup/Research/Dissertation/Aim2/ABM/buffered_fileruns/Tampa_ABM_base_2010/trnschedule.xml" />
<param name="transitStopsAttributesFile" value="null" />
<param name="useTransit" value="true" />
<param name="vehiclesFile" value="P:/ENG-CEE Trans Rsch/Sashi_Research/C009251 backup/Research/Dissertation/Aim2/ABM/buffered_fileruns/Tampa_ABM_base_2010/transitvehicles.xml" />
</module>
<!-- ====================================================================== -->
<module name="transitRouter" >
<param name="additionalTransferTime" value="0.0" />
<param name="extensionRadius" value="200.0" />
<param name="maxBeelineWalkConnectionDistance" value="100.0" />
<param name="searchRadius" value="1000.0" />
</module>
<!-- ====================================================================== -->
<module name="subtourModeChoice" >
<param name="chainBasedModes" value="car,pt" />
<param name="considerCarAvailability" value="true" />
<param name="modes" value="car,bicycle,walk,pt" />
</module>
<!-- ====================================================================== -->
<module name="strategy" >
<param name="ExternalExeConfigTemplate" value="null" />
<param name="ExternalExeTimeOut" value="3600" />
<param name="ExternalExeTmpFileRootDir" value="null" />
<param name="fractionOfIterationsToDisableInnovation" value="0.75" />
<param name="maxAgentPlanMemorySize" value="5" />
<param name="planSelectorForRemoval" value="WorstPlanSelector" />
<parameterset type="strategysettings" >
<param name="strategyName" value="SubtourModeChoice" />
<param name="weight" value="0.3" />
</parameterset>
<parameterset type="strategysettings" >
<param name="strategyName" value="TimeAllocationMutator" />
<param name="weight" value="0.1" />
</parameterset>
<parameterset type="strategysettings" >
<param name="strategyName" value="BestScore" />
<param name="weight" value="0.6" />
</parameterset>
</module>
</config>
But, this is resulting in an error as shown below:
2017-04-30 19:22:40,390 ERROR MatsimRuntimeModifications:54 Getting uncaught Exception in Thread main
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.NullPointerException
at org.matsim.pt.router.TransitRouterImplFactory.<init>(TransitRouterImplFactory.java:42)
at org.matsim.pt.router.TransitRouterImplFactory.class(TransitRouterImplFactory.java:33)
while locating org.matsim.pt.router.TransitRouterImplFactory
while locating org.matsim.pt.router.TransitRouter
for the 1st parameter of org.matsim.core.router.Transit.<init>(Transit.java:20)
while locating org.matsim.core.router.Transit
while locating org.matsim.core.router.RoutingModule annotated with @com.google.inject.name.Named(value=pt)
while locating org.matsim.core.router.RoutingModule annotated with @com.google.inject.multibindings.Element(setName=,uniqueId=64, type=MAPBINDER, keyType=java.lang.String)
at org.matsim.core.router.TripRouter.<init>(TripRouter.java:75)
while locating org.matsim.core.router.TripRouter
1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1028)
at org.matsim.analysis.ModeStatsControlerListener.notifyStartup(ModeStatsControlerListener.java:113)
at org.matsim.core.controler.ControlerListenerManagerImpl.fireControlerStartupEvent(ControlerListenerManagerImpl.java:108)
at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:88)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:48)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:31)
at org.matsim.core.controler.AbstractController.run(AbstractController.java:99)
at org.matsim.core.controler.NewControler.run(NewControler.java:79)
at org.matsim.core.controler.Controler.run(Controler.java:205)
at org.matsim.run.Controler.run(Controler.java:56)
at org.matsim.run.Controler.main(Controler.java:60)
Caused by: java.lang.NullPointerException
at org.matsim.pt.router.TransitRouterConfig.<init>(TransitRouterConfig.java:108)
at org.matsim.pt.router.TransitRouterImplFactory.<init>(TransitRouterImplFactory.java:42)
at org.matsim.pt.router.TransitRouterImplFactory$$FastClassByGuice$$a347e0b6.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:61)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:110)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:61)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015)
at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:104)
at com.google.inject.multibindings.MapBinder$RealMapBinder$ValueProvider.get(MapBinder.java:821)
at org.matsim.core.router.TripRouter.<init>(TripRouter.java:77)
at org.matsim.core.router.TripRouter$$FastClassByGuice$$40b051f1.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015)
... 10 more
2017-04-30 19:22:40,422 ERROR MatsimRuntimeModifications:60 ERROR --- This is an unexpected shutdown!
2017-04-30 19:22:40,422 ERROR MatsimRuntimeModifications:63 Shutdown possibly caused by the following Exception:
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.NullPointerException
at org.matsim.pt.router.TransitRouterImplFactory.<init>(TransitRouterImplFactory.java:42)
at org.matsim.pt.router.TransitRouterImplFactory.class(TransitRouterImplFactory.java:33)
while locating org.matsim.pt.router.TransitRouterImplFactory
while locating org.matsim.pt.router.TransitRouter
for the 1st parameter of org.matsim.core.router.Transit.<init>(Transit.java:20)
while locating org.matsim.core.router.Transit
while locating org.matsim.core.router.RoutingModule annotated with @com.google.inject.name.Named(value=pt)
while locating org.matsim.core.router.RoutingModule annotated with @com.google.inject.multibindings.Element(setName=,uniqueId=64, type=MAPBINDER, keyType=java.lang.String)
at org.matsim.core.router.TripRouter.<init>(TripRouter.java:75)
while locating org.matsim.core.router.TripRouter
1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1028)
at org.matsim.analysis.ModeStatsControlerListener.notifyStartup(ModeStatsControlerListener.java:113)
at org.matsim.core.controler.ControlerListenerManagerImpl.fireControlerStartupEvent(ControlerListenerManagerImpl.java:108)
at org.matsim.core.controler.AbstractController$1.run(AbstractController.java:88)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:48)
at org.matsim.core.controler.MatsimRuntimeModifications.run(MatsimRuntimeModifications.java:31)
at org.matsim.core.controler.AbstractController.run(AbstractController.java:99)
at org.matsim.core.controler.NewControler.run(NewControler.java:79)
at org.matsim.core.controler.Controler.run(Controler.java:205)
at org.matsim.run.Controler.run(Controler.java:56)
at org.matsim.run.Controler.main(Controler.java:60)
Caused by: java.lang.NullPointerException
at org.matsim.pt.router.TransitRouterConfig.<init>(TransitRouterConfig.java:108)
at org.matsim.pt.router.TransitRouterImplFactory.<init>(TransitRouterImplFactory.java:42)
at org.matsim.pt.router.TransitRouterImplFactory$$FastClassByGuice$$a347e0b6.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:61)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:110)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:61)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015)
at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:104)
at com.google.inject.multibindings.MapBinder$RealMapBinder$ValueProvider.get(MapBinder.java:821)
at org.matsim.core.router.TripRouter.<init>(TripRouter.java:77)
at org.matsim.core.router.TripRouter$$FastClassByGuice$$40b051f1.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015)
... 10 more
2017-04-30 19:22:40,517 ERROR MatsimRuntimeModifications:78 ERROR --- MATSim unexpectedly terminated. Please check the output or the logfile with warnings and errors for hints.
2017-04-30 19:22:40,517 ERROR MatsimRuntimeModifications:79 ERROR --- results should not be used for further analysis.
2017-04-30 19:22:40,517 ERROR MatsimRuntimeModifications:83 ERROR --- This was an unexpected shutdown! See the log file for a possible reason.
Any help on this is greatly appreciated. I can upload the other files if needed.
by Amit Agarwal on 2017-05-09 11:14:16
Dear Sashi,
Thanks for reporting.
For the simulation of public transport, walk mode (reported as "transit_walk" in plans file) is teleported between two activities; one of the two activity is "pt interaction". Therefore, when you have a walk mode as network mode, the teleportation parameters for the walk mode are not available to the transit router.
In this case, I would suggest to use some other name for walk trips (e.g., "pedestrian") and use "pedestrian" as network mode.
In addition to this, please remove "bus" from the main modes in QSimConfigGroup, this is not required.
I hope, these will fix the issue. Let us know if this does not work.
You are viewing an archive of the previous MATSim Q&A site. The real site is now at https://matsim.org/faq