-
Notifications
You must be signed in to change notification settings - Fork 179
faq 191168513
by usha amrutha n on 2018-02-28 01:38:25
Hi ,
I would like to use a trained data-driven model to predict initial demand for certain regions at a timestamp. I would like know if it is possible to generate demand requests dynamically instead of using a plan file. So far, all the examples I came across uses only plans file based on external data. However, I would like to know if I can incorporate and generate taxi requests ( taxi contrib folder) on the fly instead of storing it in a plan.xml file.
Could you please let me know how to go about it?
Thanks!
by Kai Nagel on 2018-02-28 07:15:30
No easy way. (But how should an easy way work here, if the info is supposed to come by code into MATSim?)
If you know Java a bit, you could start from RunWithinDayReplanningAgentExample
in the matsim-code-examples
project. You would have to rewrite the MyAgent
class to your own needs, implementing some other interface instead of MobsimDriverAgent, possibly MobsimPassengerAgent
(but I don't really know, you would need to ask the av/drt implementers, or find out from the code which agent type it needs).
As usual, we recommend to proceed in small steps, first just feed one agent into a small scenario and see what it does; it should actually already work with teleportation only (which would mean to just implement MobsimAgent
) except that for teleportation you need to look at events since nothing is on the network. (If I had a bit more time, I would prepare an example, but alas ...)
Alternatives:
DynAgent (which puts wrappers around the above MobsimXxxAgent classes)
RunWithinDayReplanningFromPlansExample (which starts from plans but modifies them as it goes)
The maintainers of those parts of the code would need to answer for themselves.
by Michal Maciejewski on 2018-02-28 17:29:41
The taxi contrib assumes that there are passengers (agents) in the network, so that the overall simulation is consistent.
But if you do not care about the "reality", and only want to generate and serve mock requests, you may use the DVRP contrib. This is a general-purpose contrib, not restricted to transporting people (one can move goods as well). So you may generate fake requests on the fly and send vehicles there to pick them up and deliver somewhere else.
Would that help?
by Michal Maciejewski on 2018-03-01 23:24:08
I added a simple "one truck example". It is based on "one taxi example", but serves parcels instead of passengers....
You are viewing an archive of the previous MATSim Q&A site. The real site is now at https://matsim.org/faq