mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 08:50:52 +01:00
arachis'd
This commit is contained in:
parent
2e66b8d244
commit
c843c4fe76
@ -44,18 +44,19 @@ public class StructurePredictor {
|
|||||||
while (index < packet.getBytesLength()) {
|
while (index < packet.getBytesLength()) {
|
||||||
double currentLogScore = dynamic[index - 6].logScore;
|
double currentLogScore = dynamic[index - 6].logScore;
|
||||||
for (TypeChecker typeChecker : typeCheckers) {
|
for (TypeChecker typeChecker : typeCheckers) {
|
||||||
if (typeChecker.canRead(index)) {
|
if (!typeChecker.canRead(index)) continue;
|
||||||
double score = typeChecker.score(index);
|
|
||||||
double newScore = currentLogScore + Math.log(score);
|
double score = typeChecker.score(index);
|
||||||
int nextIndex = typeChecker.nextIndex(index) - 6;
|
double newScore = currentLogScore + Math.log(score);
|
||||||
if (dynamic[nextIndex] == null || newScore > dynamic[nextIndex].logScore) {
|
int nextIndex = typeChecker.nextIndex(index) - 6;
|
||||||
dynamic[nextIndex] = new SubStructure(
|
if (dynamic[nextIndex] == null || newScore > dynamic[nextIndex].logScore) {
|
||||||
index - 6,
|
dynamic[nextIndex] = new SubStructure(
|
||||||
typeChecker.getStructCode(),
|
index - 6,
|
||||||
newScore
|
typeChecker.getStructCode(),
|
||||||
);
|
newScore
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user