Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Units of lcStrategic, lcLookaheadLeft, lcAssertive, lcSpeedGain

Thank you. 
Could you provide a little context of what this code, specifically those lines are doing?

If I change lcStrategic from 1000 to 500, or 1500- what are some effects that I can expect?
I have attached a set of files that I am using for your reference, I only change lcStrategic values in it and compare the results. 


On Mon, Jun 5, 2023 at 10:54 AM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:

Am Mo., 5. Juni 2023 um 16:24 Uhr schrieb Soumya Sharma via sumo-user <sumo-user@xxxxxxxxxxx>:
Hi Jakob,
Thanks for the information, that is very helpful.

Also, in one of your previous emails, you mentioned:
"The default look-ahead distance for strategic decision has a maximum range of about 3000m. You can reduce this distance by setting vType attribute 'lcStrategic' to a value in [0, 1[. "

Where does this 3000m distance come from? is it the same as laDist? and where can I find these default values and the code corresponding to defaults? 
My goal is to understand how the look-ahead distance of a vehicle changes with changing parameters like "lcStrategic" and "lcLookaheadLeft", "lcAssertive" and "lcSpeedGain". 

Thanks!

On Mon, Jun 5, 2023 at 7:57 AM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
- All these attributes are factors and thus unitless
- in the laDist computation, the value of LOOK_FORWARD is the time (10s) which is then scaled


Am So., 4. Juni 2023 um 04:24 Uhr schrieb Soumya Sharma via sumo-user <sumo-user@xxxxxxxxxxx>:
Hello,
I am trying to conduct a sensitivity analysis of car-following and lane-changing parameters in SUMO for hypothetical freeway segments (basic and weaving). I tried changing headway values (car-following) and lcStrategic values (lane-changing) for a basic segment. I used lcStrategic values of 500, 1000, and 1500 for trucks in simulations (length = 15.25m). My trucks are using the CACC model. 
The two metrics I am interested in are the travel rates (secs/ mi) by vehicle type and the number of lane changes per vehicle type. I found that there was no change in travel rate and a number of lane changes when I changed the value of lcStrategic to 500, 1000, and 1500. I don't understand why there was no effect of changing the parameter values.  
Next, I want to look into other parameters like "lcLookaheadLeft", "lcAssertive" and "lcSpeedGain". 

Question: I would like to understand the units of the parameters "lcStrategic" and "lcLookaheadLeft", "lcAssertive" and "lcSpeedGain". 

The SUMO documentation says:
  1. lcStrategic: The eagerness for performing strategic lane changing. Higher values result in earlier lane-changing. default: 1.0, range [0-inf), -1 A value of 0 sets the lookahead-distance to 0 (vehicles can still change at the end of their lane) whereas -1 disables strategic changing completely.
  2. lcLookaheadLeft: Factor for configuring the strategic lookahead distance when a change to the left is necessary (relative to right lookahead). default: 2.0, range [0-inf)
  3. lcAssertive: Willingness to accept lower front and rear gaps on the target lane. The required gap is divided by this value. default: 1, range: positive reals
  4. lcSpeedGain: The eagerness for performing lane changing to gain speed. Higher values result in more lane-changing. default: 1.0, range [0-inf)
These definitions don't mention any units explicitly, are they all factors? i.e. unitless or are some of them in meters and some unitless? 

I was checking the code for LC2013 and found that look ahead distance (laDist) is being calculated as follows:

laDist = myLookAheadSpeed * LOOK_FORWARD * myStrategicParam * (right ? 1 : myLookaheadLeft);


If this is how the look-ahead distance for a vehicle is calculated when making lane-changing decisions, then both lcLookaheadLeft and lcStrategic specified will be used to calculate laDist but I don't know what what the units of any of these parameters are. For laDist to be in distance units, speed would be multiplied by time here. 


Please share any information that is available as it would help me understand my results better. 

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


--
Thank you,
Soumya Sharma

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


--
Thank you,
Soumya Sharma

import os
import sys
import optparse
import numpy as np

# we need to import some python modules from the $SUMO_HOME/tools directory
if 'SUMO_HOME' in os.environ:
    tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
    sys.path.append(tools)
else:
    sys.exit("please declare environment variable 'SUMO_HOME'")


from sumolib import checkBinary  # Checks for the binary in environ vars
import traci


def get_options():
    opt_parser = optparse.OptionParser()
    opt_parser.add_option("--nogui", action="store_true",
                         default=False, help="run the commandline version of sumo")
    options, args = opt_parser.parse_args()
    return options

t = np.arange(5,10000, 10)
vehID = np.arange(5,10000, 10)

# contains TraCI control loop
def run():
    step = 0
    while traci.simulation.getMinExpectedNumber() > 0:
        traci.simulationStep()
    #    print(step)
    #while step < 10000:
     #   traci.simulationStep() # advance the simulation one time step
     #   for i,j in zip(t, vehID):
        #    for j in vehID:
      #      if step == i:
       #         traci.vehicle.add(str(j), 'r1', typeID='TV',  departLane='random', departSpeed='max')
        #        #traci.vehicle.add(str(j), 'r1', typeID='TV', depart=None, departLane='free', departPos='base')

        step += 1

    traci.close()
    sys.stdout.flush()


# main entry point
if __name__ == "__main__":
    options = get_options()

    # check binary
    if options.nogui:
        sumoBinary = checkBinary('sumo')
    else:
        sumoBinary = checkBinary('sumo-gui')

    # traci starts sumo as a subprocess and then this script connects and runs
    traci.start([sumoBinary, "-c", "config3.sumocfg",
                             "--tripinfo-output", "20TAV_0TT_80TV.xml"])
    run()
<routes>
<vType id="TAV"													
           vClass="custom1" length="15.25" color = "white" guiShape="truck"													
		   carFollowModel="CACC" tau="1.05" minGap="2.5" speedDev="0" lcStrategic = "100" lcLookaheadLeft="1000" lcAssertive="2" />											
													
	<vType id="TT"												
           vClass="truck" length="15.25" color = "yellow"													
		   carFollowModel="W99" CC1="1.8"  CC2="2.4"  CC7="0.25" CC8="1.97" CC9="0.82" speedDev="0.05" lcStrategic = "10" lcLookaheadLeft="1000" lcAssertive="2" />											
													
	<vType id="TV"												
           vClass="passenger" length="5" color = "red"													
		   carFollowModel="W99" CC1="1" CC2="2" speedDev="0.05" speedFactor="normc(1,0.082,0.714,1.214)"											
			lcStrategic = "10" lcLookaheadLeft="1000" lcAssertive="2"/>		


<!--2000pcphpl -->
<flow id="TVflowa1" type="TV" begin="0" end="3600" probability="0.444444444444444" from="e1" to="e3" departSpeed="desired" departPos="base" departLane="0"/>
<flow id="TVflowb1" type="TV" begin="0" end="3600" probability="0.444444444444444" from="e1" to="e3" departSpeed="desired" departPos="base" departLane="1"/>
<flow id="TVflowc1" type="TV" begin="0" end="3600" probability="0.444444444444444" from="e1" to="e3" departSpeed="desired" departPos="base" departLane="2"/>

<flow id="TAVflowa1" type="TAV" begin="0" end="3600" probability="0.111111111111111" from="e1" to="e3" departSpeed="desired" departPos="base" departLane="0"/>
<flow id="TAVflowb1" type="TAV" begin="0" end="3600" probability="0.111111111111111" from="e1" to="e3" departSpeed="desired" departPos="base" departLane="1"/>
<flow id="TAVflowc1" type="TAV" begin="0" end="3600" probability="0.111111111111111" from="e1" to="e3" departSpeed="desired" departPos="base" departLane="2"/>

</routes>
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2021-06-21 10:51:29 by Eclipse SUMO netedit Version v1_9_2+0606-e37d7284ee
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd";>

    <input>
        <sumo-net-file value="G:\Shared%20drives\NCDOT_AV_Project\Task%204-%20Freight-Related%20Impact\SUMO%20Analysis\Basic\Middle%20Lane%20Reservation\Lane%20reservation%20for%20TTs\10%25%20Trucks\test_5TAV_5TT_90TV_nolanersrv_instantloopadded\3lanebasicrsrv(1mile).net.xml"/>
    </input>

    <output>
        <output-file value="G:\Shared%20drives\NCDOT_AV_Project\Task%204-%20Freight-Related%20Impact\SUMO%20Analysis\Basic\Middle%20Lane%20Reservation\Lane%20reservation%20for%20TTs\10%25%20Trucks\test_5TAV_5TT_90TV_nolanersrv_instantloopadded\3lanebasicrsrv(1mile).net.xml"/>
    </output>

    <processing>
        <geometry.min-radius.fix.railways value="false"/>
        <geometry.max-grade.fix value="false"/>
        <offset.disable-normalization value="true"/>
        <lefthand value="false"/>
    </processing>

    <junctions>
        <no-turnarounds value="true"/>
        <junctions.corner-detail value="5"/>
        <junctions.limit-turn-speed value="5.5"/>
        <rectangular-lane-cut value="false"/>
    </junctions>

    <pedestrian>
        <walkingareas value="false"/>
    </pedestrian>

    <netedit>
        <additional-files value="G:\Shared%20drives\NCDOT_AV_Project\Task%204-%20Freight-Related%20Impact\SUMO%20Analysis\Basic\Middle%20Lane%20Reservation\Lane%20reservation%20for%20TTs\10%25%20Trucks\test_5TAV_5TT_90TV_nolanersrv_instantloopadded\instantloop_lane2.xml"/>
    </netedit>

    <report>
        <aggregate-warnings value="5"/>
    </report>

</configuration>
-->

<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/additional_file.xsd";>
    <instantInductionLoop id="enter_e2_lane0" lane="e2_0" pos="30.48" name="enter_e2_lane0" file="20TAV_0TT_80TVLoop_enter_e2_lane0.xml"/>
    <instantInductionLoop id="enter_e2_lane1" lane="e2_1" pos="30.48" name="enter_e2_lane1" file="20TAV_0TT_80TVLoop_enter_e2_lane1.xml"/>
    <instantInductionLoop id="enter_e2_lane2" lane="e2_2" pos="30.48" name="enter_e2_lane2" file="20TAV_0TT_80TVLoop_enter_e2_lane2.xml"/>
    <instantInductionLoop id="exit_e2_lane0" lane="e2_0" pos="4858.51" name="exit_e2_lane0" file="20TAV_0TT_80TVLoop_exit_e2_lane0.xml"/>
    <instantInductionLoop id="exit_e2_lane1" lane="e2_1" pos="4858.51" name="exit_e2_lane1" file="20TAV_0TT_80TVLoop_exit_e2_lane1.xml"/>
    <instantInductionLoop id="exit_e2_lane2" lane="e2_2" pos="4858.51" name="exit_e2_lane2" file="20TAV_0TT_80TVLoop_exit_e2_lane2.xml"/>
</additional>

Attachment: config3.sumocfg
Description: application/sumo

<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2021-06-21 10:17:51 by Eclipse SUMO netedit Version v1_9_2+0606-e37d7284ee
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd";>

    <input>
        <sumo-net-file value="G:\Shared%20drives\NCDOT_AV_Project\Task%204-%20Freight-Related%20Impact\SUMO%20Analysis\Basic\Middle%20Lane%20Reservation\Lane%20reservation%20for%20TTs\10%25%20Trucks\test_5TAV_5TT_90TV_nolanersrv_instantloopadded\3lanebasicrsrv(1mile).net.xml"/>
    </input>

    <output>
        <output-file value="G:\Shared%20drives\NCDOT_AV_Project\Task%204-%20Freight-Related%20Impact\SUMO%20Analysis\Basic\Middle%20Lane%20Reservation\Lane%20reservation%20for%20TTs\10%25%20Trucks\test_5TAV_5TT_90TV_nolanersrv_instantloopadded\3lanebasicrsrv(1mile).net.xml"/>
    </output>

    <processing>
        <geometry.min-radius.fix.railways value="false"/>
        <geometry.max-grade.fix value="false"/>
        <offset.disable-normalization value="true"/>
        <lefthand value="false"/>
    </processing>

    <junctions>
        <no-turnarounds value="true"/>
        <junctions.corner-detail value="5"/>
        <junctions.limit-turn-speed value="5.5"/>
        <rectangular-lane-cut value="false"/>
    </junctions>

    <pedestrian>
        <walkingareas value="false"/>
    </pedestrian>

    <report>
        <aggregate-warnings value="5"/>
    </report>

</configuration>
-->

<net version="1.9" junctionCornerDetail="5" limitTurnSpeed="5.50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd";>

    <location netOffset="0.00,0.00" convBoundary="-1815.66,49.85,3439.00,61.78" origBoundary="-10000000000.00,-10000000000.00,10000000000.00,10000000000.00" projParameter="!"/>

    <edge id=":gneJ1_0" function="internal">
        <lane id=":gneJ1_0_0" index="0" speed="31.29" length="0.30" width="3.66" shape="-824.64,52.63 -824.35,52.63"/>
        <lane id=":gneJ1_0_1" index="1" speed="31.29" length="0.30" width="3.66" shape="-824.64,56.29 -824.34,56.29"/>
        <lane id=":gneJ1_0_2" index="2" speed="31.29" length="0.30" width="3.66" shape="-824.65,59.95 -824.34,59.95"/>
    </edge>
    <edge id=":gneJ5_0" function="internal">
        <lane id=":gneJ5_0_0" index="0" speed="31.29" length="0.30" width="3.66" shape="1628.20,47.92 1628.49,47.92"/>
        <lane id=":gneJ5_0_1" index="1" speed="31.29" length="0.30" width="3.66" shape="1628.20,51.58 1628.50,51.58"/>
        <lane id=":gneJ5_0_2" index="2" speed="31.29" length="0.30" width="3.66" shape="1628.21,55.24 1628.52,55.24"/>
    </edge>

    <edge id="e1" from="gneJ0" to="gneJ1" priority="-1" length="1609.34">
        <lane id="e1_0" index="0" speed="31.29" length="1609.34" width="3.66" shape="-1815.66,52.47 -824.64,52.63"/>
        <lane id="e1_1" index="1" speed="31.29" length="1609.34" width="3.66" shape="-1815.66,56.13 -824.64,56.29"/>
        <lane id="e1_2" index="2" speed="31.29" length="1609.34" width="3.66" shape="-1815.66,59.79 -824.65,59.95"/>
    </edge>
    <edge id="e2" from="gneJ1" to="gneJ5" priority="-1" length="4888.99">
        <lane id="e2_0" index="0" speed="31.29" length="4888.99" width="3.66" shape="-824.35,52.63 1628.20,47.92"/>
        <lane id="e2_1" index="1" speed="31.29" length="4888.99" width="3.66" shape="-824.34,56.29 1628.20,51.58"/>
        <lane id="e2_2" index="2" speed="31.29" length="4888.99" width="3.66" shape="-824.34,59.95 1628.21,55.24"/>
    </edge>
    <edge id="e3" from="gneJ5" to="gneJ4" priority="-1" length="3218.69">
        <lane id="e3_0" index="0" speed="31.29" length="3218.69" width="3.66" shape="1628.49,47.92 3438.96,40.70"/>
        <lane id="e3_1" index="1" speed="31.29" length="3218.69" width="3.66" shape="1628.50,51.58 3438.98,44.36"/>
        <lane id="e3_2" index="2" speed="31.29" length="3218.69" width="3.66" shape="1628.52,55.24 3438.99,48.02"/>
    </edge>

    <junction id="gneJ0" type="dead_end" x="-1815.66" y="61.62" incLanes="" intLanes="" shape="-1815.66,61.62 -1815.66,50.64"/>
    <junction id="gneJ1" type="priority" x="-824.49" y="61.78" incLanes="e1_0 e1_1 e1_2" intLanes=":gneJ1_0_0 :gneJ1_0_1 :gneJ1_0_2" shape="-824.33,61.78 -824.36,50.80 -824.64,50.80 -824.65,61.78">
        <request index="0" response="000" foes="000" cont="0"/>
        <request index="1" response="000" foes="000" cont="0"/>
        <request index="2" response="000" foes="000" cont="0"/>
    </junction>
    <junction id="gneJ4" type="dead_end" x="3439.00" y="49.85" incLanes="e3_0 e3_1 e3_2" intLanes="" shape="3438.96,38.87 3439.00,49.85"/>
    <junction id="gneJ5" type="priority" x="1628.37" y="57.07" incLanes="e2_0 e2_1 e2_2" intLanes=":gneJ5_0_0 :gneJ5_0_1 :gneJ5_0_2" shape="1628.53,57.07 1628.48,46.09 1628.19,46.09 1628.21,57.07">
        <request index="0" response="000" foes="000" cont="0"/>
        <request index="1" response="000" foes="000" cont="0"/>
        <request index="2" response="000" foes="000" cont="0"/>
    </junction>

    <connection from="e1" to="e2" fromLane="0" toLane="0" via=":gneJ1_0_0" dir="s" state="M"/>
    <connection from="e1" to="e2" fromLane="1" toLane="1" via=":gneJ1_0_1" dir="s" state="M"/>
    <connection from="e1" to="e2" fromLane="2" toLane="2" via=":gneJ1_0_2" dir="s" state="M"/>
    <connection from="e2" to="e3" fromLane="0" toLane="0" via=":gneJ5_0_0" dir="s" state="M"/>
    <connection from="e2" to="e3" fromLane="1" toLane="1" via=":gneJ5_0_1" dir="s" state="M"/>
    <connection from="e2" to="e3" fromLane="2" toLane="2" via=":gneJ5_0_2" dir="s" state="M"/>

    <connection from=":gneJ1_0" to="e2" fromLane="0" toLane="0" dir="s" state="M"/>
    <connection from=":gneJ1_0" to="e2" fromLane="1" toLane="1" dir="s" state="M"/>
    <connection from=":gneJ1_0" to="e2" fromLane="2" toLane="2" dir="s" state="M"/>
    <connection from=":gneJ5_0" to="e3" fromLane="0" toLane="0" dir="s" state="M"/>
    <connection from=":gneJ5_0" to="e3" fromLane="1" toLane="1" dir="s" state="M"/>
    <connection from=":gneJ5_0" to="e3" fromLane="2" toLane="2" dir="s" state="M"/>

</net>

Back to the top