Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit da75bce

Browse files
committed
Add SamplingAlgorithm abstract type
1 parent cd81849 commit da75bce

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/PointPatterns.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export
2323
ishomogeneous,
2424

2525
# algorithms
26+
SamplingAlgorithm,
2627
LewisShedler,
2728

2829
# thinning methods

src/processes.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,20 @@ function default_sampling_algorithm end
5454
# SAMPLING ALGORITHMS
5555
# --------------------
5656

57+
"""
58+
SamplingAlgorithm
59+
60+
A sampling algorithm for point processes.
61+
"""
62+
abstract type SamplingAlgorithm end
63+
5764
"""
5865
LewisShedler(λmax)
5966
6067
Generate sample using Lewis-Shedler algorithm (1979) with
6168
maximum real value `λmax` of the intensity function.
6269
"""
63-
struct LewisShedler{T<:Real}
70+
struct LewisShedler{T<:Real} <: SamplingAlgorithm
6471
λmax::T
6572
end
6673

@@ -70,9 +77,9 @@ end
7077
Generate sample assuming the intensity is constant over a `Geometry`
7178
or piecewise constant over a `Domain`.
7279
"""
73-
struct DiscretizedSampling end
80+
struct DiscretizedSampling <: SamplingAlgorithm end
7481

75-
struct UnionSampling end
82+
struct UnionSampling <: SamplingAlgorithm end
7683

7784
#-----------------
7885
# IMPLEMENTATIONS

0 commit comments

Comments
 (0)