Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Need help with lane change issue

Your basic idea is correct but you are setting object parameters in the wrong place.

- there is not attribute laneChangeMode that can be set in XML, setting laneChangeMode only works with TraCI.
- there are no parameters for lcStrategic, lcCooperative etc. Instead these attributes must be set in the vType of a vehicle: `<vType id="lockType" lcStrategic="-1" .../>, then use that type for the locked vehicles.

For a complete list of laneChangeModel attributes see https://sumo.dlr.de/docs/Definition_of_Vehicles%2C_Vehicle_Types%2C_and_Routes.html#lane-changing_models
For a complete list of things that can bet set in a <param> to affect behavior, see https://sumo.dlr.de/docs/Simulation/GenericParameters.html#special_parameters_that_affect_behavior

Am Sa., 18. Okt. 2025 um 08:01 Uhr schrieb Muhammad Arsalan Jalees Abro via sumo-user <sumo-user@xxxxxxxxxxx>:
Hi,
I am new to SUMO and I have tried fixing the route script but no matter what I do, the object vehicles change lanes. I am trying to run different scenarios where the ego vehicle either brakes and switches lanes or just directly switches lanes. But when the ego vehicle approaches, the object vehicle switches lane and I want the object vehicles to strictly follow the lane which they are assigned to. Here is my route script. Please help. Need to get down with my research.
I have added notes in the script to help understand what am doing.



<routes>

      <!-- Ego Vehicle (dynamic, can overtake) -->
    <vType id="egoType"
           accel="2.5" decel="4.5" sigma="0.3"
           length="4.5" maxSpeed="16.7" color="1,0,0"
           carFollowModel="Krauss" tau="1.4">
        <param key="lcStrategic" value="0.6"/>
        <param key="lcCooperative" value="0.4"/>
        <param key="lcSpeedGain" value="0.3"/>
        <param key="lcKeepRight" value="0.2"/>
        <param key="lcOvertakeRight" value="0"/>
    </vType>

    <!-- Default Object Vehicle (mildly active) -->
    <vType id="objType"
           accel="1.0" decel="3.0" sigma="0.5"
           length="4.5" maxSpeed="7.0" color="0,0,1"
           carFollowModel="Krauss" tau="1.2">
        <!-- Basic type for moving vehicles that may adapt but stay in lane -->
    </vType>

    <!-- Locked Object Vehicle (strictly no lane change) -->
    <vType id="objLockedType"
           accel="1.0" decel="3.0" sigma="0.5"
           length="4.5" maxSpeed="7.0" color="0,0,1"
           carFollowModel="Krauss" tau="1.2"
           laneChangeModel="LC2013"
           laneChangeMode="0"
           maxSpeedLat="0.0001"
           keepRight="0"
           latAlignment="center">
        <!-- Disable all forms of lateral logic -->
        <param key="lcStrategic" value="0"/>
        <param key="lcCooperative" value="0"/>
        <param key="lcSpeedGain" value="0"/>
        <param key="lcKeepRight" value="0"/>
        <param key="lcOvertakeRight" value="0"/>
    </vType>

    <route id="r0" edges="edge0"/>
    <!-- Slow Vehicle Ahead (same lane as ego) -->
    <vehicle id="obj1" type="objType" route="r0"
             depart="0" departLane="0" departPos="35"
             departSpeed="7.0">
        <!-- Reinforce lane lock for this one too -->
        <param key="laneChangeMode" value="0"/>
        <param key="maxSpeedLat" value="0.0001"/>
    </vehicle>

    <!-- Obstacle in Adjacent Lane (fully locked in lane 1) -->
    <vehicle id="obj2" type="objLockedType" route="r0"
             depart="0" departLane="1" departPos="100"
             departSpeed="7.0">
        <!-- Double reinforcement -->
        <param key="laneChangeMode" value="0"/>
        <param key="maxSpeedLat" value="0.0001"/>
        <param key="keepRight" value="0"/>
        <param key="latAlignment" value="center"/>
    </vehicle>

    <!-- Ego Vehicle (can decide overtaking strategy) -->
    <vehicle id="ego" type="egoType" route="r0"
             depart="2" departLane="0" departPos="0"
             departSpeed="10.0">
        <!-- Allow strategic and cooperative lane changes -->
        <param key="laneChangeMode" value="1621"/>
    </vehicle>

</routes>
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top