Class PathFinder

java.lang.Object
org.noise_planet.noisemodelling.pathfinder.PathFinder

public class PathFinder extends Object
Author:
Nicolas Fortin, Pierre Aumond, Sylvain Palominos
  • Field Details

    • LOGGER

      public static final org.slf4j.Logger LOGGER
    • progressVisitor

      public org.h2gis.api.ProgressVisitor progressVisitor
      Progression information
  • Constructor Details

    • 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 Details

    • 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 diffraction
      horizontalDiffraction - Enable horizontal diffraction
      Returns:
      Calculated propagation paths.
    • computeVEdgeDiffraction

      public CutProfile computeVEdgeDiffraction(PathFinder.ReceiverPointInfo rcv, PathFinder.SourcePointInfo src, Scene data, PathFinder.ComputationSide side, boolean curved)
      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)
      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 side
      p1 - First point
      p2 - Second point
      Returns:
      Intersection points between the plane formed by p1 and p2 and the buildings walls
    • computeSideHull

      public List<org.locationtech.jts.geom.Coordinate> computeSideHull(boolean left, org.locationtech.jts.geom.Coordinate p1, org.locationtech.jts.geom.Coordinate p2, boolean curved)
      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 side
      p1 - First point
      p2 - Second point
      curved - Used the curved coordinate system between p1 and p2 (favourable conditions in CNOSSOS)
      Returns:
      Intersection points between the plane formed by p1 and p2 and the buildings walls
    • computeZeroRadPlane

      public static org.apache.commons.math3.geometry.euclidean.threed.Plane computeZeroRadPlane(org.locationtech.jts.geom.Coordinate p0, org.locationtech.jts.geom.Coordinate p1)
      Compute the cutting plane with zero radian angle between the segment p0 and p1 (no pivot). The plane normal is upward.
    • 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 segment
      left - Side to keep
      segmentsCoordinates - 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 vector
      roofPts - 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

      Parameters:
      rcv - Receiver data
      src - Source data
      receiverMirrorIndex - Reflection information
      dataOut - 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 - Geometry
      segmentSizeConstraint - Maximal distance between points
      pts - computed points
      Returns:
      Fixed distance between points