Search in sources :

Example 1 with NWindow

use of automenta.vivisect.swing.NWindow in project narchy by automenta.

the class RunEnv method main.

public static void main(String[] args) throws InterruptedException {
    // RLEnvironment env = new PoleBalancing2D();
    RLEnvironment env = new Curiousbot();
    // RLEnvironment env = new Tetris(16,24);
    NWindow w = env.newWindow().show(800, 800);
    System.out.println(env.numActions() + " actions, " + env.numStates() + " states");
    int cyclesPerFrame = 15;
    int frame = 0;
    FALCON f = new FALCON(env);
    f.setTrace(false);
    f.init(AGENT.TDFALCON, true);
    while (true) {
        for (int i = 0; i < cyclesPerFrame; i++) {
            f.act(true);
            f.decay();
        }
        if (frame++ % 1000 == 0) {
            f.prune();
            f.purge();
        }
        w.repaint();
        Thread.sleep(50);
    // System.out.println(f.getNumCode());
    }
}
Also used : Curiousbot(nars.experiment.wander.Curiousbot) NWindow(automenta.vivisect.swing.NWindow) RLEnvironment(jurls.reinforcementlearning.domains.RLEnvironment) FALCON(automenta.falcon.FALCON)

Example 2 with NWindow

use of automenta.vivisect.swing.NWindow in project opennars by opennars.

the class BagFairness method main.

public static void main(String[] args) {
    Parameters.DEBUG = true;
    int inputs = 100;
    int maxConcepts = 1000;
    float inputRate = 0.2f;
    int displayedIterations = 600;
    int numIterations = 600;
    float minPri = 0.1f;
    float maxPri = 1.0f;
    new NWindow("_", new MultiTimeline(1, 1, 1) {

        @Override
        public Chart[] getCharts(int experiment) {
            final NAR n = new NAR();
            ArrayList<Chart> ch = new BagFairness(n, "nal/Examples/Example-MultiStep-edited.txt", maxConcepts, /* concepts */
            numIterations - displayedIterations, numIterations).charts;
            return ch.toArray(new Chart[ch.size()]);
        }
    }).show(1200, 900, true);
}
Also used : NWindow(automenta.vivisect.swing.NWindow) MultiTimeline(automenta.vivisect.timeline.MultiTimeline) StackedPercentageChart(automenta.vivisect.timeline.StackedPercentageChart) LineChart(automenta.vivisect.timeline.LineChart) Chart(automenta.vivisect.timeline.Chart) NAR(nars.main.NAR)

Example 3 with NWindow

use of automenta.vivisect.swing.NWindow in project opennars by opennars.

the class HumanoidFacePanel method main.

public static void main(String[] arg) {
    HumanoidFacePanel f = new HumanoidFacePanel();
    NWindow w = new NWindow("Face", f);
    w.setSize(250, 400);
    w.setVisible(true);
}
Also used : NWindow(automenta.vivisect.swing.NWindow)

Example 4 with NWindow

use of automenta.vivisect.swing.NWindow in project opennars by opennars.

the class DockDemo method main.

public static void main(String[] args) {
    NWindow w = new NWindow("Dock Test", new DockDemo());
    w.setSize(640, 480);
    w.setVisible(true);
    w.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
Also used : NWindow(automenta.vivisect.swing.NWindow)

Example 5 with NWindow

use of automenta.vivisect.swing.NWindow in project opennars by opennars.

the class KeyboardInputExample method main.

public static void main(String[] args) {
    // NAR n = NAR.build(new Neuromorphic().realTime());
    // NAR n = NAR.build(new Default().realTime());
    // n.param.duration.set(100);
    NARSwing.themeInvert();
    NAR n = new NAR();
    new NARSwing(n).themeInvert();
    new NWindow("Direct Keyboard Input", new KeyboardInputPanel(n)).show(300, 100, false);
    n.start(100);
}
Also used : KeyboardInputPanel(nars.gui.input.KeyboardInputPanel) NARSwing(nars.gui.NARSwing) NWindow(automenta.vivisect.swing.NWindow) NAR(nars.main.NAR)

Aggregations

NWindow (automenta.vivisect.swing.NWindow)17 PCanvas (automenta.vivisect.swing.PCanvas)7 LineChart (automenta.vivisect.timeline.LineChart)6 TimelineVis (automenta.vivisect.timeline.TimelineVis)6 NAR (nars.core.NAR)5 Default (nars.model.Default)5 NARSwing (nars.gui.NARSwing)3 NARTrace (nars.util.NARTrace)3 JPanel (javax.swing.JPanel)2 Sentence (nars.entity.Sentence)2 Term (nars.language.Term)2 NAR (nars.main.NAR)2 Task (nars.nal.entity.Task)2 Term (nars.nal.language.Term)2 FALCON (automenta.falcon.FALCON)1 TreeMLData (automenta.vivisect.TreeMLData)1 AwesomeButton (automenta.vivisect.swing.AwesomeButton)1 NSlider (automenta.vivisect.swing.NSlider)1 Chart (automenta.vivisect.timeline.Chart)1 MultiTimeline (automenta.vivisect.timeline.MultiTimeline)1