Class NoiseMapByReceiverMaker


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

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

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

      • 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*
      • 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)
      • 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
      • getPropagationProcessDataFactory

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

        public int getThreadCount()
      • setThreadCount

        public void setThreadCount​(int threadCount)
      • 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
        IOException
      • getComputationEnvelope

        protected 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
      • searchPopulatedCells

        public Map<CellIndex,​Integer> searchPopulatedCells​(Connection connection)
                                                          throws SQLException
        Fetch all receivers and compute cells that contains receivers
        Parameters:
        connection -
        Returns:
        Cell index with number of receivers
        Throws:
        SQLException
      • 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
      • initialize

        public void initialize​(Connection connection,
                               org.h2gis.api.ProgressVisitor progression)
                        throws SQLException
        Initializes the noise map computation process.
        Overrides:
        initialize in class GridMapMaker
        Parameters:
        connection - Active connection
        progression -
        Throws:
        SQLException
      • 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