Skip to content

Commit ff52e0d

Browse files
Converter cleanup
1 parent 045673b commit ff52e0d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/network/aika/lattice/Converter.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ private void convertConjunction() {
101101

102102
for (Synapse s : candidates) {
103103
double v = s.getMaxInputValue();
104+
boolean belowThreshold = sum + v + remainingSum + ss.getPosRecSum() + ss.getPosPassiveSum() + ss.getBiasSum() <= 0.0;
105+
if (belowThreshold) {
106+
return;
107+
}
108+
104109
if(sum + remainingSum - v + ss.getPosRecSum() + ss.getPosPassiveSum() + ss.getBiasSum() > 0.0) {
105110
optionalInputMode = true;
106111
}
107112

108113
if (!optionalInputMode) {
109-
110114
NodeContext nlNodeContext = expandNode(nodeContext, s);
111115
if (nlNodeContext == null) {
112116
return;
@@ -117,11 +121,6 @@ private void convertConjunction() {
117121
sum += v;
118122
i++;
119123
} else {
120-
boolean belowThreshold = sum + v + remainingSum + ss.getPosRecSum() + ss.getPosPassiveSum() + ss.getBiasSum() <= 0.0;
121-
if (belowThreshold) {
122-
return;
123-
}
124-
125124
NodeContext nlNodeContext = expandNode(nodeContext, s);
126125
if (nlNodeContext != null) {
127126
outputNode.addInput(nlNodeContext.getSynapseIds(), threadId, nlNodeContext.node, true);

0 commit comments

Comments
 (0)