-
Notifications
You must be signed in to change notification settings - Fork 0
popZoneSort()
There are multiple layers of sorting functions called when the master sort function is called on a z_list.
-
Merge sort is used to do a descending population sort of every zone in each list of the z_list. This is fast, but only a cursory sort to get things into subsets of the same population.
-
An insertion sort is used to resort to the partially sorted data within only the subsets of the list where the zones have the same population. This sort is done by the adjacent population, descending.
-
An insertion sort is used again on the subsets of the list where the population and adjacent population are the same. These subsets are sorted by the Y coordinate, ascending.
-
An insertion sort is then used on the subsets of the lists where the population and adjacent population and Y coordinate are the same. These subsets are sorted by the X coordinate, ascending.
After this sorting procedure is completed, the lists are perfectly configured for population update deconfliction.