Skip to content

Commit ec29539

Browse files
committed
removed some unused commented code
1 parent b8eb162 commit ec29539

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

src/stippling.jl

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ function split_by_density!(
115115
for (ix, p) in enumerate(sites_combined)
116116
#---
117117
# calculate the required centroids / areas
118-
#centroid_combined, area_combined = grid_features(grid_combined,p)
119-
#calculate_density(density_interpolator, centroids_single[k][ix])
120-
#@show ix, centroids_single[1][ix]
121-
122118
densities = Vector{Float64}(undef, n_conditions)
123119
for k = 1:n_conditions
124120
centroid_index = centroids_single_linearized[k][ix]
@@ -130,25 +126,19 @@ function split_by_density!(
130126
densities[k] = grid_densities[k][centroid_index] * areas_single[k][ix]
131127
end
132128

133-
#@show densities
129+
134130
density_argmax = argmax(densities)
135131
density_selected = densities[density_argmax]
136132
centroid_selected = centroids_single[density_argmax][ix]
137133

138134
probability = sum(densities) - density_selected
139-
#@debug probability
140135
centroid_new = (probability < rand()) ? centroid_selected : centroids_combined[ix]
141136

142-
#@debug "centroids sel/comb" centroid_selected centroids_combined[ix]
143-
#@debug density_selected
137+
144138
[delete!(sites_sets[k], p) for k = 1:length(densities)]
145139
#if centroid_new in sites)
146140
if density_selected < threshold_low
147141
remove += 1
148-
#@show "let's only remove..."
149-
# remove it
150-
#delete!(sites_sets[density_argmax],p)
151-
#[delete!(sites_sets[k],p) for k = 1:length(densities)]
152142

153143
elseif density_selected > threshold_high
154144
#@show "splitting it"
@@ -158,22 +148,12 @@ function split_by_density!(
158148
Δmove = (rand(2) .- 0.5) .* size(grid_combined) * 0.01
159149
for _tmp in eachcol([Δmove .-Δmove])
160150
centroid_moved = move_centroid(centroid_new, _tmp, size(grid_combined))
161-
162-
#LinearIndices(size(grid_combined))[centroid_new.+_tmp]#
163-
#p_new = linearized_sites([centroid_new.+_tmp],size(grid_combined))[1] # within 1% of the centroid_new
164151
p_new_int =
165152
LinearIndices(size(grid_combined))[centroid_moved[1], centroid_moved[2]]
166153

167-
#@debug "split centroids:" centroid_new,linearized_sites(p_new_int,size(grid_combined))
168-
#@debug "pushing " p_new_int
169154
push!(sites_sets[density_argmax], p_new_int)
170-
#@show centroid_new.+_tmp
171-
#@show p_new_int
172-
#@show linearized_sites(p_new_int,size(grid_combined))
173155
end
174156

175-
#push!(sites_sets[density_argmax],Int(round(linearized_sites([centroid_new],size(grid_combined))[1])))
176-
177157
else
178158
# keep it around, move to selected
179159
centroid_new = Int.(round.(centroid_new))
@@ -182,7 +162,7 @@ function split_by_density!(
182162
sites_sets[density_argmax],
183163
LinearIndices(size(grid_combined))[centroid_new[1], centroid_new[2]],
184164
)
185-
#push!(sites_sets[density_argmax],Int(round(linearized_sites([centroid_new],size(grid_combined))[1])))
165+
186166

187167
end
188168

0 commit comments

Comments
 (0)