Skip to content

Commit

Permalink
Merge pull request #69 from opennars/dev_v3.0.1
Browse files Browse the repository at this point in the history
Dev v3.0.1
  • Loading branch information
patham9 authored Dec 29, 2018
2 parents 668b318 + a6ae538 commit 3ee27f2
Show file tree
Hide file tree
Showing 109 changed files with 23 additions and 21 deletions.
Empty file modified .cz-config.js
100644 → 100755
Empty file.
Empty file modified .cz.json
100644 → 100755
Empty file.
Empty file modified .editorconfig
100644 → 100755
Empty file.
Empty file modified .gitattributes
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .travis.yml
100644 → 100755
Empty file.
Empty file modified .travis/settings.xml
100644 → 100755
Empty file.
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
Empty file modified CODE_OF_CONDUCT.md
100644 → 100755
Empty file.
Empty file modified CONTRIBUTING.md
100644 → 100755
Empty file.
Empty file modified CONTRIBUTORS.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified NOTICE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions pom.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.opennars</groupId>
<artifactId>opennars-lab</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
Expand Down Expand Up @@ -118,12 +118,12 @@
<dependency>
<groupId>org.opennars</groupId>
<artifactId>opennars</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.opennars</groupId>
<artifactId>opennars-gui</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.encog</groupId>
Expand Down
Empty file modified src/main/java/org/opennars/lab/codegen/codegenML1.nal
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/main/java/org/opennars/lab/grid2d/gui/EditorPanel.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void run() {
}
}
for(TaskLink T : toDelete) {
c.taskLinks.take(T);
c.taskLinks.pickOut(T);
}
}
}
Expand Down
Empty file modified src/main/java/org/opennars/lab/grid2d/main/Action.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/Cell.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/CellFunction.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/CellState.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/Effect.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/Grid2DSpace.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/GridAgent.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/GridObject.java
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion src/main/java/org/opennars/lab/grid2d/main/Hauto.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package org.opennars.lab.grid2d.main;

import java.util.Random;
import org.opennars.main.Nar;
import org.opennars.storage.Memory;
import org.opennars.lab.grid2d.main.Cell.Logic;
Expand Down Expand Up @@ -50,6 +51,7 @@ public static int doornumber(Cell c) {
public boolean bridge(Logic c) {
return c == Logic.UNCERTAINBRIDGE || c == Logic.BRIDGE;
}
Random rnd = new Random(42);

//put to beginning because we will need this one most often
public void ExecutionFunction(int t,int i,int j,Cell w,Cell r,Cell left,Cell right,Cell up,
Expand Down Expand Up @@ -142,7 +144,7 @@ public void ExecutionFunction(int t,int i,int j,Cell w,Cell r,Cell left,Cell rig
w.value=(up.charge==1 ^ down.charge==1) ? 1.0f : 0.0f; //eval state from input connections

//ADD BIDIRECTIONAL LOGIC BRIDGE TO OVERCOME 2D TOPOLOGY
if(r.logic==BRIDGE || (r.logic==UNCERTAINBRIDGE && Memory.randomNumber.nextDouble()>0.5))
if(r.logic==BRIDGE || (r.logic==UNCERTAINBRIDGE && rnd.nextDouble()>0.5))
{
if(left.chargeFront && left.logic==WIRE)
w.value=left.charge;
Expand Down
Empty file modified src/main/java/org/opennars/lab/grid2d/main/LocalGridObject.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/RayVision.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/SimplexNoise.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/main/TestChamber.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/map/Cave.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/map/Dungeon.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/map/Maze.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/object/Door.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/object/Key.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/object/Pizza.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/operator/Activate.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/operator/Deactivate.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/operator/Goto.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/grid2d/operator/Pick.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/language/LanguageGUI.form
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/main/java/org/opennars/lab/language/LanguageGUI.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
ans.off();
}
languageNAR.reset();
Memory.randomNumber.setSeed(seed);
languageNAR.memory.randomNumber.setSeed(seed);
seed++;

try {
Expand Down
Empty file modified src/main/java/org/opennars/lab/launcher/Launcher.form
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/launcher/Launcher.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/launcher/NARGame.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/lazyminer/LazyMiner.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/lazyminer/Main.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/lazyminer/PatientSimulator.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/microworld/Pong.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/microworld/PongComplex.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/microworld/SimNAR.java
100644 → 100755
Empty file.
Empty file.
Empty file modified src/main/java/org/opennars/lab/nalnet/NALNetEditor.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/nalnet/NALNetwork.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/operator/MathExpression.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/plugin/app/farg/Codelet.java
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions src/main/java/org/opennars/lab/plugin/app/farg/FluidAnalogiesAgents.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.opennars.main.Nar;
import org.opennars.plugin.Plugin;
import org.opennars.language.Term;
import org.opennars.storage.LevelBag;
import org.opennars.storage.Bag;

/**
*
Expand All @@ -32,7 +32,7 @@ public class FluidAnalogiesAgents implements Plugin {
public int max_codelets=100;
public int codelet_level=100;
Workspace ws;
LevelBag<Codelet,Term> coderack;
Bag<Codelet,Term> coderack;

@Override
public boolean setEnabled(Nar n, boolean enabled) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/opennars/lab/plugin/app/farg/Workspace.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.opennars.io.events.Events.CycleEnd;
import org.opennars.main.Nar;
import org.opennars.entity.Concept;
import org.opennars.storage.LevelBag;
import org.opennars.storage.Bag;

/**
*
Expand All @@ -38,13 +38,13 @@ public class Workspace {
public Workspace(FluidAnalogiesAgents farg, Nar nar) {
this.nar=nar;
Workspace ws=this;
farg.coderack=new LevelBag(farg.codelet_level,farg.max_codelets, nar.narParameters);
farg.coderack=new Bag(farg.codelet_level,farg.max_codelets, nar.narParameters);
nar.on(CycleEnd.class, new EventObserver() {

@Override
public void event(Class event, Object[] args) {
for(int i=0;i<10;i++) { //process 10 codelets in each step
Codelet cod=farg.coderack.takeNext();
Codelet cod=farg.coderack.takeOut();
if(cod!=null) {
if(cod.run(ws)) {
farg.coderack.putIn(cod);
Expand Down
Empty file.
4 changes: 2 additions & 2 deletions src/main/java/org/opennars/lab/plugin/mental/GlobalAnticipation.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void temporalPredictionsAdapt(DerivationContext nal) {

//handling of other events, seeing if they match and are right in time

if(!Variables.hasSubstitute(Symbols.VAR_INDEPENDENT, args[i], lastEvents.get(i-off).sentence.term)) { //it didnt match, instead sth different unexpected happened
if(!Variables.hasSubstitute(nal.memory.randomNumber, Symbols.VAR_INDEPENDENT, args[i], lastEvents.get(i-off).sentence.term)) { //it didnt match, instead sth different unexpected happened
matched=false; //whether intermediate events should be tolerated or not was a important question when considering this,
break; //if it should be allowed, the sequential match does not matter only if the events come like predicted.
} else { //however I decided that sequence matters also for now, because then the more accurate hypothesis wins.
Expand Down Expand Up @@ -193,7 +193,7 @@ public void temporalPredictionsAdapt(DerivationContext nal) {
long occurence=lastEvents.get(args.length-off).sentence.getOccurenceTime();
boolean right_in_time=Math.abs(occurence-expected_time)<((double)duration)/TEMPORAL_PREDICTION_FEEDBACK_ACCURACY_DIV;

if(right_in_time && Variables.hasSubstitute(Symbols.VAR_INDEPENDENT,imp.getPredicate(),lastEvents.get(args.length-off).sentence.term)) { //it matched and same consequence, so positive evidence
if(right_in_time && Variables.hasSubstitute(nal.memory.randomNumber, Symbols.VAR_INDEPENDENT,imp.getPredicate(),lastEvents.get(args.length-off).sentence.term)) { //it matched and same consequence, so positive evidence
//c.sentence.truth=TruthFunctions.revision(c.sentence.truth, new TruthValue(1.0f,Parameters.DEFAULT_JUDGMENT_CONFIDENCE));
Sentence s2=new Sentence(
c.sentence.term.clone(),
Expand Down
Empty file modified src/main/java/org/opennars/lab/predict/Predict_NARS_Core.java
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified src/main/java/org/opennars/lab/tictactoe/GridButtonPanel.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/tictactoe/TicTacToe.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/vision/ConcatVisionChannel.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/vision/RasterHierachy.java
100644 → 100755
Empty file.
16 changes: 8 additions & 8 deletions src/main/java/org/opennars/lab/vision/SpatialSamplingVisionChannel.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.opennars.interfaces.Timable;
import org.opennars.plugin.perception.SensoryChannel;
import org.opennars.language.Term;
import org.opennars.storage.LevelBag;
import org.opennars.storage.Bag;
import org.opennars.storage.Memory;

public class SpatialSamplingVisionChannel extends SensoryChannel {
Expand All @@ -33,17 +33,17 @@ public class Position {
public int Y;
}

LevelBag<Task<Term>,Sentence<Term>>[][] spatialbag;
Bag<Task<Term>,Sentence<Term>>[][] spatialbag;
public SpatialSamplingVisionChannel(Nar nar, SensoryChannel reportResultsTo, int width, int height) {
super(nar,reportResultsTo, width, height, -1, new Term("BRIGHT"));
spatialbag = new LevelBag[height][width];
spatialbag = new Bag[height][width];
}

public void AddToSpatialBag(Task t) {
int x = t.getTerm().term_indices[2];
int y = t.getTerm().term_indices[3];
if(spatialbag[y][x] == null) {
spatialbag[y][x] = new LevelBag(100, 100, this.nar.narParameters);
spatialbag[y][x] = new Bag(100, 100, this.nar.narParameters);
}
t.incPriority((float) this.topDownPriority(t.getTerm()));
spatialbag[y][x].putIn(t);
Expand All @@ -67,17 +67,17 @@ public Nar addInput(final Task t, final Timable time) {
@Override
public void step_start(final Timable time)
{
int ind = Memory.randomNumber.nextInt(sampling.size());
int ind = nar.memory.randomNumber.nextInt(sampling.size());
Position samplePos = sampling.get(ind);
Task sampled = spatialbag[samplePos.Y][samplePos.X].takeNext();
Task sampled = spatialbag[samplePos.Y][samplePos.X].takeOut();
//Todo improve API, channel should not need to know where in the array x and y size is

//spatial biased random sampling:
int ind2 = Memory.randomNumber.nextInt(sampling.size());
int ind2 = nar.memory.randomNumber.nextInt(sampling.size());
int s2posY = sampling.get(ind2).Y;
int s2posX = sampling.get(ind2).X;
if(spatialbag[s2posY][s2posX] != null) {
Task sampled2 = spatialbag[s2posY][s2posX].takeNext();
Task sampled2 = spatialbag[s2posY][s2posX].takeOut();
if(sampled2 != null) {
//improve API, carrying out temporal inference should be easier..
List<Task> seq = proceedWithTemporalInduction(sampled.sentence, sampled2.sentence, sampled2,
Expand Down
Empty file modified src/main/java/org/opennars/lab/vision/SymRecognizer.form
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/lab/vision/SymRecognizer.java
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified src/main/java/org/opennars/util/io/ChangedTextInput.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/util/io/ExampleFileInput.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/util/io/KeyboardInputExample.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/util/test/ConceptMonitor.java
100644 → 100755
Empty file.
Empty file modified src/main/java/org/opennars/util/test/OutputCondition.java
100644 → 100755
Empty file.
Empty file.
Empty file modified src/main/java/org/opennars/util/test/OutputEmptyCondition.java
100644 → 100755
Empty file.
Empty file.
Empty file modified src/main/java/org/opennars/util/test/TuneTuffy.java
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/and_switch_light.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/complex1.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/dont_switch.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/dont_switch2.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/ex4.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/freq_generator.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/house.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/key2.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/pizzamaschine.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/pizzeria.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/simple.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/switchX4.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/switch_door_switch_light.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/uncertain_event.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/grid2d/uncertain_state.lvl
100644 → 100755
Empty file.
Empty file modified src/main/resources/language/language_knowledge.nal
100644 → 100755
Empty file.
Empty file modified src/main/resources/launcher/microworld.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/launcher/nlp.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/launcher/opennars_logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/launcher/pong.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/launcher/predict.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/launcher/rover.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/launcher/testchamber.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/microworld/agent.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/microworld/ball.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/microworld/bar.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/microworld/fire.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/main/resources/microworld/food.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3ee27f2

Please sign in to comment.