Skip to content

Commit 8e03247

Browse files
author
Lukas Molzberger
committed
Merge remote-tracking branch 'origin/stable-1.4.0' into stable-1.4.0
2 parents 471a4d6 + 1366687 commit 8e03247

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

src/main/java/network/aika/AbstractNode.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import network.aika.neuron.Neuron;
2323

2424
import java.io.DataInput;
25+
import java.io.DataOutput;
2526
import java.io.IOException;
2627
import java.util.Set;
2728
import java.util.TreeSet;
@@ -67,6 +68,24 @@ public String getLabel() {
6768
return null;
6869
}
6970

71+
@Override
72+
public void write(DataOutput out) throws IOException {
73+
if(modelLabels != null) {
74+
for (String modelLabel: modelLabels) {
75+
out.writeBoolean(true);
76+
out.writeUTF(modelLabel);
77+
}
78+
}
79+
out.writeBoolean(false);
80+
}
81+
82+
@Override
83+
public void readFields(DataInput in, Model m) throws IOException {
84+
while(in.readBoolean()) {
85+
getModelLabels().add(in.readUTF());
86+
}
87+
}
88+
7089
public static <P extends Provider> AbstractNode read(DataInput in, P p) throws IOException {
7190
AbstractNode n;
7291
if(in.readBoolean()) {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ public int compareTo(Node n) {
401401

402402
@Override
403403
public void write(DataOutput out) throws IOException {
404+
super.write(out);
405+
404406
out.writeInt(level);
405407

406408
out.writeInt(numberOfNeuronRefs.get());
@@ -428,6 +430,8 @@ public void write(DataOutput out) throws IOException {
428430

429431
@Override
430432
public void readFields(DataInput in, Model m) throws IOException {
433+
super.readFields(in, m);
434+
431435
level = in.readInt();
432436

433437
numberOfNeuronRefs.set(in.readInt());

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,8 @@ public int compareTo(INeuron n) {
567567
public void write(DataOutput out) throws IOException {
568568
out.writeBoolean(true);
569569

570+
super.write(out);
571+
570572
out.writeBoolean(label != null);
571573
if(label != null) {
572574
out.writeUTF(label);
@@ -631,6 +633,8 @@ public void write(DataOutput out) throws IOException {
631633

632634
@Override
633635
public void readFields(DataInput in, Model m) throws IOException {
636+
super.readFields(in, m);
637+
634638
if(in.readBoolean()) {
635639
label = in.readUTF();
636640
}

0 commit comments

Comments
 (0)