Commit 5050d83a authored by DaiJiabin's avatar DaiJiabin
Browse files

done

parent 086dd605
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -4,6 +4,6 @@
-->
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
<flow id="f_0" begin="0.00" departSpeed="max" color="255,32,0" from="-gneE1" to="-gneE0" end="120.00" probability="0.30"/>
<flow id="f_1" begin="0.00" departSpeed="max" color="0,60,255" from="-gneE2" to="-gneE0" end="120.00" probability="0.30"/>
<flow id="f_0" begin="0.00" departSpeed="0.00" color="255,32,0" from="-gneE1" to="-gneE0" end="120.00" probability="0.50"/>
<flow id="f_1" begin="0.00" departSpeed="0.00" color="0,60,255" from="-gneE2" to="-gneE0" end="120.00" probability="0.50"/>
</routes>
......@@ -198,17 +198,6 @@ void InteractingVehicle::handleMessage(cMessage *msg)
else{
updateDistance(vehicleRecordLowPriority, otherVehicleId, hisDistance, hisTime);
}
// Algorithms for part II
// =========================
// visualization_TimeDiff(myTime, hisTime, threshold);
// visualization_GivenTime(myTime, givenTime);
// =========================
// Algorithms for part III
// =========================
// If I need to perform the speed control, i.e., I'm the closest one to the intersection
double closestDistanceOtherSide = 0;
double closestTime = 0;
int mapSize = 0;
......@@ -231,13 +220,17 @@ void InteractingVehicle::handleMessage(cMessage *msg)
mapSize = vehicleRecordHighPriority.size();
}
if(tanValue == 0){
if(mapSize != 1){
if(mapSize > 1){
// getParentModule()->bubble(std::to_string(mapSize).c_str());
visualization_Brake(mobility, iMsg, myTime, closestTime, threshold, stopped);
}
else{
// getParentModule()->bubble(std::to_string(mapSize).c_str());
traciVehicle->setSpeed(storedSpeed);
if(stopped)
{
// getParentModule()->bubble(":)");
traciVehicle->setSpeed(storedSpeed);
stopped = false;
}
}
}
return;
......
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment