Skip to content

NodeJS package for using CLIPS, a tool for building expert systems.

Notifications You must be signed in to change notification settings

jefferk/node-clips

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node CLIPS

NOTE This repository is not actively maintained. The package will most probably fail to compile on any recent version of NodeJS after 0.11.0

NodeJS package for using CLIPS, a tool for building expert systems.

For more information about CLIPS checkout the official documentation.

##Install npm install node-clips

Usage

###Step 1: Create a CLIPS Environment

var clips = require('node-clips');
var env = new clips.Environment();

Step 2: Initialize and Run Environment

env.initialize( function { 
  
  // Load .clp file
  env.load(__dirname+'/animal.clp', function () {

    // Reset environment and run 
    env.reset(function(){

      // Rule firing limit set to 1000
      env.run(1000, function() {
        
        // Log fact list to console           
        console.log(env.facts());

        // Dispose of the CLIPS environment and free memory
        env.dispose(function(){
  
        });
      });
    });
  });
});

##Environment Methods

###load (filename, callback) Load the constructs from the specified file into the CLIPS environment.

###save (filename, callback) Save the constructs in the current environment to a file.

###bload (filename, callback) Load the constructs from the specified binary file into the CLIPS environment. This is considerably faster than a simple load due to the time saved on parsing the constructs.

###bsave (filename, callback) Save the constructs in the current environment to a binary file.

###eval (expression, callback) Evaluate the expression as if it was entered into the CLIPS command line. The eval function cannot be used to define constructs. To define constructs use the build function.

###build (expression, callback) Evaluates the expression as if it was entered into the CLIPS command line. Can be used to define any CLIPS constructs .

###reset (callback) Reset the CLIPS environment.

###run (callback) Allows rules to execute.

###clear (callback)

Clears the current CLIPS environment of all constructs.

###assert (fact, callback)

Assert a fact into CLIPS.

###facts (callback)

Get a list of facts.

##License The MIT License

Copyright(c) 2013-2014, Playlyfe Technologies, [email protected], http://dev.playlyfe.com/

About

NodeJS package for using CLIPS, a tool for building expert systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 97.8%
  • CLIPS 1.1%
  • Other 1.1%