matsim-org / matsim-code-examples

A repository containing code examples around MATSim
GNU General Public License v3.0
81 stars 178 forks source link

Problem with Car availability attribute #1090

Open ArezHK opened 7 months ago

ArezHK commented 7 months ago

Hello,

I've been attempting to incorporate car availability into my scenario, but I've encountered an issue. I utilized subtourModeChoice and set considerCarAvailability to true. Additionally, I tried adding car availability in my plans file as persons attributes, but unfortunately, it's not working, and at the end of the iterations agents don't consider car availability and even if I set car availibility to never for them, they still use car mode (indeed I want to force them to use only the other mode available which is pt).

2024-02-29T13:46:44,831 INFO LegHistogramListener:80 number of car legs: 26 68.42105263157895% 2024-02-29T13:46:44,831 INFO LegHistogramListener:80 number of pt legs: 4 10.526315789473685% 2024-02-29T13:46:44,831 INFO LegHistogramListener:80 number of walk legs: 8 21.05263157894737%

In my plans file, I attempted to implement this attribute using three different methods, but neither of them worked.

Firstly, I tried this combination: image

Secondly, I attempted this combination: image

Thirdly, I attempted this combination: image

My plans file is based on "http://www.matsim.org/files/dtd/population_v6.dtd". I even tried other population/plan file type but I got an error stating that attribute should be defined for the element type person.

I would appreciate it if you could assist me with this issue.