Class PathFinder
- java.lang.Object
-
- org.noise_planet.noisemodelling.pathfinder.PathFinder
-
public class PathFinder extends Object
- Author:
- Nicolas Fortin, Pierre Aumond, Sylvain Palominos
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PathFinder.ComputationSide
static class
PathFinder.ReceiverPointInfo
Attribute of the receiver pointstatic class
PathFinder.SourcePointInfo
Attributes of the source point
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Logger
LOGGER
org.h2gis.api.ProgressVisitor
progressVisitor
Progression information
-
Constructor Summary
Constructors Constructor Description PathFinder(Scene data)
Create new instance from the propagation data.PathFinder(Scene data, org.h2gis.api.ProgressVisitor progressVisitor)
Create new instance from the propagation data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeRaysAtPosition(PathFinder.ReceiverPointInfo receiverPointInfo, CutPlaneVisitor dataOut, org.h2gis.api.ProgressVisitor visitor)
Compute the rays to the given receiver.CutPlaneVisitor.PathSearchStrategy
computeReflexion(PathFinder.ReceiverPointInfo rcv, PathFinder.SourcePointInfo src, MirrorReceiversCompute receiverMirrorIndex, CutPlaneVisitor dataOut, CutPlaneVisitor.PathSearchStrategy initialStrategy)
List<org.locationtech.jts.geom.Coordinate>
computeSideHull(boolean left, org.locationtech.jts.geom.Coordinate p1, org.locationtech.jts.geom.Coordinate p2, ProfileBuilder profileBuilder)
Compute Side Hull Create a line between p1 and p2.CutProfile
computeVEdgeDiffraction(PathFinder.ReceiverPointInfo rcv, PathFinder.SourcePointInfo src, Scene data, PathFinder.ComputationSide side)
Compute horizontal diffraction (diffraction of vertical edge.)static org.apache.commons.math3.geometry.euclidean.threed.Plane
computeZeroRadPlane(org.locationtech.jts.geom.Coordinate p0, org.locationtech.jts.geom.Coordinate p1)
static org.apache.commons.math3.geometry.euclidean.threed.Vector3D
coordinateToVector(org.locationtech.jts.geom.Coordinate p)
static List<org.locationtech.jts.geom.Coordinate>
cutRoofPointsWithPlane(org.apache.commons.math3.geometry.euclidean.threed.Plane plane, List<org.locationtech.jts.geom.Coordinate> roofPts)
CutPlaneVisitor.PathSearchStrategy
directPath(PathFinder.SourcePointInfo src, PathFinder.ReceiverPointInfo rcv, boolean verticalDiffraction, boolean horizontalDiffraction, CutPlaneVisitor dataOut)
Direct Path computation.static List<org.locationtech.jts.geom.Coordinate>
filterPointsBySide(org.locationtech.jts.geom.LineSegment sr, boolean left, List<org.locationtech.jts.geom.Coordinate> segmentsCoordinates)
Remove points that are left or right of the provided segmentScene
getData()
ProfilerThread
getProfilerThread()
Computation stacks and timing are collected by this class in order to profile the execution of the simulationvoid
makeReceiverRelativeZToAbsolute()
Update ground Z coordinates of receivers absolute to sea levelsvoid
makeRelativeZToAbsolute()
Update ground Z coordinates of sound sources and receivers absolute to sea levelsvoid
makeSourceRelativeZToAbsolute()
Update ground Z coordinates of sound sources absolute to sea levelsvoid
run(CutPlaneVisitorFactory computeRaysOut)
Run computation and store the results in the given output.void
setProfilerThread(ProfilerThread profilerThread)
Computation stacks and timing are collected by this class in order to profile the execution of the simulationvoid
setThreadCount(int threadCount)
Sets the number of thread to use.static double
splitLineStringIntoPoints(org.locationtech.jts.geom.LineString geom, double segmentSizeConstraint, List<org.locationtech.jts.geom.Coordinate> pts)
-
-
-
Constructor Detail
-
PathFinder
public PathFinder(Scene data, org.h2gis.api.ProgressVisitor progressVisitor)
Create new instance from the propagation data.- Parameters:
data
- Propagation data used for ray computation.
-
PathFinder
public PathFinder(Scene data)
Create new instance from the propagation data.- Parameters:
data
- Propagation data used for ray computation.
-
-
Method Detail
-
getData
public Scene getData()
-
getProfilerThread
public ProfilerThread getProfilerThread()
Computation stacks and timing are collected by this class in order to profile the execution of the simulation- Returns:
- Instance of ProfilerThread or null
-
setProfilerThread
public void setProfilerThread(ProfilerThread profilerThread)
Computation stacks and timing are collected by this class in order to profile the execution of the simulation- Parameters:
profilerThread
- Instance of ProfilerThread
-
setThreadCount
public void setThreadCount(int threadCount)
Sets the number of thread to use.- Parameters:
threadCount
- Number of thread.
-
run
public void run(CutPlaneVisitorFactory computeRaysOut)
Run computation and store the results in the given output.- Parameters:
computeRaysOut
- Result output.
-
computeRaysAtPosition
public void computeRaysAtPosition(PathFinder.ReceiverPointInfo receiverPointInfo, CutPlaneVisitor dataOut, org.h2gis.api.ProgressVisitor visitor)
Compute the rays to the given receiver.- Parameters:
receiverPointInfo
- Receiver point.dataOut
- Computation output.visitor
- Progress visitor used for cancellation and progression managing.
-
directPath
public CutPlaneVisitor.PathSearchStrategy directPath(PathFinder.SourcePointInfo src, PathFinder.ReceiverPointInfo rcv, boolean verticalDiffraction, boolean horizontalDiffraction, CutPlaneVisitor dataOut)
Direct Path computation.- Parameters:
src
- Source point coordinate.rcv
- Receiver point coordinate.verticalDiffraction
- Enable vertical diffractionhorizontalDiffraction
- Enable horizontal diffraction- Returns:
- Calculated propagation paths.
-
computeVEdgeDiffraction
public CutProfile computeVEdgeDiffraction(PathFinder.ReceiverPointInfo rcv, PathFinder.SourcePointInfo src, Scene data, PathFinder.ComputationSide side)
Compute horizontal diffraction (diffraction of vertical edge.)- Parameters:
rcv
- Receiver coordinates.src
- Source coordinates.data
- Propagation data.side
- Side to compute. From Source to receiver coordinates- Returns:
- The propagation path of the horizontal diffraction.
-
computeSideHull
public List<org.locationtech.jts.geom.Coordinate> computeSideHull(boolean left, org.locationtech.jts.geom.Coordinate p1, org.locationtech.jts.geom.Coordinate p2, ProfileBuilder profileBuilder)
Compute Side Hull Create a line between p1 and p2. Find the first intersection of this line with a building then create a ConvexHull with the points of buildings in intersection. While there is an intersection add more points to the convex hull. The side diffraction path is found when there is no more intersection.- Parameters:
left
- If true return the path on the left side between p1 and p2; else on the right sidep1
- First pointp2
- Second point- Returns:
-
computeZeroRadPlane
public static org.apache.commons.math3.geometry.euclidean.threed.Plane computeZeroRadPlane(org.locationtech.jts.geom.Coordinate p0, org.locationtech.jts.geom.Coordinate p1)
- Parameters:
p0
-p1
-- Returns:
-
filterPointsBySide
public static List<org.locationtech.jts.geom.Coordinate> filterPointsBySide(org.locationtech.jts.geom.LineSegment sr, boolean left, List<org.locationtech.jts.geom.Coordinate> segmentsCoordinates)
Remove points that are left or right of the provided segment- Parameters:
sr
- Source receiver segmentleft
- Side to keepsegmentsCoordinates
- Roof points- Returns:
- Only points of the requested side
-
cutRoofPointsWithPlane
public static List<org.locationtech.jts.geom.Coordinate> cutRoofPointsWithPlane(org.apache.commons.math3.geometry.euclidean.threed.Plane plane, List<org.locationtech.jts.geom.Coordinate> roofPts)
- Parameters:
plane
- 3D plane with position and normal vectorroofPts
- Top altitude coordinates that create segments of verticals walls, these walls will be cut by the plane.- Returns:
- Remaining segments coordinates after the plane cutting
-
coordinateToVector
public static org.apache.commons.math3.geometry.euclidean.threed.Vector3D coordinateToVector(org.locationtech.jts.geom.Coordinate p)
- Parameters:
p
- coordinate- Returns:
- the three dimensions vector of p
-
computeReflexion
public CutPlaneVisitor.PathSearchStrategy computeReflexion(PathFinder.ReceiverPointInfo rcv, PathFinder.SourcePointInfo src, MirrorReceiversCompute receiverMirrorIndex, CutPlaneVisitor dataOut, CutPlaneVisitor.PathSearchStrategy initialStrategy)
- Parameters:
rcv
- Receiver datasrc
- Source datareceiverMirrorIndex
- Reflection informationdataOut
- Where to push cut profile- Returns:
- Skip or continue looking for vertical cut
-
splitLineStringIntoPoints
public static double splitLineStringIntoPoints(org.locationtech.jts.geom.LineString geom, double segmentSizeConstraint, List<org.locationtech.jts.geom.Coordinate> pts)
- Parameters:
geom
- GeometrysegmentSizeConstraint
- Maximal distance between pointspts
- computed points- Returns:
- Fixed distance between points
-
makeSourceRelativeZToAbsolute
public void makeSourceRelativeZToAbsolute()
Update ground Z coordinates of sound sources absolute to sea levels
-
makeRelativeZToAbsolute
public void makeRelativeZToAbsolute()
Update ground Z coordinates of sound sources and receivers absolute to sea levels
-
makeReceiverRelativeZToAbsolute
public void makeReceiverRelativeZToAbsolute()
Update ground Z coordinates of receivers absolute to sea levels
-
-