0

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!

Mustafa
  • 1
  • 1
  • 1
    It is very difficult to answer your question without seeing any of your data nor any of the solution you have written which produces your problem. Please edit your question to show a minimal reproducible set consisting of sample input, expected output, actual output, and only the relevant code necessary to reproduce the problem. See [Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example "Minimal Reproducible Example") for details on how to best help us help you. – itprorh66 Jun 06 '23 at 14:59
  • Most of the Vissim community exchanges happen on LinkedIn (https://linkedin.com/groups/2524087). So you might get faster answers there. Or you could also contact PTV's technical support. – Sedenion Jun 07 '23 at 11:25

1 Answers1

0

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.

Sedenion
  • 5,421
  • 2
  • 14
  • 42
  • Thank you. it still not working for some reason! It is giving an error that says: "com_error: (-2147418111, 'Call was rejected by callee.', None, None)" – Mustafa Jun 08 '23 at 12:44
  • Try registering the COM server again (which can be found under the help menu in Vissim). – Sedenion Jun 08 '23 at 16:19