formix / infernal-engine Goto Github PK
View Code? Open in Web Editor NEWA Tool to Build NodeJS and Web Based Expert Systems
License: MIT License
A Tool to Build NodeJS and Web Based Expert Systems
License: MIT License
Give the constructor an execution time. Whenever the infer() method is called, start a timeout that will stop execution instead. Remove the "step" event completely.
Date objects cannot be compared directly. They have to be compared using Date.prototype.getTime().
Avoiding the reset when loading a model will allow loading submodels dynamically in the current engine.
The load
method will take one object as a parameter named model
.
Within that object:
Find a way to avoid error when loading a model.
This method shall return an object graph containing the facts that changed during the last inference call.
This is a proposed structure for a change entry:
{
"rule": "/rule/full/name",
"fact": "/fact/full/name",
"oldValue": 5,
"newValue": 12.5
}
When calling the "done" callback, the first parameter should be an error. The can be anything to be emitted as an event.
Within a rule, the this keyword shall be set to a proxy to be able to build the fact context using the following syntax:
this.$ refers to the root context.
this._ refers to the parent context.
this._ctx returns the current context name. Ex.: "/engine/cylinders" for a rule named "/engine/cylinders/validateSize".
this.name returns the current rule name. Ex: "/engine/cylinders/validateSize".
this.whatever gets or sets the value of the whatever fact in the current context.
this.child.grandchild gets or sets the value of the grandchild fact from the current context's child.
Example 1: if a rule is in the "/engine/cylinders" context, doing this..torque allows to get or set the "/engine/torque" fact.
Example 2: from the same rule in the "/engine/cylinders" context, doing this.$.engine.torque would do the same as above.
Some changes are not caught by the set
method. For example, modifying an array content do not require that the set method being called. The notify method shall let the programmer inform that such a change happened.
This method could be used to reevaluate rules related to the given fact.
Model example:
let model = {
sum : {
a : 0,
b : 0,
result : 0,
execute : (next, a, b) => { // defaults to local facts
let r = a + b;
return next(null, { "result" : r });
}
},
mult: {
a : 0,
b : 0,
result : 0,
execute : (next, a, b) => {
let r = a * b;
return next(null, {"result" : r});
}
},
finalResult: 0,
computeFinalResult: (next, /*@ /mult/result */ mult, /*@ /sum/result */ sum) => {
r = mult - sum;
return next(null, {"/finalResult" : r});
}
}
Loading the model should keep the Array type as is.
the second callback parameter should be the changed facts map. The map contains the fact full name and its new value. Ex:
{
"/department/name": "Sales"
}
I don't see any current updates to this project so I am curious if it is OK for me to use if for an Ionic Framework mobile application?
Stop inference, cleanup the agenda and call the caller's callback with error details.
The current pattern works with most lambda except when the lambda has only one parameter. The rule parsing logic should branch if it detects a fat arrow or not and use a specific regex to parse parameters in each case.
This is a sample of what the getFacts() returned:
{
"modelName": "Shimano",
"size": {
"value": "Small",
"options": {
"0": "",
"1": "Small",
"2": "Medium",
"3": "Large"
}
},
"title": "Small Shimano"
}
Arrays shall not be changed to object.
This trace method will give the programmer the possibility to log information during inference execution. This method shall receive the message to be traced.
some of the object's variables should be private:
This looks great and like it should solve my problem, if I can work out how to use it.
But I am having difficulty working that out.
Problem:
expert query system to ask questions and get responses and determine final set of parameters to make an object.
E.g. Rules:
How do I wrap this so I can ask a Q, then work out which Q to ask next ?
and so on - so I always have a correct and valid state ?
And have I omitted to ask you something that needs to be asked in order to do this ?
When a rule is added to the agenda, a trace notification should be sent. The action could be named updateAgenda with the rule name as the rule field.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.