Is there a way is VISSIM-COM to change the values of two driving behavior parameters using Python?

77 Views Asked by At

I am new to VISSIM-COM and am trying to calibrate a model in VISSIM using COM through coding in Python. I could do all the steps using COM-help from VISSIM. However, when I reached the point of setting the hyperparameters of the driving behavior, I got stuck and kept getting errors. I want to change both the maximum look ahead and minimum look ahead. Here is what I tried:

Vissim.Net.DrivingBehaviors.SetAttValue('LookAheadDistMax', 500)

I am expecting the maximum look ahead to be 500 and the minimum look ahead to be 200. Thank you for your help!

1

There are 1 best solutions below

2
On

DrivingBehaviors is the container of all driving behaviors, while 'LookAheadDistMax' is an attribute on the individual driving behavior. In other words, you need to access a specific driving behavior. For example:

Vissim.Net.DrivingBehaviors.ItemByKey(2).SetAttValue('LookAheadDistMax', 500)

where the 2 refers to the driving behavior with number 2. You can of course also loop over all driving behaviors. See the "COM/Basic Commands" example shipped with Vissim.