Skip to content

Commit

Permalink
Optimisation for enclosed receivers.
Browse files Browse the repository at this point in the history
When seeking walls for computation of receiver image, collect only walls that are in free field area
  • Loading branch information
nicolas-f committed Oct 3, 2014
1 parent 23d0da1 commit 0dd6eab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ public List<Coordinate> getWideAnglePoints(double minAngle, double maxAngle) {
* @return List of segment
*/
public LinkedList<Wall> getLimitsInRange(double maxDist,
Coordinate p1) {
Coordinate p1, boolean goThroughWalls) {
LinkedList<Wall> walls = new LinkedList<>();
int curTri = getTriangleIdByCoordinate(p1);
int nextTri = -1;
Expand Down Expand Up @@ -526,7 +526,7 @@ public LinkedList<Wall> getLimitsInRange(double maxDist,
if (wall.getBuildingId() >= 1) {
walls.add(wall);
}
if(!navigationHistory.contains(neighbors.get(sideId))) {
if((goThroughWalls || wall.getBuildingId() < 1) && !navigationHistory.contains(neighbors.get(sideId))) {
// Store currentTriangle Id. This is where to go
// back when there is no more navigable neighbors at
// the next triangle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private void feedMirroredReceiverResults(
//Counter ClockWise test. Walls vertices are CCW oriented.
//This help to test if a wall could see a point or another wall
//If the triangle formed by two point of the wall + the receiver is CCW then the wall is oriented toward the point.
boolean isCCW = false;
boolean isCCW;
if (lastResult == -1) { //If the receiverCoord is not an image
isCCW = wallPointTest(wall, receiverCoord);
} else {
Expand Down Expand Up @@ -981,10 +981,8 @@ public void computeSoundLevelAtPosition(Coordinate receiverCoord, double energet
double srcEnergeticSum = BASE_LVL; //Global energetic sum of all sources processed
List<FastObstructionTest.Wall> nearBuildingsWalls = null;
if (data.reflexionOrder > 0) {
nearBuildingsWalls = new ArrayList<>(
data.freeFieldFinder.getLimitsInRange(
data.maxSrcDist, receiverCoord)
);
nearBuildingsWalls = new ArrayList<>(data.freeFieldFinder.getLimitsInRange(
data.maxSrcDist, receiverCoord, false));
}
// Source search by multiple range query
HashSet<Integer> processedLineSources = new HashSet<Integer>(); //Already processed Raw source (line and/or points)
Expand Down

0 comments on commit 0dd6eab

Please sign in to comment.