0

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 ?

user12345
  • 55
  • 9

1 Answers1

1

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.

Hamzah
  • 120
  • 6
  • thank you for your answer, you mean that i need to add this code in my veins files because i didn't find this code in my TraCICommandInterface.cc – user12345 Jun 27 '18 at 02:55
  • Yes, you need to add it in the main veins TraCICommandInterface class – Hamzah Jun 27 '18 at 19:57