rete

Does JBoss Drools really execute all rules in parallel?

℡╲_俬逩灬. 提交于 2020-01-13 03:13:05
问题 I've read a lot of documentation of JBoss Drools but cannot find a definitive answer as to if all rules are executed concurrently (certainly they are fired concurrently). More specifically, for a single input and a rule set of say 1000 rules, do the "when" conditions and the "then" conditions in each rule, execute sequentially one by one, or in parallel at the same time. On the one hand the rete algorithm implies parallelism, certainly when the select nodes are collapsed. However after the

NRules: match a collection

核能气质少年 提交于 2019-12-07 22:07:22
问题 I'm trying to figure out the BRE NRules and got some examples working but having a hard time to match a collection. IEnumerable<Order> orders = null; When() .Match<IEnumerable<Order>>(o => o.Where(c => c.Cancelled).Count() >= 3) .Collect<Order>(() => orders, o => o.Cancelled); Then() .Do(ctx => orders.ToList().ForEach(o => o.DoSomething())); Basically what I want is if there are 3 orders cancelled then do some action. But I can't seem get a match on a collection, single variables do work. The

NRules: match a collection

坚强是说给别人听的谎言 提交于 2019-12-06 05:49:02
I'm trying to figure out the BRE NRules and got some examples working but having a hard time to match a collection. IEnumerable<Order> orders = null; When() .Match<IEnumerable<Order>>(o => o.Where(c => c.Cancelled).Count() >= 3) .Collect<Order>(() => orders, o => o.Cancelled); Then() .Do(ctx => orders.ToList().ForEach(o => o.DoSomething())); Basically what I want is if there are 3 orders cancelled then do some action. But I can't seem get a match on a collection, single variables do work. The program: var order3 = new Order(123458, customer, 2, 20.0); var order4 = new Order(123459, customer, 1

How to use Rete Algorithm

限于喜欢 提交于 2019-12-04 23:17:48
问题 How can i use Rete Algorithm in java? Do i need to write my own algorithm implementation? Or is there already implemented library available? 回答1: So this is a pretty old question, but ranks highly if you're googling for Rete Implementations, so I'll leave some info here. The wikipedia entry is pretty good and here is a paper about Rete/UL which is according to Doorenbos more efficient than ReteII Doorenbos, 1995. Some Implementations include: Drools for java Jess also java Wongi-Engine for

Does JBoss Drools really execute all rules in parallel?

冷暖自知 提交于 2019-12-04 07:35:53
I've read a lot of documentation of JBoss Drools but cannot find a definitive answer as to if all rules are executed concurrently (certainly they are fired concurrently). More specifically, for a single input and a rule set of say 1000 rules, do the "when" conditions and the "then" conditions in each rule, execute sequentially one by one, or in parallel at the same time. On the one hand the rete algorithm implies parallelism, certainly when the select nodes are collapsed. However after the nodes are optimized is the evaluation sequential? And the beta memory and join nodes look like they

Fast handling of rules in a simulation

走远了吗. 提交于 2019-12-04 04:55:12
问题 If you only have a few rules in a discrete event simulation this is not critical but if you have a lot of them and they can interfere with each other and you may want to track the "which" and "where" they are used. Does anybody know how to get the code below as fast as the original function? Are there better options than eval(parse(...) ? Here is an simple example which shows that I loose a factor 100 in speed . Assume you run a simulation and one (of many rules) is: Select the states with

Fast handling of rules in a simulation

隐身守侯 提交于 2019-12-02 00:07:20
If you only have a few rules in a discrete event simulation this is not critical but if you have a lot of them and they can interfere with each other and you may want to track the "which" and "where" they are used. Does anybody know how to get the code below as fast as the original function? Are there better options than eval(parse(...) ? Here is an simple example which shows that I loose a factor 100 in speed . Assume you run a simulation and one (of many rules) is: Select the states with time less 5: > a <- rnorm(100, 50, 10) > print(summary(microbenchmark::microbenchmark(a[a < 5], times =