Commit 173e49b1 authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Update for diss

parent 4c2d8f4c
...@@ -540,7 +540,11 @@ public class TraciSimulationController implements VehicleController, SimulationS ...@@ -540,7 +540,11 @@ public class TraciSimulationController implements VehicleController, SimulationS
try { try {
SumoBoundingBox netBoundary = (SumoBoundingBox) _connection.do_job_get(netBoundaryCommand); SumoBoundingBox netBoundary = (SumoBoundingBox) _connection.do_job_get(netBoundaryCommand);
if (_observedAreaSet) {
return Math.max(Math.min(netBoundary.x_max, _endX) - Math.max(netBoundary.x_min, _startX), 10);
} else {
return Math.max(netBoundary.x_max - netBoundary.x_min, 10); return Math.max(netBoundary.x_max - netBoundary.x_min, 10);
}
} catch (Exception e) { } catch (Exception e) {
//Nothing to do //Nothing to do
} }
...@@ -553,7 +557,11 @@ public class TraciSimulationController implements VehicleController, SimulationS ...@@ -553,7 +557,11 @@ public class TraciSimulationController implements VehicleController, SimulationS
try { try {
SumoBoundingBox netBoundary = (SumoBoundingBox) _connection.do_job_get(netBoundaryCommand); SumoBoundingBox netBoundary = (SumoBoundingBox) _connection.do_job_get(netBoundaryCommand);
if (_observedAreaSet) {
return Math.max(Math.min(netBoundary.y_max, _endY) - Math.max(netBoundary.y_min, _startY), 10);
} else {
return Math.max(netBoundary.y_max - netBoundary.y_min, 10); return Math.max(netBoundary.y_max - netBoundary.y_min, 10);
}
} catch (Exception e) { } catch (Exception e) {
//Nothing to do //Nothing to do
} }
...@@ -814,6 +822,7 @@ public class TraciSimulationController implements VehicleController, SimulationS ...@@ -814,6 +822,7 @@ public class TraciSimulationController implements VehicleController, SimulationS
for (SumoPosition2D location : geometry.coords) { for (SumoPosition2D location : geometry.coords) {
if (!isObservedAreaSet()) { if (!isObservedAreaSet()) {
positions.add(new PositionVector(location.x, location.y)); positions.add(new PositionVector(location.x, location.y));
set = true;
} else { } else {
if (_startX <= location.x && location.x <= _endX && _startY <= location.y && location.y <= _endY) { if (_startX <= location.x && location.x <= _endX && _startY <= location.y && location.y <= _endY) {
set = true; set = true;
......
...@@ -180,6 +180,11 @@ public class GlobalOracle implements OracleComponent { ...@@ -180,6 +180,11 @@ public class GlobalOracle implements OracleComponent {
return new ArrayList<Host>(hosts); return new ArrayList<Host>(hosts);
} }
@Override
public Host getHostByID(long pValue) {
return hostIDtoHosts.get(pValue);
}
@Override @Override
public boolean isSimulation() { public boolean isSimulation() {
return true; return true;
......
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