use of jcog.data.MultiOutputStream in project narchy by automenta.
the class NARTestOptimize method main.
public static void main(String[] args) {
PrintStream out = System.out;
OutputStream fout = null;
try {
fout = new FileOutputStream(new File("/tmp/" + NARTestOptimize.class.getSimpleName() + ".csv"));
System.setOut(new PrintStream(new MultiOutputStream(out, fout)));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
while (true) {
Result<NAR> r = new Tweaks<>(() -> {
NAR n = NARS.tmp();
return n;
}) {
@Override
protected boolean includeField(Field f) {
return !f.getName().equals("DEBUG");
}
final Set<Class> exclude = Set.of(NARLoop.class);
@Override
protected boolean includeClass(Class<?> targetType) {
return !exclude.contains(targetType);
}
}.learn().tweak("PERCEIVE", -1f, +1f, 0.25f, (NAR n, float p) -> n.emotion.want(MetaGoal.Perceive, p)).tweak("BELIEVE", -1f, +1f, 0.25f, (NAR n, float p) -> n.emotion.want(MetaGoal.Believe, p)).optimize(32 * 1024, 4, (n) -> tests(n, NAL1Test.class, NAL1MultistepTest.class, NAL2Test.class, NAL3Test.class, NAL5Test.class));
r.print();
r.tree(2, 8).print();
System.out.println();
}
}
Aggregations