Class AttenuationOutputSingleThread
- java.lang.Object
-
- org.noise_planet.noisemodelling.jdbc.output.AttenuationOutputSingleThread
-
- All Implemented Interfaces:
CutPlaneVisitor
public class AttenuationOutputSingleThread extends Object implements CutPlaneVisitor
Managed by a single thread, process all incoming vertical profile, compute attenuation and push on appropriate stack for exporting result values in a thread safe way. It processes the receiver one at a time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AttenuationOutputSingleThread.TimePeriodParameters
representing the noise levels for different time periods.-
Nested classes/interfaces inherited from interface org.noise_planet.noisemodelling.pathfinder.CutPlaneVisitor
CutPlaneVisitor.PathSearchStrategy
-
-
Field Summary
Fields Modifier and Type Field Description List<CnossosPath>
cnossosPaths
AtomicInteger
cutProfileCount
-
Constructor Summary
Constructors Constructor Description AttenuationOutputSingleThread(AttenuationOutputMultiThread multiThreadParent, org.h2gis.api.ProgressVisitor progressVisitor)
Constructs a NoiseMapInStack object with a multithreaded parent NoiseMap instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalizeReceiver(PathFinder.ReceiverPointInfo receiver)
No more propagation paths will be pushed for this receiver identifierCutPlaneVisitor.PathSearchStrategy
onNewCutPlane(CutProfile cutProfile)
A new vertical profile between a receiver and a source has been foundvoid
pushInStack(ConcurrentLinkedDeque<CnossosPath> stack, Collection<CnossosPath> data)
Adds Cnossos paths to a concurrent stack while maintaining the maximum stack size.void
pushInStack(ConcurrentLinkedDeque<ReceiverNoiseLevel> stack, ReceiverNoiseLevel data)
Pushes attenuation data into a concurrent linked deque.void
startReceiver(PathFinder.ReceiverPointInfo receiver, Collection<PathFinder.SourcePointInfo> sourceList, AtomicInteger cutProfileCount)
Called before looking for vertical cut planes between the receiver and the sources.
-
-
-
Field Detail
-
cnossosPaths
public List<CnossosPath> cnossosPaths
-
cutProfileCount
public AtomicInteger cutProfileCount
-
-
Constructor Detail
-
AttenuationOutputSingleThread
public AttenuationOutputSingleThread(AttenuationOutputMultiThread multiThreadParent, org.h2gis.api.ProgressVisitor progressVisitor)
Constructs a NoiseMapInStack object with a multithreaded parent NoiseMap instance. This class is not thread-safe- Parameters:
multiThreadParent
-
-
-
Method Detail
-
onNewCutPlane
public CutPlaneVisitor.PathSearchStrategy onNewCutPlane(CutProfile cutProfile)
Description copied from interface:CutPlaneVisitor
A new vertical profile between a receiver and a source has been found- Specified by:
onNewCutPlane
in interfaceCutPlaneVisitor
- Parameters:
cutProfile
- vertical profile- Returns:
- Will skip or not the next processing depending on this value.
-
startReceiver
public void startReceiver(PathFinder.ReceiverPointInfo receiver, Collection<PathFinder.SourcePointInfo> sourceList, AtomicInteger cutProfileCount)
Description copied from interface:CutPlaneVisitor
Called before looking for vertical cut planes between the receiver and the sources.- Specified by:
startReceiver
in interfaceCutPlaneVisitor
- Parameters:
receiver
- Receiver informationsourceList
- All sources in the range of this receiver sorted by the distance from the receiver
-
pushInStack
public void pushInStack(ConcurrentLinkedDeque<ReceiverNoiseLevel> stack, ReceiverNoiseLevel data)
Pushes attenuation data into a concurrent linked deque.- Parameters:
stack
- Stack to feeddata
- receiver noise level in dB
-
pushInStack
public void pushInStack(ConcurrentLinkedDeque<CnossosPath> stack, Collection<CnossosPath> data)
Adds Cnossos paths to a concurrent stack while maintaining the maximum stack size.- Parameters:
stack
- Stack to feeddata
- rays
-
finalizeReceiver
public void finalizeReceiver(PathFinder.ReceiverPointInfo receiver)
No more propagation paths will be pushed for this receiver identifier- Specified by:
finalizeReceiver
in interfaceCutPlaneVisitor
- Parameters:
receiver
-
-
-