Class NoiseMapByReceiverMaker

java.lang.Object
org.noise_planet.noisemodelling.jdbc.GridMapMaker
org.noise_planet.noisemodelling.jdbc.NoiseMapByReceiverMaker

public class NoiseMapByReceiverMaker extends GridMapMaker
Compute noise propagation at specified receiver points.
Author:
Nicolas Fortin
  • Field Details

    • exitWhenDone

      public AtomicBoolean exitWhenDone
      Tell table writer thread to empty current stacks then stop waiting for new data
    • aborted

      public AtomicBoolean aborted
      If true, all processing are aborted and all threads will be shutdown
  • Constructor Details

    • NoiseMapByReceiverMaker

      public NoiseMapByReceiverMaker(String buildingsTableName, String sourcesTableName, String receiverTableName)
      ?? for train source ? TODO is it related to sources ? if yes then provide a special column for this kind of source
  • Method Details

    • getNoiseMapDatabaseParameters

      public NoiseMapDatabaseParameters getNoiseMapDatabaseParameters()
      Returns:
      Settings of the database (expected tables names; fields, global settings of the computation)
    • getSourcesEmissionTableName

      public String getSourcesEmissionTableName()
      This table must contain a source identifier column named IDSOURCE, a **PERIOD** VARCHAR field, and emission spectrum in dB(A). Spectrum column name must be LWGridMapMaker.sound_lvl_field. Where HERTZ is a number
      Returns:
      Source emission table name*
    • getInputMode

    • setInputMode

      public void setInputMode(SceneDatabaseInputSettings.INPUT_MODE inputMode)
    • getSourceEmissionPrimaryKeyField

      public String getSourceEmissionPrimaryKeyField()
    • setSourceEmissionPrimaryKeyField

      public void setSourceEmissionPrimaryKeyField(String sourceEmissionPrimaryKeyField)
    • getFrequencyFieldPrepend

      public String getFrequencyFieldPrepend()
    • setFrequencyFieldPrepend

      public void setFrequencyFieldPrepend(String frequencyFieldPrepend)
      Parameters:
      frequencyFieldPrepend - Text preceding the frequency in source emission table (default LW)
    • getSceneInputSettings

      public SceneDatabaseInputSettings getSceneInputSettings()
    • setSourcesEmissionTableName

      public void setSourcesEmissionTableName(String sourcesEmissionTableName)
      This table must contain a source identifier column named IDSOURCE, a **PERIOD** VARCHAR field, and emission spectrum in dB(A) or road traffic information Spectrum column name must be LWGridMapMaker.sound_lvl_field. Where HERTZ is a number
      Parameters:
      sourcesEmissionTableName - Source emission table name
    • isBodyBarrier

      public boolean isBodyBarrier()
      true if train propagation is computed (multiple reflection between the train and a screen)
    • 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
    • getReceiverTableName

      public String getReceiverTableName()
      Returns:
      Receiver table name
    • 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
    • setComputeRaysOutFactory

      public void setComputeRaysOutFactory(NoiseMapByReceiverMaker.IComputeRaysOutFactory computeRaysOutFactory)
      Parameters:
      computeRaysOutFactory - Factory to create output data handler for each cell
    • getComputeRaysOutFactory

      public NoiseMapByReceiverMaker.IComputeRaysOutFactory getComputeRaysOutFactory()
      Returns:
      Factory to create an output data handler for each cell the default is DefaultCutPlaneProcessing
    • setPropagationProcessDataFactory

      public void setPropagationProcessDataFactory(NoiseMapByReceiverMaker.TableLoader tableLoader)
      Do not call this method after initialize(Connection) has been called
      Parameters:
      tableLoader - Object that generate scene for each sub-cell using database data
    • getPropagationProcessDataFactory

      public NoiseMapByReceiverMaker.TableLoader getPropagationProcessDataFactory()
      Returns:
      Object that generate scene for each sub-cell using database data
    • getThreadCount

      public int getThreadCount()
      Returns:
      Number of threads used for ray propagation, 0 means automatic detection of number of CPU cores
    • setThreadCount

      public void setThreadCount(int threadCount)
      Parameters:
      threadCount - Number of threads used for ray propagation, 0 means automatic detection of number of CPU cores
    • prepareCell

      public SceneWithEmission prepareCell(Connection connection, CellIndex cellIndex, Set<Long> skipReceivers) throws SQLException, IOException
      Initialisation of data structures needed for sound propagation.
      Parameters:
      connection - JDBC Connection
      cellIndex - Computation area index
      skipReceivers - Do not process the receivers primary keys in this set and once included add the new receivers primary in it
      Returns:
      Data input for cell evaluation
      Throws:
      SQLException - SQL exception instance
      IOException - IO exception instance
    • getComputationEnvelope

      public org.locationtech.jts.geom.Envelope getComputationEnvelope(Connection connection) throws SQLException
      Retrieves the computation envelope based on data stored in the database tables.
      Specified by:
      getComputationEnvelope in class GridMapMaker
      Parameters:
      connection - the database connection.
      Returns:
      the computation envelope containing the bounding box of the data stored in the specified tables.
      Throws:
      SQLException - if an SQL exception occurs while retrieving the envelope.
    • searchPopulatedCells

      public Map<CellIndex,Integer> searchPopulatedCells(Connection connection) throws SQLException
      Fetch all receivers and compute cells that contains receivers
      Parameters:
      connection - JDBC Connection
      Returns:
      Cell index with number of receivers
      Throws:
      SQLException - SQL exception instance
    • evaluateCell

      public CutPlaneVisitorFactory evaluateCell(Connection connection, CellIndex cellIndex, org.h2gis.api.ProgressVisitor progression, Set<Long> skipReceivers) throws SQLException, IOException
      Launch sound propagation
      Parameters:
      connection - JDBC Connection
      cellIndex - Computation area index
      progression - Progression info
      skipReceivers - Do not process the receivers primary keys in this set and once included add the new receivers primary in it
      Returns:
      Output data instance for this cell
      Throws:
      SQLException - Sql exception instance
      IOException
    • getTableLoader

      public NoiseMapByReceiverMaker.TableLoader getTableLoader()
      Returns:
      Class used to load tables for input data
    • initialize

      public void initialize(Connection connection) throws SQLException
      Initializes the noise map computation process.
      Overrides:
      initialize in class GridMapMaker
      Parameters:
      connection - Active connection
      Throws:
      SQLException - if an SQL exception occurs during initialization.
    • run

      public void run(Connection connection, org.h2gis.api.ProgressVisitor progressLogger) throws SQLException
      Run NoiseModelling with provided parameters, return when computation is done
      Throws:
      SQLException