Skip to content

Commit 7a079d0

Browse files
factory refactoring
1 parent 49d6cf3 commit 7a079d0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,14 +572,19 @@ public void registerSynapseIds(Neuron n) {
572572

573573

574574
public Synapse getSynapse(Neuron outputNeuron) {
575-
Synapse s = createOrReplace(null, synapseId, neuron, outputNeuron, (input, output, id) -> new Synapse(input, output, id));
575+
Synapse s = createOrReplace(null, synapseId, neuron, outputNeuron, getSynapseFactory());
576576

577577
s.isRecurrent = recurrent;
578578
s.identity = identity;
579579
s.distanceFunction = distanceFunction;
580580

581581
return s;
582582
}
583+
584+
585+
protected SynapseFactory getSynapseFactory() {
586+
return (input, output, id) -> new Synapse(input, output, id);
587+
}
583588
}
584589

585590
public interface SynapseFactory {

0 commit comments

Comments
 (0)