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
PeerfactSim.KOM
Commits
421852b2
Commit
421852b2
authored
Mar 14, 2018
by
Tobias Meuser
Browse files
Considered edge which are partly out of the scenario
parent
a34faa8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
421852b2
...
...
@@ -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
...
...
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