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
4b8c82a8
Commit
4b8c82a8
authored
Nov 14, 2017
by
Tobias Meuser
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
Removed mirroring
parent
e9e6423d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/VehicleMovementModel.java
View file @
4b8c82a8
...
...
@@ -280,12 +280,7 @@ public class VehicleMovementModel implements MovementModel, EventHandler {
e
.
printStackTrace
();
}
if
(
scenarioHeight
!=
-
1
)
{
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getLongitude
(),
Math
.
min
(
scenarioHeight
,
height
)
-
position
.
getLatitude
()));
}
else
{
// This would be vertically mirrored
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getLongitude
(),
position
.
getLatitude
()));
}
component
.
updateCurrentLocation
(
new
PositionVector
(
position
.
getLongitude
(),
position
.
getLatitude
()));
component
.
setMovementSpeed
(
_controller
.
getVehicleSpeed
(
vehicle
));
...
...
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
4b8c82a8
...
...
@@ -733,24 +733,41 @@ public class TraciSimulationController implements VehicleController, SimulationS
return
angle
;
}
@Override
public
List
<
Location
>
getLaneShape
(
String
pLaneID
)
{
List
<
Location
>
positions
=
new
ArrayList
<>();
SumoCommand
laneShapeCommand
=
Lane
.
getShape
(
pLaneID
);
SumoGeometry
geometry
=
(
SumoGeometry
)
requestObject
(
laneShapeCommand
);
for
(
SumoPosition2D
location
:
geometry
.
coords
)
{
if
(!
isObservedAreaSet
())
{
positions
.
add
(
new
PositionVector
(
location
.
x
,
location
.
y
));
}
else
{
if
(
_startX
<=
location
.
x
&&
location
.
x
<=
_endX
&&
_startY
<=
location
.
y
&&
location
.
y
<=
_endY
)
{
positions
.
add
(
new
PositionVector
(
location
.
x
-
_startX
,
location
.
y
-
_startY
));
}
}
}
return
positions
;
}
@Override
public
Location
getEdgeMeanPosition
(
String
pEdgeID
)
{
List
<
SumoPosi
tion
2D
>
positions
=
new
ArrayList
<>();
List
<
Loca
tion
>
positions
=
new
ArrayList
<>();
for
(
RoadNetworkLane
lane
:
_roadNetwork
.
getEdge
(
pEdgeID
).
getLanes
())
{
String
laneID
=
lane
.
getLaneID
();
SumoCommand
laneShapeCommand
=
Lane
.
getShape
(
laneID
);
SumoGeometry
geometry
=
(
SumoGeometry
)
requestObject
(
laneShapeCommand
);
positions
.
addAll
(
geometry
.
coords
);
positions
.
addAll
(
getLaneShape
(
laneID
));
}
double
x
=
0
;
double
y
=
0
;
int
count
=
0
;
for
(
SumoPosition2D
sumoP
osition
2D
:
positions
)
{
x
+=
sumoP
osition
2D
.
x
;
y
+=
sumoP
osition
2D
.
y
;
for
(
Location
p
osition
:
positions
)
{
x
+=
p
osition
.
getLongitude
()
;
y
+=
p
osition
.
getLatitude
()
;
count
++;
}
...
...
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