Giter Site home page Giter Site logo

lightjason / java-agentspeak Goto Github PK

View Code? Open in Web Editor NEW
23.0 7.0 6.0 19.02 MB

LightJason - AgentSpeak(L++) for Java

Home Page: https://agentspeak-java.lightjason.org

License: Other

Java 96.11% CSS 1.63% XSLT 0.49% ASL 1.77%
java antlr antlr-grammar antlr4 bdi agentspeak agent-based-modeling concurency beliefs parallel

java-agentspeak's Introduction

Project Description and Documentation

This repository is used for publication of additional content of the LightJason project

Usage & Tools

Bibliographie

The bibliographie is stored under static/references.bib as an UTF-8 encoded Bibtex file, convert after changes the Bibtex file into a BibJSON file with

pandoc-citeproc --bib2json static/references.bib > static/references.json

Additional Feature

  • if you add a key with name URL to the Bibtex entry the URL can point to of the PDF file, and will create a download link on the publication list
  • if you add a key with name Note you can reference a comment file e.g. the key-value named foo a file under content/publications/foo.md must existst with any additional comments of the reference

Deployment

The deployment will run automatically on a git push to the developing-Branch

Prim.js configuration

For code hightlighting the JavaScript component Prism.js is used with the following definition:

Languages Plugins
Markup, C-like, Bash, C, Git, Java, Prolog, Yaml Line Hightlight, Line Number, Command Line, Show Language, Toolbar, Copy to Clipboard

Content ToDo's

  • Maven to Eclipse & IntelliJ Web-Video (importing projects into IDE)
  • ASL Tutorial (Syntax & Semantic Example) with some tricks
  • Tutorial Agent-Configuration & -Generatoren
  • Agent-Tutorial (Workflow from an idea to code)
    1. Problem description
    2. Problem splitting into distributed and task-orientated solving
    3. Agent-code developing
    4. Java-code developing - creating a logic-based event-handler with -listener
  • Choice-Behaviour
    1. Fitness proportionate selection (Linear & Gibbs-Boltzmann)
    2. CES-function
    3. PCA
    4. Plan execution based on the data
  • Simulation-Tutorial
    1. LibGDX with sprites & tilemaps
    2. scenario configuration with YAML
    3. Grid / Graph structure
    4. Perceiving environment
    5. Interaction between agents
  • REST-API
    1. Java Webserver (here Jetty)
    2. Servlet Structure
    3. Agent-Inspector
    4. Agent-Access via REST
    5. UI with jQuery / Angular.JS
  • Video-Screencast
    • import IntelliJ pom.xml
    • import Eclipse pom.xml

java-agentspeak's People

Contributors

fatema080136 avatar flashpixx avatar masc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-agentspeak's Issues

Many general exceptions

There are many places in the code that throw too general exceptions, for example IBaseAgentGenerator throws an Exception in the constructor. These should be better named, maybe with some exception hierarchy (eg LJException -> ParsingException -> InvalidCharacterException or something like that)

On-Demand Action / Lambda Loader

For reducing memory consumption of loaded actions a cache structure is needed.
So the agent / planbundle generator must be extend by a dynamic structure which can store all actions / lambda structures or load it on-demand by accessing packages

Support for Java 11

According to http://www.oracle.com/technetwork/java/javase/eol-135779.html

  • Java 8 will EOL in January 2019
  • Java 9 is EOL as of March 2018
  • Java 10 is currently the latest supported release, but will EOL in September 2018
  • Java 11 will be the next LTS release in September 2018

LightJason should complete the transition from Java 8 to 11 by September 2018, with a grace period until January 2019 when Java 8 EOLs.

lambda expression

add lambda expression with fixed ranges e.g. current

(L) ->

and L must be a collection, but these should be possible

(1,2) ->

or

(S,E) ->

in Sprint-Boot context actionsFromPackage does not work

Within a Spring-Boot context the package reading does not work, it returns an empty stream. The problem seems to be the ClassPath.from call because it cannot deal with inner jar files in a fat Spring-Boot jar file. It must replaced by an own class loader structure

remove annotation

at the moment annotations on beliefs are not necessary, for performance issue and code structure annotations can be removed, because all information can be handled by the literal values

inline expression evaluation

Add an inline expression evaluation eg for generic/print(11 + 2) the current version shows as result 11 + 2, but don't evaluate it, same problem on actions e.g. vehicle/decelerate(11/2)

But this behaviour breaks with the construction of a logical programming language like Prolog, so the idea is that the evaluation is evaluate bevor the action call is run and if the evaluation fails, the action fails also

multiple fuzzy return arguments

modify return arguments of execution method (https://github.com/LightJason/AgentSpeak/blob/master/src/main/java/org/lightjason/agentspeak/language/execution/IExecution.java#L52) for a strict multi-valued logic, e.g.

enum EReturn implements IFuzzyValue<Boolean>
{
    TRUE(true, 1), FALSE(false, 1);

     private final boolean m_value;
     private final double m_fuzzy;

     EReturn( final boolean p_value, final double p_fuzzy )
     {
          m_value = p_value;
          m_fuzzy = p_fuzzy;
     }
    
     @Override
     public final value()
     {
         return m_value;
     }

    @Override
    public final fuzzy()
    {
         return m_fuzzy;
    }
}

interface IExecution
{
    Stream<IFuzzyValue<Boolean>> execute( final boolean p_parallel, @Nonnull final IContext p_context,
                                  @Nonnull final List<ITerm> p_argument, @Nonnull final List<ITerm> p_return
    );
}

Create some supplier to generate elements for the builtin actions and add the fuzzy structure as generic to all other classes

Agents store Triggers by hashCode and drop them on hash collision

When a trigger is added to an agent (and saved for execution in the next cycle), this is done in a Map with the trigger's hashCode as key. If there already is a trigger with the same hashCode, the second (and third, ...) trigger will not be saved and executed, but rather silently dropped. It seems reasonable to suppress duplicate triggers, but hashCode is not generally safe from collisions; two actually different trigger objects might return the same hashCode.

https://github.com/LightJason/AgentSpeak/blob/93971f0356be3f42ef467437b51fec1e3e3a1265/src/main/java/org/lightjason/agentspeak/agent/IBaseAgent.java#L353

Although actual occurrences of this being a problem will probably be rare, wouldn't it make more sense to use a HashSet or similar instead of a Map, or was this design chosen on purpose?

hierarchical plan database

Reorganize plans and rules, so that they can create a hierarchical structure e.g.

+!foo/bar(X) : X > 5 <- generic/print("larger than five").
+!foo(X) <- generic/print("master plan").

On triggering +!foo/bar(10) it shows larger than five on !foo(3) the deeper plan foo/bar is not acceptable so it searches a plan on step higher and this matches to +!foo(X) so it returns master plan.

Add shortcut methods for triggers

I see a lot of examples have code like

this.trigger( CTrigger.from( ITrigger.EType.ADDGOAL, CLiteral.from( "vehicle/collision" ) ) );

Can it be simplified to something like

this.addGoal("vehicle/collision");

(eg add new method to IBaseAgent)

unification in plan-trigger fails

The unification within the plan-trigger with two variables:

+!foo( bar(X), anyother(Y) <- 

seems to be fail, within manual call

+!otherplan <-
      [H|T] = agent/belieflist();
      >>( abelief( inner1(X), inner2(Y), H  )
.

it will work.

Neo4j support

add support for Neo4j access with converting internal graph data vice versa to Neo4j database

belief trigger missing

multiple trigger call are not executed e.g.

+foo(1)
+foo(2)

will execute +foo(2) only, seems to be a problem inside the trigger generating structure of beliefbase, bust must be in detail validated by a test-case

expression calculation and syntax fails

The expression Res = 11 / 2 + 10 / 2 will calculate a wrong result, wrong 1.5714285714285714, correct 10.5

and on the expression Res = (11 + 10) / 2 the syntax (parser) fails

Amazon Alexa support

Add actions for Amazon Alexa speech recognition , so that the speech will translate in a literal and a literal back to speech. A literal to sentence structure must be appended e.g. speech(this, is, a, car)
A java client can be found on the samples

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.