Clojure RETE implementation for frames
Test | CLIPS v 6.24 (msec) | rete4frames v 5.3.0 (msec) | |
manners8 | 1.316599 | 82 | x 61 |
manners16 | 18 | 247 | x 14 |
manners32 | 272 | 1427 | x 5 |
manners64 | 8939 | 9635 | x 1.1 |
manners128 | 324396 | 88690 | x 0.27 |
Test results obtained on the same hardware and OS 7 october 2016. As can be seen from the results, rete4frames initially far behind and then starts to catch up CLIPS. On the most difficult test rete4frames almost 4 times faster than CLIPS.
Leiningen dependency information:
[rete "5.3.1-SNAPSHOT"]
Maven dependency information:
<dependency>
<groupId>rete</groupId>
<artifactId>rete</artifactId>
<version>5.3.1-SNAPSHOT</version>
</dependency>
To get the Manners Benchmark results run in REPL:
(require 'rete.core)
(in-ns 'rete.core)
(app "run" "examples/manners.clj" "examples/manners_f8.clj")
The benchmark table for Waltz algorithm is in [Waltz Benchmark Table] (https://github.com/rururu/rete4frames/blob/master/doc/waltz_benchmark.md)
Running examples:
(require 'rete.core)
(in-ns 'rete.core)
(app "run" "examples/mab.clj") ;; Monkey and bananas..
(app "run" "examples/zebra.clj") ;; Who drinks water, who owns zebra..
(app "run" "examples/auto.clj") ;; Automotive Expert System..
(app "run" "examples/sudoku/sudoku.clj" "examples/sudoku/grid3x3-p1.clj") ;; Game "Sudoku"
(app "run" "examples/hypertension.clj") ;; Doctor's expert system
Today: 19.2.2015..
What will do? [reception analyse end]
reception
What is a name of a next patient? (no-patients)
"Alice"
Patient: Alice, age: 70, race: nonblack
Last blood pressure values: systolic: 140, diastolic: 90, date: 18.2.2015
Well, Alice, let's measure your current blood pressure..
What are blood pressure values now? [systolic diastolic]
[140 90]
Good, Alice.
Continue prescribed medication.
Waiting for you after 18.3.2015, if all is well.
Good bye.
What is a name of a next patient? (no-patients)
...
Yet another example: "Real" air traffic control system - client-server ClojureScript-Clojure application based on "Flightradar24" web service (http://www.flightradar24.com/), "Leaflet" JavaScript libraty (http://leafletjs.com/), httpkit, compojure, core.async and others Clojure libraries. This example is in a separate repository https://github.com/rururu/rete4flights.
And one more: es-boat - a prototype of an expert system for coastal navigation. It uses [Protege-3.5 ontology editor] (http://protege.stanford.edu/) as a knowledge representation system and server-side GUI, [OpenStreetMap] (https://wiki.openstreetmap.org/wiki/API) API, Leaflet JavaScript library, [Cesium] (https://cesiumjs.org/) WebGL virtual globe and map engine, [GeoNames] (http://www.geonames.org/) geographical database and Wikipedia. Link to this prpject: https://github.com/rururu/es-boat
How to include Rete for Frames into your Java programs see example [Eclipse project] (https://github.com/rururu/rete4frames/blob/master/Rete4framesEclipseTest/).
IDE based on [Protege-3.5 ontology editor] (http://protege.stanford.edu/) is in a separate repository [r4f-pro] (https://github.com/rururu/r4f-pro).
For further information see [Documentation] (https://github.com/rururu/rete4frames/blob/master/doc/intro.md)
To get this functionality in ClojureScript see [cljs-rete4f] (https://github.com/rururu/cljs-rete4f)
Copyright © 2014-2021 Ruslan Sorokin.
Licensed under the EPL (see the file epl.html). [License of Protege-3.5] (https://github.com/rururu/rete4frames/blob/master/LICENSE_PROTEGE)