Skip to content

Commit

Permalink
improving test #21 fix #14760
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed May 2, 2024
1 parent 0c71c7a commit b1c634e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/complex/traci/bugs/ticket5114/output.complex
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ getDistanceRoad (1st internal to normal): 68.86999999999999
getDistanceRoad (1st internal to 2nd internal): 7.85
getDistanceRoad (2nd internal to normal): 61.019999999999996
getDistanceRoad (2nd internal to 1st internal): -1073741824.0
getDrivingDistance (no connection): -1073741824.0
getDrivingDistance (normal to normal): 155.57
getDrivingDistance (normal to 1st internal): 86.7
getDrivingDistance (normal to 2nd internal): 94.55
getDrivingDistance (1st internal to normal): 73.56988108640536
getDrivingDistance (1st internal to 2nd internal): 12.54988108640537
getDrivingDistance (2nd internal to normal): 65.48834801516962
getDrivingDistance (2nd internal to 1st internal): -1073741824.0
26 changes: 26 additions & 0 deletions tests/complex/traci/bugs/ticket5114/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,30 @@
print("getDistanceRoad (2nd internal to 1st internal):",
traci.simulation.getDistanceRoad(":gneJ5_7", 5, ":gneJ5_4", 5, isDriving=True))

traci.route.add("r", ["gneE4", "-gneE2"])
traci.vehicletype.setMaxSpeed("DEFAULT_VEHTYPE", 1)
traci.vehicle.add("v", "r")
traci.simulationStep()

print("getDrivingDistance (no connection):",
traci.vehicle.getDrivingDistance("v", "gneE1", 100))
print("getDrivingDistance (normal to normal):",
traci.vehicle.getDrivingDistance("v", "-gneE2", 50))
print("getDrivingDistance (normal to 1st internal):",
traci.vehicle.getDrivingDistance("v", ":gneJ5_4", 5))
print("getDrivingDistance (normal to 2nd internal):",
traci.vehicle.getDrivingDistance("v", ":gneJ5_7", 5))
while traci.vehicle.getRoadID("v") != ":gneJ5_4":
traci.simulationStep()
print("getDrivingDistance (1st internal to normal):",
traci.vehicle.getDrivingDistance("v", "-gneE2", 50))
print("getDrivingDistance (1st internal to 2nd internal):",
traci.vehicle.getDrivingDistance("v", ":gneJ5_7", 5))
while traci.vehicle.getRoadID("v") != ":gneJ5_7":
traci.simulationStep()
print("getDrivingDistance (2nd internal to normal):",
traci.vehicle.getDrivingDistance("v", "-gneE2", 50))
print("getDrivingDistance (2nd internal to 1st internal):",
traci.vehicle.getDrivingDistance("v", ":gneJ5_4", 5))

traci.close()

0 comments on commit b1c634e

Please sign in to comment.