Commit b52aae20 authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Added support for negative coordinates

parent 22105902
......@@ -228,8 +228,8 @@ public class VehicleMovementModel implements MovementModel, EventHandler, Future
if (sumoExe != null) {
TraciSimulationController simulationController = TraciSimulationController.createSimulationController(sumoExe, sumoConfigFile);
_controller = simulationController;
_controller.init();
_controller.setObservedArea(offsetX, offsetY, offsetX + width, offsetY + height);
_controller.init();
_controller.nextStep();
extractor = simulationController;
......
......@@ -335,7 +335,7 @@ public class TraciSimulationController implements VehicleController, SimulationS
try {
SumoBoundingBox netBoundary = (SumoBoundingBox) _connection.do_job_get(netBoundaryCommand);
return netBoundary.x_max + netBoundary.x_min;
return Math.max(netBoundary.x_max - netBoundary.x_min, 10);
} catch (Exception e) {
//Nothing to do
}
......@@ -348,9 +348,7 @@ public class TraciSimulationController implements VehicleController, SimulationS
try {
SumoBoundingBox netBoundary = (SumoBoundingBox) _connection.do_job_get(netBoundaryCommand);
System.out.println(netBoundary.y_max);
System.out.println(netBoundary.y_min);
return netBoundary.y_max + netBoundary.y_min;
return Math.max(netBoundary.y_max - netBoundary.y_min, 10);
} catch (Exception e) {
//Nothing to do
}
......
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