Configuration framework that allow definition of calculations that use Java methods?

There need to be config files for specifying predicates that agents in a multi-agent model take into consideration when making decisions. Requirements: Users can specify boolean expressions and users can use a set of non-static methods defined in Java in their predicate definitions. e.g. like this (XML notation just used as an example):

<AgentConfigurations>
    <Agent Name="ExampleAgentConfig1">
        <Predicates>
            <Predicate Name="ThereIsAFullMoon">FullMoon("18/06/1987")</Predicate>
            <Predicate Name="DayNotTheFifth">5 != Today()</Predicate>
        </Predicates>
    </Agent>
</AgentConfigurations>

If I code this functionality myself, the method calling could be done using reflection but some parsing is required for the operators etc.

Is there a framework that could help with this?

Many thanks in advance, Thomas

Answers


Here are a few suggestions:


Consider using a "scripting" language like Groovy, JRuby, Scala, Rhino (even BeanShell), etc. They're great for "internal" DSLs and can remain very human-readable.

Alternatively, the stored expressions could be evaluated against a given context (like an object, or deeper structure) using any of several expression languages (ELs) like MVEL, OGNL, and so on.

Once they start getting complicated or have deep relationships between each other, you're better off with a rules engine like Drools or Jess.

You can do some very interesting things by pulling in rule definitions from a database, too, including live system updating (hopefully from a vetted test system).


Need Your Help

Why does nvcc fails to compile a CUDA file with boost::spirit?

c++ boost cuda boost-spirit nvcc

I'm trying to integrate CUDA to an existing aplication wich uses boost::spirit.

Double quotations inside parameters

javascript jquery html5 quotations

Trying to programatically add links inside of a table.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.