Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distance to leader when using ACC car-following model #13681

Closed
adoreador opened this issue Aug 2, 2023 · 9 comments
Closed

Distance to leader when using ACC car-following model #13681

adoreador opened this issue Aug 2, 2023 · 9 comments
Assignees
Milestone

Comments

@adoreador
Copy link

Hello, I have some questions about the edgedata in my simulation. I have set up a three-lane simulation with ACC (Adaptive Cruise Control) as the car-following model. The vehicle length is 4.75 meters, and I have set tau="1.0", mingap="1.5", and desiredMaxSpeed="15.39". This configuration resulted in a stable traffic flow, and I have set the edgedata frequency to 10 seconds.
In the output file, I obtained the values density="98.18", laneDensity="32.73", and speed="15.27". However, when I calculated the laneDensity as 1000 / Headway, using Headway = length + minGap + tau * speed, I noticed that it does not match the previously obtained value. I'm a bit puzzled by this discrepancy and would greatly appreciate any insight you could provide.

Thank you for your assistance.

@m-kro m-kro changed the title Some questions about the edgedata Distance to leader when using ACC car-following model Aug 2, 2023
@robertalms
Copy link
Contributor

Thanks for your question, but densities is a complex matter, so I fear your question is not precise enough to explain your discrepant expectation adequately.

  1. It would be very helpful, if you provided an example to replicate the scenario with your edgedata outputs.
  2. Your rough estimation of a lane density is higher than the edgeData laneDensity, if I understand you correctly?! Mind, that you'd have to configure multiple things in your scenario to validate your expected outcome: see doc.
  3. So far, I don't see that your issue is specifically related to the ACC model, but be aware that the ACC should run with lower step-length 0.1 (which effects the lane density estimation.) see doc

Maybe also have a look at doc for further insights about the impacts of the vehicle parametrization on the vehicle insertion and consequent traffic density.

@adoreador
Copy link
Author

Thank you for your response. I will proceed to read the document for further learning. By the way, may I continue to ask questions here if I have any in the future?

@robertalms
Copy link
Contributor

Sure, feel free to ask further questions related to the topic here.

@m-kro will close the issue for now, but we can re-open it anytime, in case you/we discover any problems with the lane density related to the ACC model.

@adoreador
Copy link
Author

Hello, I have studied the documentation and reviewed my code, but I still have some questions. Below is a portion of my code from the rou file.

<routes>
        <vType id="auto" length="4.75" carFollowModel="ACC" color="0,0,255" minGap="1.5" tau="1.0" accel="4.0" decel="4" sigma="0.0"
               speedDev="0.0" desiredMaxSpeed="21.02"
               laneChangeModel="LC2013" lcSpeedGain="0.2" lcStrategic="0.2" lcCooperative="0.0" lcKeepRight="0.0" />
        <route id="route" edges="E0 E1 E2" />
    <vehicle id="auto_0" type="auto" route="route" depart="0.000000" departLane="1" departPos="base" departSpeed="21.02" />
    <vehicle id="auto_1" type="auto" route="route" depart="0.000000" departLane="2" departPos="base" departSpeed="21.02" />
    <vehicle id="auto_2" type="auto" route="route" depart="0.000000" departLane="0" departPos="base" departSpeed="21.02" />
    <vehicle id="auto_3" type="auto" route="route" depart="1.300000" departLane="1" departPos="base" departSpeed="21.02" />
    <vehicle id="auto_4" type="auto" route="route" depart="1.300000" departLane="2" departPos="base" departSpeed="21.02" />
    <vehicle id="auto_5" type="auto" route="route" depart="1.300000" departLane="0" departPos="base" departSpeed="21.02" />

This is the "add" section of the code.

<additional>
    <edgeData id="ed" freq="100" file="data1.xml" edges="E1"   />
</additional>

Below is a partial output of the "edgedata" code. After performing calculations, I found that the theoretical Density should be 110, and laneDensity should be 36.667. However, there seems to be a discrepancy with the output from "edgedata." I have been troubleshooting for a while and can't figure out the reason. Could you please provide some insights?

    <interval begin="600.00" end="700.00" id="ed">
        <edge id="E1" sampledSeconds="8962.75" traveltime="47.57" overlapTraveltime="47.80" density="89.63" laneDensity="29.88" occupancy="14.12" waitingTime="0.00" timeLoss="0.00" speed="21.02" speedRelative="0.63" departed="0" arrived="0" entered="186" left="186" laneChangedFrom="0" laneChangedTo="0"/>
    </interval>
    <interval begin="700.00" end="800.00" id="ed">
        <edge id="E1" sampledSeconds="8962.15" traveltime="47.57" overlapTraveltime="47.80" density="89.62" laneDensity="29.87" occupancy="14.12" waitingTime="0.00" timeLoss="0.00" speed="21.02" speedRelative="0.63" departed="0" arrived="0" entered="189" left="189" laneChangedFrom="0" laneChangedTo="0"/>
    </interval>
    <interval begin="800.00" end="900.00" id="ed">
        <edge id="E1" sampledSeconds="8962.75" traveltime="47.57" overlapTraveltime="47.80" density="89.63" laneDensity="29.88" occupancy="14.12" waitingTime="0.00" timeLoss="0.00" speed="21.02" speedRelative="0.63" departed="0" arrived="0" entered="186" left="186" laneChangedFrom="0" laneChangedTo="0"/>
    </interval>
    <interval begin="900.00" end="1000.00" id="ed">
        <edge id="E1" sampledSeconds="8962.15" traveltime="47.57" overlapTraveltime="47.80" density="89.62" laneDensity="29.87" occupancy="14.12" waitingTime="0.00" timeLoss="0.00" speed="21.02" speedRelative="0.63" departed="0" arrived="0" entered="189" left="189" laneChangedFrom="0" laneChangedTo="0"/>
    </interval>
    <interval begin="1000.00" end="1100.00" id="ed">
        <edge id="E1" sampledSeconds="8962.75" traveltime="47.57" overlapTraveltime="47.80" density="89.63" laneDensity="29.88" occupancy="14.12" waitingTime="0.00" timeLoss="0.00" speed="21.02" speedRelative="0.63" departed="0" arrived="0" entered="186" left="186" laneChangedFrom="0" laneChangedTo="0"/>
    </interval>

@robertalms
Copy link
Contributor

Hi, I looked into the issue a bit further and it might be so that there is a bug in the ACC model. Xiao et. al extended the ACC model with a dynamic spacing margin (see eq.6 on page 6). This was introduced to the code base in #11778, but I suspect, the fix unnecessarily adds the vehicle length L to the equation. Therefore the controller overcompensates the spacing, which ultimately reduces the capacity on the the road (in your case the density).

This should be easily fixed, but it affects a lot of tests, so it might take a while. (Simply reverting back doesn't make sense, because the spacing margin solves a lot of crashes in different cases).

@robertalms
Copy link
Contributor

robertalms commented Aug 3, 2023

If you desperately need it, you could fix it for yourself and build your own SUMO (see documentation) by adapting the lines 180-186 in the ACC model

https://github.com/eclipse/sumo/blob/7af8a512f19677f008cf868b27a0c6268b7d75ac/src/microsim/cfmodels/MSCFModel_ACC.cpp#L179-L186

to something like this:

// see dynamic gap margin definition from (Xiao et. al, 2018)
    if (speed < 10.8){
        spacingErr = spacingErr  - 2;
    } else if (speed <= 15.0 && speed >= 10.8){
        spacingErr = spacingErr - (75/speed);
    } else {
        spacingErr = spacingErr ;
    }

@m-kro m-kro added bug and removed question labels Aug 3, 2023
@adoreador
Copy link
Author

Thank you very much for your patient explanations and guidance. I will study the ACC model further based on your advice. Additionally, I would like to inquire if you are familiar with the CACC model. I want to know if the default parameters of the CACC model in SUMO are the same as the parameters calibrated by the PATH Laboratory. This is of great importance to me.

Thank you again for your patient guidance and answers!

@robertalms
Copy link
Contributor

You may double check with the references in CACC, but as far as I know, the default control gains should have the values you're refering to, since those authors collaborated with the PATH laboratory.
Note that, there is a 4th mode with additional gains added in SUMOs CACC model. Also, both, the ACC and CACC model, are not that well testet and should be used with caution when deployed in complex traffic scenarios.

Thanks to you also, feedback and support on these models is always appreciated!

@m-kro m-kro added this to the 1.20.0 milestone Aug 15, 2023
@robertalms
Copy link
Contributor

I have looked into it and the fix for the spacing margin seems to working, but it produces now again some collisions for the following test: tests/sumo/cf_model/drive_in_circles_small/ACC/ . (Note, crashes occurred before the spacing margin was introduced already, since the test runs with steplength=1s which is not ideal for the ACC model.)

@behrisch What do we do with such a test? Does it have to be tagged as a known bug?

robertalms added a commit to robertalms/sumo that referenced this issue Aug 29, 2023
robertalms added a commit to robertalms/sumo that referenced this issue Aug 29, 2023
robertalms added a commit to robertalms/sumo that referenced this issue Sep 21, 2023
robertalms added a commit to robertalms/sumo that referenced this issue Sep 21, 2023
behrisch pushed a commit that referenced this issue Sep 21, 2023
)

* Fix for ACC spacing margin #13681

* Fix in equation (5) for spacing margin #13681

* patching expected results refs #21 #13681

* patching test, known bug, refs #21 #13681 #4551
@m-kro m-kro modified the milestones: 1.20.0, 1.19.0 Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants