增加LVQ模型参数和K均值模型参数的注入和获取

pull/1/head
lidapeng 5 years ago
parent 481ba07411
commit d153925e7b

@ -355,12 +355,14 @@ public class TempleConfig {
List<List<Double>> lists = kBorder.getLists(); List<List<Double>> lists = kBorder.getLists();
Map<Integer, BoxList> boxListMap = kBorder.getPositionMap(); Map<Integer, BoxList> boxListMap = kBorder.getPositionMap();
if (lists != null && boxListMap != null && lists.size() > 0 && boxListMap.size() > 0) { if (lists != null && boxListMap != null && lists.size() > 0 && boxListMap.size() > 0) {
Matrix[] matrices = kClustering.getMatrices(); kClustering.setReady(true);
Matrix[] matrices = new Matrix[lists.size()];
Map<Integer, Box> boxMap = kClustering.getPositionMap(); Map<Integer, Box> boxMap = kClustering.getPositionMap();
for (int i = 0; i < lists.size(); i++) { for (int i = 0; i < lists.size(); i++) {
Matrix matrix = listToRowVector(lists.get(i)); Matrix matrix = listToRowVector(lists.get(i));
matrices[i] = matrix; matrices[i] = matrix;
} }
kClustering.setMatrices(matrices);
kClustering.setLength(kBorder.getLength()); kClustering.setLength(kBorder.getLength());
kClustering.setSpeciesQuantity(kBorder.getSpeciesQuantity()); kClustering.setSpeciesQuantity(kBorder.getSpeciesQuantity());
for (Map.Entry<Integer, BoxList> boxEntry : boxListMap.entrySet()) { for (Map.Entry<Integer, BoxList> boxEntry : boxListMap.entrySet()) {
@ -370,7 +372,6 @@ public class TempleConfig {
box.setMatrixPosition(listToRowVector(boxList.getPositionList())); box.setMatrixPosition(listToRowVector(boxList.getPositionList()));
boxMap.put(boxEntry.getKey(), box); boxMap.put(boxEntry.getKey(), box);
} }
kClustering.setReady(true);
} }
} }

@ -32,10 +32,6 @@ public class KClustering {
this.matrices = matrices; this.matrices = matrices;
} }
public void setPositionMap(Map<Integer, Box> positionMap) {
this.positionMap = positionMap;
}
public void setReady(boolean ready) { public void setReady(boolean ready) {
isReady = ready; isReady = ready;
} }

Loading…
Cancel
Save