Skip to content

Commit 3d766fc

Browse files
cleanup
1 parent 8fa57f4 commit 3d766fc

File tree

4 files changed

+3
-59
lines changed

4 files changed

+3
-59
lines changed

src/main/java/network/aika/neuron/relation/AncestorRelation.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,6 @@ public Stream<Activation> getActivations(INeuron n, Activation linkedAct) {
169169
return results.stream();
170170
}
171171

172-
@Override
173-
public Relation newInstance() {
174-
return new CommonAncestor(optional, follow);
175-
}
176-
177172
public String toString() {
178173
return "COMMON-ANCESTOR";
179174
}
@@ -223,12 +218,6 @@ public Stream<Activation> getActivations(INeuron n, Activation linkedAct) {
223218
return results.stream();
224219
}
225220

226-
@Override
227-
public Relation newInstance() {
228-
return new IsDescendantOf(optional, follow);
229-
}
230-
231-
232221
public String toString() {
233222
return "DESCENDANT-OF";
234223
}
@@ -278,11 +267,6 @@ public Stream<Activation> getActivations(INeuron n, Activation linkedAct) {
278267
return results.stream();
279268
}
280269

281-
@Override
282-
public Relation newInstance() {
283-
return new IsAncestorOf(optional, follow);
284-
}
285-
286270
public String toString() {
287271
return "ANCESTOR-OF";
288272
}
@@ -334,11 +318,6 @@ public Stream<Activation> getActivations(INeuron n, Activation linkedAct) {
334318
.filter(act -> act.markedAncDesc != v);
335319
}
336320

337-
@Override
338-
public Relation newInstance() {
339-
return new NotDescendantOf(optional, follow);
340-
}
341-
342321
public String toString() {
343322
return "NOT-DESCENDANT-OF";
344323
}
@@ -390,11 +369,6 @@ public Stream<Activation> getActivations(INeuron n, Activation linkedAct) {
390369
.filter(act -> act.markedAncDesc != v);
391370
}
392371

393-
@Override
394-
public Relation newInstance() {
395-
return new NotAncestorOf(optional, follow);
396-
}
397-
398372
public String toString() {
399373
return "NOT-ANCESTOR-OF";
400374
}

src/main/java/network/aika/neuron/relation/MultiRelation.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,6 @@ public boolean isConvertible() {
159159
return false;
160160
}
161161

162-
@Override
163-
public Relation newInstance() {
164-
MultiRelation mr = new MultiRelation();
165-
for(Relation r: relations) {
166-
mr.addRelation(r.newInstance());
167-
}
168-
return mr;
169-
}
170-
171162

172163
@Override
173164
public int compareTo(Relation rel) {

src/main/java/network/aika/neuron/relation/PositionRelation.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,6 @@ public boolean isExact() {
156156
return true;
157157
}
158158

159-
@Override
160-
public Relation newInstance() {
161-
return new Equals(fromSlot, toSlot, optional, follow);
162-
}
163-
164159
@Override
165160
public Stream<Activation> getActivations(INeuron n, Position pos) {
166161
if(!follow) return Stream.empty();
@@ -222,10 +217,6 @@ public boolean isExact() {
222217
return false;
223218
}
224219

225-
@Override
226-
public Relation newInstance() {
227-
return new LessThan(fromSlot, toSlot, orEquals, optional, follow, maxLength);
228-
}
229220

230221
@Override
231222
public boolean test(Position a, Position b) {
@@ -315,11 +306,6 @@ public boolean isExact() {
315306
return false;
316307
}
317308

318-
@Override
319-
public Relation newInstance() {
320-
return new GreaterThan(fromSlot, toSlot, orEquals, optional, follow, maxLength);
321-
}
322-
323309
@Override
324310
public boolean test(Position a, Position b) {
325311
if(a == b) {

src/main/java/network/aika/neuron/relation/Relation.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ public boolean isConvertible() {
134134
return !optional && follow;
135135
}
136136

137-
public abstract Relation newInstance();
138-
139137
public void link(Neuron n, int from, int to) {
140138
addRelation(to, from, n, this);
141139
addRelation(from, to, n, invert());
@@ -203,10 +201,10 @@ public static Map<Integer, Relation> getRelationsMap(int synapseId, Neuron n) {
203201

204202

205203
public static class Builder implements Neuron.Builder {
206-
private int from;
207-
private int to;
204+
protected int from;
205+
protected int to;
208206

209-
private Relation relation;
207+
protected Relation relation;
210208

211209

212210
/**
@@ -307,11 +305,6 @@ public boolean isConvertible() {
307305
return true;
308306
}
309307

310-
@Override
311-
public Relation newInstance() {
312-
return new Any(optional, follow);
313-
}
314-
315308
@Override
316309
public Relation setOptionalAndFollow(boolean optional, boolean follow) {
317310
return new Any(optional, follow);

0 commit comments

Comments
 (0)