Commit 1416a25f authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Added additional information to RoadNetworkEdge

parent 77622917
......@@ -26,16 +26,46 @@ import java.util.List;
public class RoadNetworkEdge {
private String _edgeID;
private double _angle;
private int _laneAmount;
private double _maxSpeed = 0;
private List<RoadNetworkEdge> _accessibleEdges = new ArrayList<>();
public RoadNetworkEdge(String pEdgeID) {
public RoadNetworkEdge(String pEdgeID, double pAngle) {
_edgeID = pEdgeID;
_angle = pAngle;
_laneAmount = 0;
}
public String getEdgeID() {
return _edgeID;
}
public double getAngle() {
return _angle;
}
public double getMaxSpeed() {
return _maxSpeed;
}
public int getLaneAmount() {
return _laneAmount;
}
public void increaseLaneAmount() {
_laneAmount++;
}
public void setMaxSpeed(double pMaxSpeed) {
if (pMaxSpeed > _maxSpeed) {
_maxSpeed = pMaxSpeed;
}
}
public void addConnectedEdge(RoadNetworkEdge pEdge) {
if (!_accessibleEdges.contains(pEdge)) {
_accessibleEdges.add(pEdge);
......@@ -46,6 +76,10 @@ public class RoadNetworkEdge {
return Collections.unmodifiableList(_accessibleEdges);
}
public String getDescription() {
return "id: " + _edgeID + ", lanes: " + _laneAmount + ", speed limit: " + _maxSpeed;
}
@Override
public String toString() {
return _edgeID;
......
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