diff --git a/nars_gui/nars/gui/output/NARFacePanel.java b/nars_gui/nars/gui/output/NARFacePanel.java index 7329a81b0b037b7c3f51912842174fb6c4acd806..57bb0c6afaad7e1b93b9570d82754d17124b22e2 100644 --- a/nars_gui/nars/gui/output/NARFacePanel.java +++ b/nars_gui/nars/gui/output/NARFacePanel.java @@ -1,54 +1,54 @@ -package nars.gui.output; - -import automenta.vivisect.face.HumanoidFacePanel; -import nars.NAR; -import nars.config.Parameters; - - - -public class NARFacePanel extends HumanoidFacePanel { - private final NAR nar; - - public NARFacePanel(NAR n) { - super(); - this.nar = n; - } - - @Override - protected void onShowing(boolean showing) { - super.onShowing(showing); - -// if (showing) { -// nar.addOutput(this); -// } -// else { -// nar.removeOutput(this); -// } - } - - - @Override - public void update(double t) { - happy = nar.memory.emotion.happy() > Parameters.HAPPY_EVENT_HIGHER_THRESHOLD; - unhappy = nar.memory.emotion.happy() < Parameters.HAPPY_EVENT_LOWER_THRESHOLD; - float conceptPriority = 0.5f; //((Number)nar.memory.logic.get("concept.priority.mean")).floatValue(); - float taskNewPriority = 0.5f; //((Number)nar.memory.logic.get("task.new.priority.mean")).floatValue(); - - //max out at 0.5 - conceptPriority = Math.min(conceptPriority, 0.4f); - //if (nar.memory.getConcepts().isEmpty()) - conceptPriority = 0; //if no concepts, start at zero, regardless of what mean might be valued - - face.setPupil(12f * (conceptPriority+0.35f)+2f, - taskNewPriority*taskNewPriority*0.45f,0,0,0.9f); //pupils glow a little red for priority of new tasks - - face.setEyeball(8f * (conceptPriority + 0.35f)+12f,1f,1f,1f,0.85f); - super.update(t); - } - -// @Override -// public void output(Class channel, Object signal) { -// talk=1; -// } - -} +package nars.gui.output; + +import automenta.vivisect.face.HumanoidFacePanel; +import nars.main.NAR; +import nars.main.Parameters; + + + +public class NARFacePanel extends HumanoidFacePanel { + private final NAR nar; + + public NARFacePanel(NAR n) { + super(); + this.nar = n; + } + + @Override + protected void onShowing(boolean showing) { + super.onShowing(showing); + +// if (showing) { +// nar.addOutput(this); +// } +// else { +// nar.removeOutput(this); +// } + } + + + @Override + public void update(double t) { + happy = nar.memory.emotion.happy() > Parameters.HAPPY_EVENT_HIGHER_THRESHOLD; + unhappy = nar.memory.emotion.happy() < Parameters.HAPPY_EVENT_LOWER_THRESHOLD; + float conceptPriority = 0.5f; //((Number)nar.memory.logic.get("concept.priority.mean")).floatValue(); + float taskNewPriority = 0.5f; //((Number)nar.memory.logic.get("task.new.priority.mean")).floatValue(); + + //max out at 0.5 + conceptPriority = Math.min(conceptPriority, 0.4f); + //if (nar.memory.getConcepts().isEmpty()) + conceptPriority = 0; //if no concepts, start at zero, regardless of what mean might be valued + + face.setPupil(12f * (conceptPriority+0.35f)+2f, + taskNewPriority*taskNewPriority*0.45f,0,0,0.9f); //pupils glow a little red for priority of new tasks + + face.setEyeball(8f * (conceptPriority + 0.35f)+12f,1f,1f,1f,0.85f); + super.update(t); + } + +// @Override +// public void output(Class channel, Object signal) { +// talk=1; +// } + +} diff --git a/nars_gui/nars/gui/output/PluginPanel.java b/nars_gui/nars/gui/output/PluginPanel.java index 663698fe741e93a45a2aa0a311f75476f5395842..e3cb0c99313ed45738a214542fbab6e838d1d97d 100644 --- a/nars_gui/nars/gui/output/PluginPanel.java +++ b/nars_gui/nars/gui/output/PluginPanel.java @@ -72,6 +72,9 @@ public class PluginPanel extends VerticalPanel { continue; String[] p = c.getPackage().getName().split("\\."); + if(p.length < 3) { + continue; + } String category = p[2]; JMenu j = menus.get(category); if (j == null) {