Commit 37e13dc8 authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Merge branch 'tm/sumo-integration' of...

Merge branch 'tm/sumo-integration' of dev.kom.e-technik.tu-darmstadt.de:simonstrator/simonstrator-peerfactsim into tm/vehicular-services
parents 2c360ca6 3a0945f2
......@@ -157,7 +157,7 @@ public class RSUMovementModel implements MovementModel, FutureLocationSensor {
if (_currentIndex < _intersections.size()) {
// Initial placement
Position intersection = _intersections.get(_currentIndex);
actuator.updateCurrentLocation(new PositionVector(intersection.getX() / VehicleMovementModel.SCALING_FACTOR, intersection.getY() / VehicleMovementModel.SCALING_FACTOR));
actuator.updateCurrentLocation(new PositionVector(intersection.getX(), intersection.getY()));
hostIntersectionMatching.put(actuator.getHost().getId(), _currentIndex);
......
......@@ -63,10 +63,6 @@ public class VehicleMovementModel implements MovementModel, EventHandler, Future
private static VehicleMovementModel MOVEMENT;
public static final double SCALING_FACTOR = 1.0;
private static final double PAINT_OFFSET = 25;
private long timeBetweenMoveOperations;
private final List<SimLocationActuator> components;
......@@ -295,7 +291,9 @@ public class VehicleMovementModel implements MovementModel, EventHandler, Future
long currentTime = Time.getCurrentTime() / timestepConversion;
while (_controller.getStep() - _controller.getStart() < currentTime) {
_controller.nextStep();
if (!_controller.nextStep()) {
return;
}
}
List<String> allVehicles = _controller.getAllVehicles();
......@@ -312,13 +310,13 @@ public class VehicleMovementModel implements MovementModel, EventHandler, Future
SimLocationActuator component = requestSimActuator(vehicle);
if (scenarioHeight != -1) {
component.updateCurrentLocation(new PositionVector(position.getX() / SCALING_FACTOR + PAINT_OFFSET, Math.min(scenarioHeight, height) - position.getY() / SCALING_FACTOR + PAINT_OFFSET));
component.updateCurrentLocation(new PositionVector(position.getX(), Math.min(scenarioHeight, height) - position.getY()));
} else {
// This would be vertically mirrored
component.updateCurrentLocation(new PositionVector(position.getX() / SCALING_FACTOR + PAINT_OFFSET, position.getY() / SCALING_FACTOR + PAINT_OFFSET));
component.updateCurrentLocation(new PositionVector(position.getX(), position.getY()));
}
component.setMovementSpeed(position.getSpeed() / SCALING_FACTOR);
component.setMovementSpeed(position.getSpeed());
try {
RoutedNetLayer routedNetLayer = component.getHost().getComponent(RoutedNetLayer.class);
......
......@@ -109,7 +109,7 @@ public class RSUPlacement implements PlacementModel {
if (_currentIndex < _intersections.size()) {
Position intersection = _intersections.get(_currentIndex);
_currentIndex++;
return new PositionVector(intersection.getX() / VehicleMovementModel.SCALING_FACTOR, intersection.getY() / VehicleMovementModel.SCALING_FACTOR);
return new PositionVector(intersection.getX(), intersection.getY());
} else {
return new PositionVector(Double.NaN, Double.NaN);
}
......
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