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

Commit de3d8d6

Browse files
committed
Add InhibitionProcess
1 parent c9b5e85 commit de3d8d6

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

src/PointPatterns.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export
1919
PointProcess,
2020
BinomialProcess,
2121
PoissonProcess,
22+
InhibitionProcess,
2223
ClusterProcess,
2324
UnionProcess,
2425
ishomogeneous,

src/processes.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ function randsingle end
4545

4646
include("processes/binomial.jl")
4747
include("processes/poisson.jl")
48+
include("processes/inhibition.jl")
4849
include("processes/cluster.jl")
4950
include("processes/union.jl")

src/processes/inhibition.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ------------------------------------------------------------------
2+
# Licensed under the MIT License. See LICENSE in the project root.
3+
# ------------------------------------------------------------------
4+
5+
"""
6+
InhibitionProcess(r)
7+
8+
An inhibition point process with radius `r`.
9+
"""
10+
struct InhibitionProcess{R<:Real} <: PointProcess
11+
r::R
12+
end
13+
14+
randsingle(rng::Random.AbstractRNG, p::InhibitionProcess, g) = PointSet(sample(rng, g, MinDistanceSampling(p.r)))

test/processes.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
binom = BinomialProcess(100)
2121
poisson1 = PoissonProcess(100.0)
2222
poisson2 = PoissonProcess(λ)
23-
procs = [binom, poisson1, poisson2]
23+
inhibit = InhibitionProcess(0.1)
24+
procs = [binom, poisson1, poisson2, inhibit]
2425

2526
@testset "Basic" begin
2627
for p in procs, g in geoms
@@ -54,6 +55,12 @@
5455
@test isnothing(rand(PoissonProcess(100.0), pp))
5556
end
5657

58+
@testset "Inhibition" begin
59+
end
60+
61+
@testset "Cluster" begin
62+
end
63+
5764
@testset "Union" begin
5865
b = Box((0.0, 0.0), (100.0, 100.0))
5966
p₁ = BinomialProcess(50)

0 commit comments

Comments
 (0)