@@ -18,7 +18,58 @@ parent point and returns a geometry or domain for the offspring process.
1818## Examples
1919
2020```julia
21- # TODO
21+ import CairoMakie
22+ using Meshes, MeshViz
23+ using PointPatterns
24+
25+ # Matern cluster process
26+ d = Box((0,0), (5,5))
27+ p = ClusterProcess(
28+ PoissonProcess(1),
29+ PoissonProcess(1000),
30+ parent -> Ball(parent, 0.2)
31+ )
32+ ps = rand(p, d)
33+
34+ fig = viz(d, alpha = 0.5; axis = (;title = "Matern cluster process"))
35+ viz!(ps, color = :black, pointsize = 5)
36+
37+ # Inhomogenegeous parent process with fixed number of offsprings
38+
39+ d = Box((-2.5,-2.5), (2.5,2.5))
40+ p = ClusterProcess(
41+ PoissonProcess(s -> 1 * sum(coordinates(s) .^ 2)),
42+ BinomialProcess(100),
43+ parent -> Ball(parent, 0.2)
44+ )
45+ ps = rand(p, d)
46+
47+ fig = viz(d, alpha = 0.5; axis = (;title = "Inhomogeneneous with fixed number of offsprings"))
48+ viz!(ps, color = :black, pointsize = 5)
49+
50+ # Inhomogenegeous parent process and inhomogeneneous offspring process
51+
52+ d = Box((0,0), (5,5))
53+ p = ClusterProcess(
54+ PoissonProcess(s -> 0.1 * sum(coordinates(s) .^ 2)),
55+ parent -> rand(PoissonProcess(x -> 5000 * sum((x - parent).^2)), Ball(parent, 0.5))
56+ )
57+ ps = rand(p, d)
58+
59+ fig = viz(d, alpha = 0.5; axis = (;title = "Inhomogenegeous parent and inhomogeneneous offspring"))
60+ viz!(ps, color = :black, pointsize = 5)
61+
62+ # Inhomogenegeous parent process and regularsampling
63+
64+ d = Box((0,0), (5,5))
65+ p = ClusterProcess(
66+ PoissonProcess(s -> 0.2 * sum(coordinates(s) .^ 2)),
67+ parent -> PointSet(sample(Sphere(parent, 0.1), RegularSampling(10)))
68+ )
69+ ps = rand(p, d)
70+
71+ fig = viz(d, alpha = 0.5; axis = (;title = "Inhomogenegeous parent and regular sampling"))
72+ viz!(ps, color = :black, pointsize = 5)
2273```
2374"""
2475struct ClusterProcess{P<: PointProcess ,F<: Function } <: PointProcess
0 commit comments