matsim-org / matsim-libs

Multi-Agent Transport Simulation
www.matsim.org
461 stars 436 forks source link

Configurable DRT constraints #3311

Closed nkuehnel closed 2 weeks ago

nkuehnel commented 3 weeks ago

this is the final change towards more flexible drt optimization constraints - the drt route creator uses a constraint set chooser and constraints calculator to create and update routes.

There are certainly other ways to achieve this, I'm happy for any discussion / feedback.

Use case:

nkuehnel commented 3 weeks ago

I had to borrow the concept from the MultiModeDrtConfigGroup which allows defining a custom supplier for drt config groups for materializing / reading back in configs. The supplier is required for DrtConstraintsSets inside DrtConstraintsParams and needs to be passed to the DrtConfigGroup which is why I added an additional constructor.

It works well but is another change to the drt config group.

https://github.com/matsim-org/matsim-libs/blob/57fa8aa5a414519dad374b1e9650b927d3ffb0fc/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtConfigGroup.java#L190-L204

nkuehnel commented 3 weeks ago

Ah and there's a test added that shows how to do it: https://github.com/matsim-org/matsim-libs/blob/57fa8aa5a414519dad374b1e9650b927d3ffb0fc/contribs/drt/src/test/java/org/matsim/contrib/drt/config/ConfigBehaviorTest.java#L92-L167

marecabo commented 2 weeks ago

LGTM!