This repository was archived by the owner on Nov 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,12 @@ struct UnionSampling end
1818
1919default_sampling_algorithm (:: UnionProcess ) = UnionSampling ()
2020
21- function rand_single (p:: UnionProcess , :: Geometry , algo:: UnionSampling )
22- pp₁ = rand (p. p₁, r )
23- pp₂ = rand (p. p₂, r )
21+ function rand_single (p:: UnionProcess , g :: Geometry , algo:: UnionSampling )
22+ pp₁ = rand (p. p₁, g )
23+ pp₂ = rand (p. p₂, g )
2424
25- X = coordinates (pp₁)
26- Y = coordinates (pp₂)
25+ X = coordinates (pp₁, 1 : nelements (pp₁) )
26+ Y = coordinates (pp₂, 1 : nelements (pp₂) )
2727
2828 PointSet (hcat (X, Y))
2929end
Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ abstract type AbstractThinning end
1414
1515Thin spatial point process `p` with thinning method `t`.
1616"""
17- thin (p :: PointProcess , t :: AbstractThinning ) = @error " not implemented "
17+ function thin end
1818
1919"""
2020 thin(pp, t)
2121
2222Thin spatial point pattern `pp` with thinning method `t`.
2323"""
24- thin (pp :: PointSet , t :: AbstractThinning ) = @error " not implemented "
24+ thin (:: PointSet , :: AbstractThinning )
2525
2626# -----------------
2727# IMPLEMENTATIONS
Original file line number Diff line number Diff line change 1616 @testset " Poisson" begin
1717 # TODO
1818 end
19+
20+ @testset " Union" begin
21+ b = Box ((0. ,0. ), (100. ,100. ))
22+ p₁ = BinomialProcess (50 )
23+ p₂ = BinomialProcess (50 )
24+ p = p₁ ∪ p₂ # 100 points
25+
26+ s = rand (p, b, 2 )
27+ @test length (s) == 2
28+ @test s[1 ] isa PointSet
29+ @test s[2 ] isa PointSet
30+ @test nelements .(s) == [100 ,100 ]
31+ end
1932end
You can’t perform that action at this time.
0 commit comments