-
Notifications
You must be signed in to change notification settings - Fork 179
faq 160268310
by cui yi on 2018-01-26 02:17:14
Hi Professor,
I have read the page "Mixed traffic".
https://matsim.atlassian.net/wiki/spaces/MATPUB/pages/84246576/Mixed+traffic
But there are two points I fell puzzled.
One is the "Addition" at the page bottom. How to use this part code about controler.addOverridingModule(new AbstractModule() ? My MATSim version is version 0.9.0.
Another one,I want to simulate five modes traffic and do the confige file imitating above page .These traffic modes are car,bus,bike,pedestrian and ride. Bur the simulation can not run. Here I will load the log file. Please!
MY confige file:
<config>
<module name="global">
<param name="randomSeed" value="3467"/>
<param name="coordinateSystem" value="EPSG:32649"/>
<param name="numberOfThreads" value= "4"/>
</module>
<!-- ====================================================================== -->
<module name="network">
<param name="inputNetworkFile" value="E:/nanning4/network4.xml"/>
</module>
<!-- ====================================================================== -->
<module name="plans">
<param name="inputPersonAttributesFile" value="null"/>
<param name="inputPlansFile" value="E:/nanning4/population00.xml"/>
</module>
<!-- ====================================================================== -->
<module name="plansCalcRoute">
<param name="networkModes" value="car,bus,bike,pedestrian,ride"/>
<parameterset type="teleportedModeParameters" >
<param name="mode" value="ride"/>
<param name="beelineDistanceFactor" value="1.3"/>
<param name="teleportedModeSpeed" value="4.166666666666667"/>
</parameterset>
<parameterset type="teleportedModeParameters" >
<param name="mode" value="pedestrian"/>
<param name="beelineDistanceFactor" value="1.3"/>
<param name="teleportedModeSpeed" value="4.166666666666667"/>
</parameterset>
</module>
<!-- ====================================================================== -->
<module name="controler">
<param name="outputDirectory" value="./output"/>
<param name="firstIteration" value="0"/>
<param name="lastIteration" value="10"/>
<param name="mobsim" value="qsim"/>
<param name="eventsFileFormat" value="xml"/>
<param name="snapshotFormat" value=""/>
<param name="writeSnapshotsInterval" value="10"/>
</module>
<!-- ====================================================================== -->
<module name="qsim">
<param name="endTime" value="23:59:59"/>
<param name="vehiclesSource" value="modeVehicleTypesFromVehiclesData"/>
<param name="mainMode" value="car,bus,bike"/>
<param name="flowCapacityFactor" value="0.10"/>
<param name="storageCapacityFactor" value="0.09"/>
<param name="linkDynamics" value="PassingQ"/>
<param name="trafficDynamics" value="queue"/>
<param name="startTime" value="00:00:00"/>
<param name="endTime" value="23:59:59"/>
<param name="snapshotperiod" value = "00:01:00"/>
</module>
<!-- ====================================================================== -->
<module name="vehicles" >
<param name="vehiclesFile" value="E:/nanning4/vehicles.xml"/>
</module>
<!-- ====================================================================== -->
<module name="planCalcScore" >
<param name="learningRate" value="0.8"/>
<param name="BrainExpBeta" value="2.0"/>
<param name="traveling" value="-6"/>
<param name="marginalUtilityOfMoney" value="1.0"/>
<param name="utilityOfLineSwitch" value="-1.0"/>
<param name="lateArrival" value="-18"/>
<param name="performing" value="+6"/>
<param name="waiting" value="-0"/>
<param name="earlyDeparture" value="-0.0"/>
<param name="waitingPt" value="-0.0002"/>
<parameterset type="modeParams">
<param name="mode" value="car"/>
<param name="constant" value= "1.0"/>
<param name="marginalUtilityOfDistance_util_m" value= "0.0"/>
<param name="marginalUtilityOfTraveling_util_hr" value= "-6.0"/>
<param name="monetaryDistanceRate" value= "-0.0002"/>
<param name="mode" value="bus"/>
<param name="constant" value= "0.0"/>
<param name="marginalUtilityOfDistance_util_m" value= "0.0"/>
<param name="marginalUtilityOfTraveling_util_hr" value= "-6.0"/>
<param name="monetaryDistanceRate" value= "-0.0002"/>
<param name="mode" value="bike"/>
<param name="constant" value= "0.0"/>
<param name="marginalUtilityOfDistance_util_m" value= "0.0"/>
<param name="marginalUtilityOfTraveling_util_hr" value= "-6.0"/>
<param name="monetaryDistanceRate" value= "-0.0002"/>
<param name="mode" value="pedestrian"/>
<param name="constant" value= "0.0"/>
<param name="marginalUtilityOfDistance_util_m" value= "0.0"/>
<param name="marginalUtilityOfTraveling_util_hr" value= "-6.0"/>
<param name="monetaryDistanceRate" value= "-0.0002"/>
<param name="mode" value="ride"/>
<param name="constant" value= "0.0"/>
<param name="marginalUtilityOfDistance_util_m" value= "0.0"/>
<param name="marginalUtilityOfTraveling_util_hr" value= "-6.0"/>
<param name="monetaryDistanceRate" value= "-0.0002"/>
</parameterset>
<parameterset type="activityParams">
<param name="activityType" value="h"/> <!-- home -->
<param name="priority" value="1"/>
<param name="typicalDuration" value="8:00:00"/>
<param name="minimalDuration" value="undefined"/>
<param name="openingTime" value=""/>
<param name="latestStartTime" value=""/>
<param name="closingTime" value=""/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="w"/> <!-- work -->
<param name="priority" value="1"/>
<param name="typicalDuration" value="8:00:00"/>
<param name="minimalDuration" value="undefined"/>
<param name="openingTime" value="07:00:00"/>
<param name="latestStartTime" value="09:00:00"/>
<param name="closingTime" value="18:00:00"/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="school"/> <!-- school -->
<param name="priority" value="1"/>
<param name="typicalDuration" value="6:00:00"/>
<param name="minimalDuration" value="4:00:00"/>
<param name="openingTime" value="08:00:00"/>
<param name="latestStartTime" value="08:30:00"/>
<param name="closingTime" value="16:30:00"/>
<param name="earliestEndTime" value="16:00:00"/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="hospital"/> <!-- hospital -->
<param name="priority" value="1"/>
<param name="typicalDuration" value=""/>
<param name="minimalDuration" value=""/>
<param name="openingTime" value=""/>
<param name="latestStartTime" value=""/>
<param name="closingTime" value=""/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="escort"/> <!-- escort -->
<param name="priority" value="1"/>
<param name="typicalDuration" value=""/>
<param name="minimalDuration" value="undefined"/>
<param name="openingTime" value=""/>
<param name="latestStartTime" value=""/>
<param name="closingTime" value=""/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="leisure"/> <!-- leisure -->
<param name="priority" value="1"/>
<param name="typicalDuration" value=""/>
<param name="minimalDuration" value="undefined"/>
<param name="openingTime" value=""/>
<param name="latestStartTime" value=""/>
<param name="closingTime" value=""/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="visit"/> <!-- visit -->
<param name="priority" value="1"/>
<param name="typicalDuration" value=""/>
<param name="minimalDuration" value="undefined"/>
<param name="openingTime" value=""/>
<param name="latestStartTime" value=""/>
<param name="closingTime" value=""/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="shopping"/> <!-- shopping -->
<param name="priority" value="1"/>
<param name="typicalDuration" value="1:00:00"/>
<param name="minimalDuration" value="00:30:00"/>
<param name="openingTime" value=""/>
<param name="latestStartTime" value=""/>
<param name="closingTime" value=""/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="farming"/> <!-- farming -->
<param name="priority" value="1"/>
<param name="typicalDuration" value=""/>
<param name="minimalDuration" value="undefined"/>
<param name="openingTime" value=""/>
<param name="latestStartTime" value=""/>
<param name="closingTime" value=""/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="business"/> <!-- business -->
<param name="priority" value="1"/>
<param name="typicalDuration" value=""/>
<param name="minimalDuration" value="00:30:00"/>
<param name="openingTime" value="8:00:00"/>
<param name="latestStartTime" value=""/>
<param name="closingTime" value="18:00:00"/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
<param name="activityType" value="other"/> <!-- other -->
<param name="priority" value="1"/>
<param name="typicalDuration" value=""/>
<param name="minimalDuration" value="undefined"/>
<param name="openingTime" value=""/>
<param name="latestStartTime" value=""/>
<param name="closingTime" value=""/>
<param name="earliestEndTime" value=""/>
<param name="scoringThisActivityAtAll" value=""/>
</parameterset>
</module>
<!-- ====================================================================== -->
<module name="strategy">
<param name="maxAgentPlanMemorySize" value="5"/> <!-- 0 means unlimited -->
<param name="ModuleProbability_1" value="0.8"/>
<param name="Module_1" value="BestScore"/>
<param name="ModuleProbability_2" value="0.1"/>
<param name="Module_2" value="ReRoute"/>
<param name="ModuleProbability_3" value="0.1"/>
<param name="Module_3" value="TimeAllocationMutator"/>
</module>
<!-- ====================================================================== -->
<module name="travelTimeCalculator" >
<param name="analyzedModes" value="car,bus,bike,pedestrian,ride"/>
<param name="separateModes" value="true"/>
</module>
<!-- ====================================================================== -->
<module name="changeMode">
<param name="modes" value="car,bus,bike,pedestrian,ride"/>
</module>
<!-- ====================================================================== -->
<module name="TimeAllocationMutator">
<param name="mutationRange" value="900.0"/>
</module>
<!-- ====================================================================== -->
<module name="subtourModeChoice" >
<!-- Defines the chain-based modes, seperated by commas -->
<param name="chainBasedModes" value="car"/>
<!-- Defines whether car availability must be considered or not. A agent has no car only if it has no license, or never access to a car -->
<param name="considerCarAvailability" value="true"/>
<!-- Defines all the modes available, including chain-based modes, seperated by commas -->
<param name="modes" value="car,bus,bike,pedestrian,ride"/>
</module>
</config>
by Amit Agarwal on 2018-01-26 09:59:55
Dear Cui Yi,
(a) Since, you are using MATSim.0.9.0, additional bindings are not required.
(b) There is no limit on the number of modes.
Your error in the log file is due to the wrong name of the config group ({{<module name="plansCalcRoute">}}). Please note that the names are case sensitive and correct name is
{{<module name="planscalcroute" >}}.
It is likely that after fixing above, you get another exception. Reason is as follows.
Since, you are setting teleportation parameters for 'ride' and 'pedestrian', they should not be in the network modes. In general, every mode can have ONLY one type of router (either network router or teleportation router).
<param name="networkModes" value="car,bus,bike"/>
Hope this is helpful.
Regards,
Amit
You are viewing an archive of the previous MATSim Q&A site. The real site is now at https://matsim.org/faq