Skip to content

faq 238190593

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

Sub-population replanning modules

by Gregory Macfarlane on 2018-03-20 16:36:01


It is possible to assign different strategies to different sub-populations? If I am running a simulation with both freight vehicles and with resident passengers, for instance, I want to disable mode innovation for the freight tours but enable it for the passenger daily plans. Where would I start with this?


Comments: 1


Re: Sub-population

by Joschka Bischoff on 2018-03-20 16:42:45

Yes, this possible (almost) out of the box: You'll need a population attributes file containing a subpopulation (ObjectAttributesWriter will do this) attribute for every agent and then you can set for each strategy the weight per subpopulation, i.e.,

<parameterset type="strategysettings">
 			<param name ="subpopulation" value = "freight"/>
 			<param name="strategyName" value="ReRoute"/>
 			<param name="weight" value="0.1"/>
 </parameterset

The personAttributes file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE objectAttributes SYSTEM "http://matsim.org/files/dtd/objectattributes_v1.dtd">

 	<object id="agent_007">
 			<attribute name="subpopulation" class="java.lang.String">superSpyAgent</attribute>
 	</object>
 </objectAttributes>

Joschka

Clone this wiki locally