Code Monkey home page Code Monkey logo

Comments (5)

alank64 avatar alank64 commented on May 24, 2024

Just to be more specific, we don't resolve to a true/false on running a number of rules, rather we have the option of true/false, as before (let's keep this backward compatibility) but also accept the outcome within a weight or score on success/failed events or conditions. Including options down the road to have deviation or range based on operators. That is if you define a range of lat/lon, should we not have an operator that gives back a weight (if defined) based on 5km or 20km difference?

That is Json-rules-engine would return in higher order the 5km then the 20km, or a result by priority.

Questions and input required, do we implement this a layer above or is json-rules-engine users interesting in adding these extra features.

from json-rules-engine.

CacheControl avatar CacheControl commented on May 24, 2024

Building weights or scores into the engine would only be used by a small subset of implementations, and json-rules-engine is meant to be as general-purpose as possible. I agree with your suggestion that this is best suited as an extension of json-rules-engine, in a separate package.

from json-rules-engine.

dpickett avatar dpickett commented on May 24, 2024

@alank64 did you end up extending the engine to support this or figure out a way to go about this that you liked? I have a use case for this too.

Right now I think I have two options, override the Condition class to support a weight property or manually re-traverse the successful conditions in an onSuccess callback. Though I'd prefer to do the former (so that weight tabulation is done at eval time), I'm leaning towards the latter in the interest of getting a feature out.

from json-rules-engine.

alank64 avatar alank64 commented on May 24, 2024

@dpickett this was a while ago, I might have gotten around it by adding weights in the configurations, if you want to review my old project online, and I'm curious also as to what you are doing, my skype is alank64 or search for Andrew Lank... meanwhile I'll try to bring back the old code and review.

from json-rules-engine.

dpickett avatar dpickett commented on May 24, 2024

I similarly ended up working around it. I added a weight property to the rule and then had to write a routine that recursively traverses the conditions in an onSuccess hook. It works decently but I filed #216 in the hopes that I can more efficiently get the ruleResult after a run.

from json-rules-engine.

Related Issues (20)

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.