我沒有進入他的代碼的細節,但他做了什麼,在2D Voronoi圖,然後選擇多邊形作爲新的分中心和改造的Voronoi圖給了我這樣的想法:
1. Randomly select your points
2. Compute midways between your points
-> The two midways on the two sides of each point, is like
its Voronoi polygon in the Voronoi diagram
-> So let's call the range between these two "midways" a Voronoi range!
3. Replace each point by the center of its Voronoi range
4. If you want the values to be less random, loop back to step 2
5. The ranges you are looking for are the Voronoi ranges of the last results.
我們來看一個例子。爲了簡單起見,我們假設我們正在研究連續範圍。
所以你從範圍[0,80]開始,你想把它分成15個範圍。
假設進行排序是(由C程序:)生成後您的15張隨機數
1 5 12 17 19 21 26 31 38 47 52 54 56 67 71
的中點是:
1 5 12 17 19 21 26 31 38 47 52 54 56 67 71
^^^^^^^^^^^^^^
| | | | | | | | | | | | | |
3 8.5 14.5 18 20 23.5 28.5 34.5 42.5 49.5 51 55 61.5 69
所以,你的範圍成爲:
[0, 3], [3, 8.5], [8.5, 14.5], [14.5, 18], [18, 20],
[20, 23.5], [23.5, 28.5], [28.5, 34.5], [34.5, 42.5], [42.5, 49.5],
[49.5, 51], [51, 55], [55, 61.5], [61.5, 69], [69, 80]
如果你想想象這個,它看起來像這樣(最好我可以用文本顯示):
+..+.....+.....+..+.+...+....+.....+.......+......++...+......+......+.........+
凡.
節目編號從0到80和+
顯示沃羅諾伊的邊緣的範圍內。
現在,讓我們應用步驟3。
1 5 12 17 19 21 26 31 38 47 52 54 56 67 71
^^^^^^^^^^^^^^
| | | | | | | | | | | | | |
0 3 8.5 14.5 18 20 23.5 28.5 34.5 42.5 49.5 51 55 61.5 69 80
^^^ ^^^^^^^^^^ ^^
| | | | | | | | | | | | | | |
1.5 | 11.5 16.25 19 21.75 26 31.5 38.5 46 50.25 53 58.25 65.25|
5.75 74.5
現在讓我們看的見的維諾範圍如何看起來像新的點:
1.5 5.75 11.5 16.25 19 21.75 26 31.5 38.5 46 50.25 53 58.25 65.25 74.5
^ ^^ ^^ ^^^^^ ^^^ ^
| | | | | | | | | | | | | |
3.625 8.625 13.875 17.625| 23.875 | 35 42.25 48.125 | 55.625 61.75 69.875
20.375 28.75 51.625
現在你的範圍是(它的開始看起來很醜,但是我忍受)
[0, 3.625], [3.625, 8.625], [8.625, 13.875],
[13.875, 17.625], [17.625, 20.375], [20.375, 23.875],
[23.875, 28.75], [28.75, 35], [35, 42.25],
[42.25, 48.125], [48.125, 51.625], [51.625, 55.625],
[55.625, 61.75], [61.75, 69.875], [69.875, 80]
所以現在我們來看看點的分佈如何:
+...+....+....+...+..+..+....+.....+.......+....+...+...+.....+.......+........+
現在讓我們兩個分佈比較:
First one
|
V
+..+.....+.....+..+.+...+....+.....+.......+......++...+......+......+.........+
+...+....+....+...+..+..+....+.....+.......+....+...+...+.....+.......+........+
^
|
Second one
看起來更好,不是嗎?這正是他在你用2d Voronoi多邊形應用到1d範圍的文章中所做的。
(請原諒我的任何可能的計算誤差)
這將有助於如果你可以定義微型和大型:),我們在談論什麼尺寸(即K&N)? –
我提供的鏈接有一個很好的圖像顯示問題(和解決方案的改進)。並且指定tiny/large,只會導致基於限制的算法,這是對我目前的隨機方法的微不足道的補充,但並不是一個更好的方法。 –