adding a caphelper since not enough data gets through

This commit is contained in:
jenzur 2020-03-29 13:44:50 +02:00
parent 2f7ab3b9cf
commit c0d529f492

View File

@ -220,7 +220,7 @@ public class Datahandler {
hlStatsMessages.put(str, hlStatsMessages.size()); hlStatsMessages.put(str, hlStatsMessages.size());
} }
} }
int capacity = 250; int capacity = 1250;
hlStatsMessages.keySet().forEach(str -> { hlStatsMessages.keySet().forEach(str -> {
if (!str.startsWith("!") && MessageResponseHandler.getStr().values().size() < capacity) { if (!str.startsWith("!") && MessageResponseHandler.getStr().values().size() < capacity) {
String orElse = strCacheLocal.values().parallelStream().filter(e -> e.equals(str)).findAny().orElse(null); String orElse = strCacheLocal.values().parallelStream().filter(e -> e.equals(str)).findAny().orElse(null);
@ -276,10 +276,15 @@ public class Datahandler {
String newPrimary = similarityMatrixes.get(0).getPrimaryString(); String newPrimary = similarityMatrixes.get(0).getPrimaryString();
int evaluationCap = 500; int evaluationCap = 500;
int iterator = 0; int iterator = 0;
Double caphelper = 0.0;
for (SimilarityMatrix SMX : similarityMatrixes) { for (SimilarityMatrix SMX : similarityMatrixes) {
final Double scoreRelationNewMsgToRecentMsg = SMX.getDistance(); final Double scoreRelationNewMsgToRecentMsg = SMX.getDistance();
if (scoreRelationNewMsgToRecentMsg > evaluationCap) { if (scoreRelationNewMsgToRecentMsg > 0.0) {
caphelper += scoreRelationNewMsgToRecentMsg;
}
if (caphelper > evaluationCap) {
strmapreturn = addSMXToMapReturn(strmapreturn, SMX); strmapreturn = addSMXToMapReturn(strmapreturn, SMX);
caphelper = 0.0;
} }
//System.out.println("similarityMatrixes size: " + similarityMatrixes.size() + "\niterator: " + iterator); //System.out.println("similarityMatrixes size: " + similarityMatrixes.size() + "\niterator: " + iterator);
iterator++; iterator++;