-
Notifications
You must be signed in to change notification settings - Fork 179
faq 108515566
by Gregory Macfarlane on 2017-03-18 15:24:29
I'm looking at a scenario where a vehicle is available to take members of a household to their activities with or without members of the household inside. So, like a chauffeur or a household-owned automated vehicle.
It seems that the existing taxi module would work for this, if I could restrict the taxi to only being available to a set of individual ID's. Any ideas on how I might go about implementing this?
by Michal Maciejewski on 2017-03-19 23:05:40
Hi Gregory,
I would start with a slightly customised version of RuleBasedTaxiOptimizer that
- does not pre-filter vehicles and requests based on their location (this is easy, just set the nearestRequestsLimit and nearestRequestsLimit parameters to a very large number, e.g. 9999999)
- uses a different dispatch finder than the standard (and now the only) BestDispatchFinder; this however would require (a) creating a general interface like 'TaxiDispatchFinder', and then (b) adding a constructor to RuleBasedTaxiOptimizer that accepts any DispatchFinder, e.g. "OwnAVDispatchFinder", which you would then need to implement
Please let me know if this is the way you would like to move on with your project/scenario. If yes, I can adapt the taxi code so that you can start coding your dispatching.
Best,
Michal
by Kai Nagel on 2017-03-20 08:52:57
An alternative might be to use "subpopulations". With that, you could have some agents have "taxi" or "av" as mode alternative, and others not.
RunSubpopulationsExample
contains an example of how to use subpopulations in Java. One can use subpopulations also from files only (i.e. without programming java), but I don't think that you can use different sets of mode by subpopulation from file only.
by Kai Nagel on 2017-03-20 08:57:46
And yet another possibility: Add some penalty term to the scoring function for people using the "taxi" modes when they are not allowed to use it. Examples with scoring functions are in RunSubpopulationsExample
and RunExampleIndividualizedScoring
.
Given the nature of MATSim, this may be the easiest way to do this. But also given the nature of MATSim, you will probably always have a small number of "disallowed" agents trying the "taxi" mode in spite of the high penalty.
by Joschka Bischoff on 2017-03-20 14:30:06
Hi Greg,
great to hear from you!
I would also understand it the way Michal proposes.
I've implemented something similar where a certain person group (in our case: wheelchair users) can only get a certain type of taxi.
The priniciple, however, is the same (IDs of passengers and taxis are matched). For an idea how to implement this, see:
To see how it is all plugged together, there is a Run script https://github.com/matsim-org/matsim/tree/f83ea1d00a0e00d79cdeb6328393e9d5c09d0e03/playgrounds/jbischoff/src/main/java/playground/jbischoff/taxi/inclusion
Good luck,
Joschka
You are viewing an archive of the previous MATSim Q&A site. The real site is now at https://matsim.org/faq