Skip to content

faq 88440838

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

dvrp - dynagent : set destination

by Tom Tim on 2016-10-05 08:56:16


Hello, I am working through the dvrp-extension and am trying to modify the "dynAgent"-example in a way, so that I can set the destination of an agent, once a given condition is fullfilled (e.g. after passing 10 links → set destination link to link 5).

So far i can only change the exact next link by modifying the "doRandomChoice()"-method in the "RandomDynActivity"-class. Where do I have to tell the agent to stop driving around randomly and start driving to the new destination?


Comments: 1


Re: dvrp - dynagent : set destination

by Joschka Bischoff on 2016-10-05 09:27:16

Hi Tom,

you need to change the RandomDynLeg-class for this. Here you can set an condition on when to end a leg, the Activity will then come next.

For getting from link 10 to link 5, you may need to include some sort of routing into the DynLeg.


I'm working with the DynAgent package to include parking search into a scenario. For the time being, this is only in my playground, but it will move to the Parking contrib eventually:

https://github.com/matsim-org/matsim/tree/master/playgrounds/jbischoff/src/main/java/playground/jbischoff/parking

Have especially a look at the ParkingDynLeg and the ParkingAgentLogic.

Hope this helps,


Joschka


Clone this wiki locally