Skip to content

Commit 7964fe6

Browse files
author
Lukas Molzberger
committed
implemented addModelLabels within the logic lattice.
1 parent d30e7e2 commit 7964fe6

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ private void init() {
6969
}
7070
}
7171

72+
public void addModelLabel(String modelLabel) {
73+
super.addModelLabel(modelLabel);
74+
75+
parents.forEach(e ->
76+
e.rv.parent.get().addModelLabel(modelLabel)
77+
);
78+
}
7279

7380
@Override
7481
protected void propagate(AndActivation act) {

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ public OrNode(Model m) {
6565
super(m, -1); // Or-node activations always need to be processed first!
6666
}
6767

68+
public void addModelLabel(String modelLabel) {
69+
super.addModelLabel(modelLabel);
70+
71+
andParents.forEach(e ->
72+
e.parent.get().addModelLabel(modelLabel)
73+
);
74+
}
75+
6876

6977
@Override
7078
public RefValue expand(int threadId, Document doc, Refinement ref) {

src/main/java/network/aika/neuron/INeuron.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ public Collection<Synapse> getInputSynapses() {
180180
return inputSynapses.values();
181181
}
182182

183+
public void addModelLabel(String modelLabel) {
184+
super.addModelLabel(modelLabel);
185+
186+
inputNode.get().addModelLabel(modelLabel);
187+
}
183188

184189
public Synapse getMaxInputSynapse(Synapse.State state) {
185190
if(type != EXCITATORY) {

0 commit comments

Comments
 (0)