-
Notifications
You must be signed in to change notification settings - Fork 181
faq 109091299
by Sashi Gurram on 2017-04-25 15:18:47
Dear All,
My project is trying to explore if the population in my area can shift to alternate travel modes (mainly public transit options like buses) without making major modifications to the initial plans. To achieve this, I am trying to use the ChangeTripMode strategy to see if the agents in my population are able to choose sensible transit choices. Along with this mode innovation strategy, I am also using the TimeAllocationMutator and BestScore (or in some case SelectExpBeta). Below is my relevant portion of the config file.
<module name="TimeAllocationMutator" >
<param name="mutationAffectsDuration" value="true" />
<param name="mutationRange" value="900.0" />
</module>
<module name="changeMode" >
<param name="ignoreCarAvailability" value="false" />
<param name="modes" value="car, bus" />
</module>
<module name="strategy" >
<param name="ExternalExeConfigTemplate" value="null" />
<param name="ExternalExeTimeOut" value="3600" />
<param name="ExternalExeTmpFileRootDir" value="null" />
<param name="fractionOfIterationsToDisableInnovation" value="Infinity" />
<param name="maxAgentPlanMemorySize" value="5" />
<param name="planSelectorForRemoval" value="WorstPlanSelector" />
<parameterset type="strategysettings" >
<param name="strategyName" value="ChangeTripMode" />
<param name="weight" value="0.2" />
</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.7" />
</parameterset>
</module>
But, when I run this configuration, some agents' plans are choosing transit modes that do not make any sense.
Look at the following partial-initial plan for an agent.
<person id="1002702">
<plan>
<act end_time="08:28:00" start_time="03:00:00" type="home" x="348792.644941" y="3113157.62085"/>
<leg mode="car"/>
<act end_time="12:36:00" start_time="08:53:00" type="work" x="346659.965964" y="3097857.03861"/>
<leg mode="car"/>
<act end_time="13:27:00" start_time="12:47:00" type="shop" x="352713.772051" y="3097587.67855"/>
.......
The selected plan for this agent is shown below
<plan score="-87.8049431229858" selected="yes">
<act type="home" link="108218" x="348792.644941" y="3113157.62085" start_time="03:00:00" end_time="08:14:17" />
<leg mode="transit_walk" trav_time="01:57:19">
<route type="generic" start_link="108218" end_link="81898124" trav_time="01:57:19" distance="5866.034244680174"></route>
</leg>
<act type="pt interaction" link="81898124" x="352425.845958" y="3110481.61472" max_dur="00:00:00" />
<leg mode="pt" trav_time="00:43:05">
<route type="experimentalPt1" start_link="81898124" end_link="67336644" trav_time="00:43:05" distance="14282.928398274827">PT1===102672===10===HART_036B===101389</route>
</leg>
<act type="pt interaction" link="67336644" x="352407.451802" y="3097661.50416" max_dur="00:00:00" />
<leg mode="transit_walk" trav_time="00:00:00">
<route type="generic" start_link="67336644" end_link="67336715" trav_time="00:00:00" distance="721.515887422043"></route>
</leg>
<act type="pt interaction" link="67336715" x="352407.451802" y="3097661.50416" max_dur="00:00:00" />
<leg mode="pt" trav_time="00:35:14">
<route type="experimentalPt1" start_link="67336715" end_link="63106268" trav_time="00:35:14" distance="5836.2821677199">PT1===101390===10===HART_034B===101007</route>
</leg>
<act type="pt interaction" link="63106268" x="346937.967425" y="3097786.00002" max_dur="00:00:00" />
<leg mode="transit_walk" trav_time="00:07:27">
<route type="generic" start_link="63106268" end_link="62686310" trav_time="00:07:27" distance="373.01459242579847"></route>
</leg>
<act type="work" link="62686310" x="346659.965964" y="3097857.03861" start_time="08:53:00" end_time="12:37:14" />
<leg mode="transit_walk" trav_time="00:23:26">
<route type="generic" start_link="62686310" end_link="63496375" trav_time="00:23:26" distance="1172.0001672134492"></route>
</leg>
<act type="pt interaction" link="63496375" x="347557.241748" y="3097769.47151" max_dur="00:00:00" />
<leg mode="pt" trav_time="00:27:34">
<route type="experimentalPt1" start_link="63496375" end_link="67656795" trav_time="00:27:34" distance="5280.139349479901">PT1===101065===10===HART_034===101423</route>
</leg>
<act type="pt interaction" link="67656795" x="352815.294638" y="3097657.16119" max_dur="00:00:00" />
<leg mode="transit_walk" trav_time="00:03:11">
<route type="generic" start_link="67656795" end_link="67336765" trav_time="00:03:11" distance="159.92997610212166"></route>
</leg>
<act type="shop" link="67336765" x="352713.772051" y="3097587.67855" start_time="12:47:00" end_time="13:29:27" />
Clearly, the person has to walk for almost 2 hours to reach the first transit stop from home and it is taking the agent almost 3 hours and 20 minutes to reach his place of work. Simulating this same route on an un-congested road via the car mode takes about 12 minutes.
GIven this, I am a bit concerned that the way I am using MATSim could lead to erroneous and nonsensical results where activity-travel patterns are drastically changed. Can you kindly suggest some alternatives that will allow my agents to explore public transit options while remaining mostly-faithful to their initial plans.
I am using the latest build MATSim-09c07b3
by Marcel Rieser on 2017-04-25 20:51:45
Basically, MATSim has to try out variations to figure out if a plan is good or bad, and it does this by (sometimes randomly) varying existing plans. It is possible and very likely that MATSim creates bad plans for agents, but it does not know so before it has not at least once executed the plan in the mobsim. And even then, the plans may exist for a while before they get replaced by better plans (depending on the maxAgentPlanMemorySize
parameter in the config). So what you observed is likely one of those plans that got just generated and likely tested once.
Typically, most such plans should vanish if enough iterations are run, except the ones just generated in the last replanning phase.
To get rid of even those, it is often advised to disable the creation of new plans after some iterations (parameter fractionOfIterationsToDisableInnovation
). Then, no new plan variants will be created after a while, and thus also no new probably bad plans, and only (mostly) good plans should stay the agents can choose from.
You are viewing an archive of the previous MATSim Q&A site. The real site is now at https://matsim.org/faq