Search code examples
omnet++veinssumo

Control lane change decision in SUMO


I am using VEINS 4.4 , OMNET 5.0 and SUMO 0.25 in my project. i want to stop vehicles from changing their lanes when they become near to the intersection .

i have searched in google but i didn't get an answer

how to do it, please ?


Solution

  • You need to implement a Traci command that control the changing lane in Veins. I came across this implementation in burtonwilliamt github rep:

    void TraCICommandInterface::Vehicle::setLaneChangeMode(int32_t bitset) {
        uint8_t variableId = VAR_LANECHANGE_MODE;
        uint8_t variableType = TYPE_INTEGER;
        TraCIBuffer buf = traci->connection.query(CMD_SET_VEHICLE_VARIABLE, TraCIBuffer() << variableId << nodeId << variableType << bitset);
        ASSERT(buf.eof());
    }
    

    I have not tested it thou.