16 |
import java.util.logging.Logger; |
import java.util.logging.Logger; |
17 |
import java.util.logging.SimpleFormatter; |
import java.util.logging.SimpleFormatter; |
18 |
|
|
19 |
import com.jwetherell.algorithms.data_structures.KdTree; |
import ags.utils.dataStructures.trees.thirdGenKD.KdTree; |
20 |
|
|
21 |
|
|
22 |
|
|
23 |
public class LookupMain { |
public class LookupMain { |
90 |
max_workers = Math.max(1, cores); //Dog skal der som minimum være 1 core til beregning |
max_workers = Math.max(1, cores); //Dog skal der som minimum være 1 core til beregning |
91 |
|
|
92 |
} |
} |
93 |
|
if (test_mode) { |
94 |
|
max_workers = 1; |
95 |
|
} |
96 |
logger.info("Starting with MAX_WORKERS:" + max_workers); |
logger.info("Starting with MAX_WORKERS:" + max_workers); |
97 |
setupThreadPool(); |
setupThreadPool(); |
98 |
|
|
139 |
|
|
140 |
logger.info("Opbygger KDTree for " + ho + " - antal=" + geopoints.size() ); |
logger.info("Opbygger KDTree for " + ho + " - antal=" + geopoints.size() ); |
141 |
|
|
142 |
@SuppressWarnings("unchecked") |
int bucketSize = 96*12; |
|
List<KdTree.XYZPoint> tmpPoints = (List<KdTree.XYZPoint>)(List<?>) geopoints; |
|
143 |
|
|
144 |
KdTree<Adresse> addressTree = new KdTree<Adresse>( tmpPoints ); |
KdTree<Adresse> addressTree = new KdTree<Adresse>( 3, bucketSize ); |
145 |
|
for(Adresse a: geopoints) { |
146 |
|
addressTree.addPoint(a.xyz, a); |
147 |
|
} |
148 |
|
|
149 |
hoTrees.put(ho, addressTree); |
hoTrees.put(ho, addressTree); |
150 |
} |
} |
151 |
|
|
172 |
|
|
173 |
db.saveBatch(); |
db.saveBatch(); |
174 |
|
|
175 |
if (test_mode) { |
if (test_mode == false) { |
176 |
db.renameResultTables(); |
db.renameResultTables(); |
177 |
} else { |
} else { |
178 |
logger.info( "Rename tables is disabled !!!" ); |
logger.info( "Rename tables is disabled !!!" ); |