Commit 421852b2 authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Considered edge which are partly out of the scenario

parent a34faa8d
......@@ -44,6 +44,7 @@ import de.tudresden.ws.container.SumoLink;
import de.tudresden.ws.container.SumoLinkList;
import de.tudresden.ws.container.SumoPosition2D;
import de.tudresden.ws.container.SumoStringList;
import edu.emory.mathcs.backport.java.util.Collections;
import it.polito.appeal.traci.SumoTraciConnection;
/**
......@@ -743,6 +744,8 @@ public class TraciSimulationController implements VehicleController, SimulationS
public List<Location> getLaneShape(String pLaneID) {
List<Location> positions = new ArrayList<>();
boolean set = true;
SumoCommand laneShapeCommand = Lane.getShape(pLaneID);
SumoGeometry geometry = (SumoGeometry)requestObject(laneShapeCommand);
for (SumoPosition2D location : geometry.coords) {
......@@ -751,11 +754,17 @@ public class TraciSimulationController implements VehicleController, SimulationS
} else {
if (_startX <= location.x && location.x <= _endX && _startY <= location.y && location.y <= _endY) {
positions.add(new PositionVector(location.x - _startX, location.y - _startY));
} else {
set = true;
}
}
}
return positions;
if (set) {
return positions;
} else {
return Collections.emptyList();
}
}
@Override
......
Markdown is supported
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