Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
API
Commits
1416a25f
Commit
1416a25f
authored
Jun 27, 2017
by
Tobias Meuser
Browse files
Added additional information to RoadNetworkEdge
parent
77622917
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tudarmstadt/maki/simonstrator/api/component/vehicular/roadnetwork/RoadNetworkEdge.java
View file @
1416a25f
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment