Jsoar

Pure Java implementation of the Soar cognitive architecture

Get Release View on GitHub

JSoar is a pure Java implementation of Soar. Soar is a general cognitive architecture for developing systems that exhibit intelligent behavior.

Note that JSoar is an implementation of Soar. To use it effectively, you'll still need to be able to program Soar. The Soar home page has a number of useful resources for learning Soar, in particular the Soar tutorial. Soar Soar Soar.

There are a few benefits to a pure-Java implementation of Soar:

  • Idiomatic Java API in contrast to CSoar's SWIG-generated bindings.
  • "Free" multi-language support (JRuby, Jython, Rhino (JavaScript), Groovy, Scala, Clojure, etc)
  • A codebase and tools more friendly to rapid research prototyping
  • No native libraries to deal with
  • Cleaner integration with "enterprisey" systems

Here is Soar running in a Java applet.

Here is a screenshot of the debugger in action.

Documentation

Status

ChangeLog

The port of the base 9.0.1 kernel (i.e., the code in SoarSuite/Core/SoarKernel) is complete. See the links below for more details.

System Requirements

JSoar requires Java 1.6. It uses several features of Java 1.6 that are not available in earlier versions of Java.

About the code

For the most part, JSoar is a direct port of CSoar with minimal refactoring along the way. This means that many members are public (or package private) just like the structs the classes are based upon. As an additional precaution, whenever possible members are marked as final and initialized in a constructor. Refactoring is ongoing to make the codebase more idiomatic, performant, and friendly. Also note that the public interface of JSoar, the one used by client code, is very clean and well encapsulated.

One convention followed during the port was to include a string like this in the Javadoc for each method:

rete.cpp:1011:find_goal_for_match_set_change_assertion

Although the filename and line number aren't that interesting, the method name is important. Preserving the original names in the comments allows us to go back later and keep track of where code went when moved from C to Java.

Links

Related Work

Acknowledgements / History

JSoar was originally envisioned and implemented by Dave Ray (@daveray) (and indeed, the vast majority of the code is still Dave's). JSoar started out on googlecode in svn, was converted to mercurial and then git, and then moved to Dave's github site. Today JSoar is primarily maintained by Soar Technology, Inc.