use of nars.gui.NARSwing in project opennars by opennars.
the class RasterHierachy method main.
public static void main(String[] args) {
// RasterHierarchy rh = new RasterHierarchy(8, 640, 480, 12, 2);
// RasterHierarchy rh = new RasterHierarchy(3, 640, 480, 5, 2);
nar = new NAR();
nar.param.noiseLevel.set(0);
NARSwing.themeInvert();
NARSwing swing = new NARSwing(nar);
// nar.start(0);
// new RasterHierachy(3, 640, 480, 8, 3);
RasterHierachy rh = new RasterHierachy(3, 640, 480, 5, 3);
rh.process();
}
use of nars.gui.NARSwing in project opennars by opennars.
the class SupervisedRecognition method main.
public static void main(String[] args) {
HashMap<String, Integer> map = new HashMap<>();
// ONES:
map.put("oxooo" + "\n" + "xxooo" + "\n" + "oxooo" + "\n" + "oxooo" + "\n" + "oxooo" + "\n", 1);
map.put("oxxoo" + "\n" + "xoxoo" + "\n" + "ooxoo" + "\n" + "ooxoo" + "\n" + "ooxoo" + "\n", 1);
map.put("oooxo" + "\n" + "ooxxo" + "\n" + "oooxo" + "\n" + "oooxo" + "\n" + "oooxo" + "\n", 1);
map.put("oooox" + "\n" + "oooxx" + "\n" + "oooox" + "\n" + "oooox" + "\n" + "oooox" + "\n", 1);
// ZEROS:
map.put("ooooo" + "\n" + "xxxxx" + "\n" + "xooox" + "\n" + "xooox" + "\n" + "xxxxx" + "\n", 0);
map.put("xxxxx" + "\n" + "xooox" + "\n" + "xooox" + "\n" + "xooox" + "\n" + "xxxxx" + "\n", 0);
map.put("ooooo" + "\n" + "ooooo" + "\n" + "xxxxx" + "\n" + "xooox" + "\n" + "xxxxx" + "\n", 0);
map.put("ooooo" + "\n" + "oxxxx" + "\n" + "oxoox" + "\n" + "oxoox" + "\n" + "oxxxx" + "\n", 0);
map.put("ooooo" + "\n" + "xxxxx" + "\n" + "xooox" + "\n" + "xooox" + "\n" + "xxxxx" + "\n", 0);
// training phase:
NAR nar = new NAR();
NARSwing.themeInvert();
new NARSwing(nar);
nar.param.noiseLevel.set(0);
for (String example : map.keySet()) {
int solution = map.get(example);
inputExample(nar, example, solution);
nar.cycles(1000);
}
// Test phase:
inputExample(nar, "ooxoo" + "\n" + "ooxoo" + "\n" + "ooxoo" + "\n" + "ooxoo" + "\n" + "ooxoo" + "\n", -1);
try {
nar.askNow("<?what --> EXAMPLE>", new AnswerHandler() {
@Override
public void onSolution(Sentence belief) {
System.out.println(belief);
}
});
} catch (Narsese.InvalidInputException ex) {
}
nar.cycles(100000);
}
use of nars.gui.NARSwing in project opennars by opennars.
the class TestChamber method main.
public static void main(String[] args) {
// set NAR architecture parameters:
// builder...
// not that much events in testchamber anyway
Parameters.CONSIDER_NEW_OPERATION_BIAS = 1.0f;
// but many possible different ways to achieve certain things
Parameters.SEQUENCE_BAG_SIZE = 100;
NAR nar = new NAR();
nar.param.decisionThreshold.set(0.51);
// set NAR runtime parmeters:
/*for(NAR.PluginState pluginstate : nar.getPlugins()) {
if(pluginstate.plugin instanceof InternalExperience || pluginstate.plugin instanceof FullInternalExperience) {
nar.removePlugin(pluginstate);
}
}*/
// nar.addPlugin(new TemporalParticlePlanner());
// (nar.param).duration.set(10);
(nar.param).noiseLevel.set(0);
new NARSwing(nar);
new TestChamber(nar);
nar.start(narUpdatePeriod);
}
use of nars.gui.NARSwing in project opennars by opennars.
the class Launcher method jButton1ActionPerformed.
// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// GEN-FIRST:event_jButton1ActionPerformed
NARSwing sw = new NARSwing(new NAR());
this.dispose();
}
Aggregations