Skip to content

Commit 3145a8c

Browse files
minor refactoring
1 parent cf61915 commit 3145a8c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ public Activation addInput(Document doc, Activation.Builder input) {
427427
Activation act = getActivation(doc, input);
428428

429429
if (act == null) {
430-
act = new Activation(doc, this, input.getSlots(doc));
430+
act = createActivation(doc, input.getSlots(doc));
431431
}
432432

433433
act.setInputState(input);
@@ -448,6 +448,11 @@ public Activation addInput(Document doc, Activation.Builder input) {
448448
}
449449

450450

451+
protected Activation createActivation(Document doc, Map<Integer, Position> slots) {
452+
return new Activation(doc, this, slots);
453+
}
454+
455+
451456
private Activation getActivation(Document doc, Activation.Builder input) {
452457
Integer firstSlot = input.positions.firstKey();
453458
Position firstPos = doc.lookupFinalPosition(input.positions.get(firstSlot));

src/main/java/network/aika/neuron/activation/Activation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*
4747
* @author Lukas Molzberger
4848
*/
49-
public final class Activation implements Comparable<Activation> {
49+
public class Activation implements Comparable<Activation> {
5050

5151
public static int BEGIN = 0;
5252
public static int END = 1;

0 commit comments

Comments
 (0)