[转贴] Drools 3.1 milestone 1 is comming

As some of you already know, Drools 3.1m1 will be out of the door any minute now. The Drools name is used for project development releases, which are also unsupported - eventually the code is hardened and released to production as JBoss Rules 3.2. This new release is a a big improvement over the 3.0.x production branch in many ways and it will be intersting to see where we will go from there.

For those curious about it, I will briefly talk about the major changes one expect to see when moving to it, from a core/compiler perspective.

Performance

After about 5-6 weeks of struggling led by Mark himself, most of the anchors slowing down JBRules 3.0 were simply left behind. By this I mean, no more internal structures for remembering matches, no more reference linking hell, no more overuse of array copies. Core was basically streamlined with a huge reduction on memory consumption and a significant performance boost. Benchmarks like manners, that stress the engine pattern matching algorithm are seeing improvements in the order of 300%, while memory comsuption is down to 20% of the original.
Does that means that 3.0 performance was bad? I would say not at all! Performance was actually good on 3.0, specially when compared with previous drools versions and other open source engines. But no big improvement was possible in the 3.1 version without breaking some paradigms we had before. And Mark did an amazing job pushing every little aspect to the limit to find exactly what we needed to change.
Does that mean real world applications will see improvements like that? Probably not in that order of magnitude, as benchmarks are designed to stress engines to its maximum, consequently generating extreme cases. Real world applications will certanly see great improvements, specially in the memory consumption side, but not in that order of magnitude. Actually I'm quite curious to test it in real use cases and see what will be the improvements.

Mark has provided a quick summary of the main enhancements:

  • Unrolled loops for constraint evaluation
  • High performance custom collections implementation
  • Tuple is now the entry, avoid Entry object creation.
  • Tuple, a wrapper for FactHandle[] during propagations, now uses a linked list as per Jess from "Implementing A High-Performance Symbolic Reasoning Engine In Java"
  • Composite key indexing for left and right memory
  • Left and right value caching for join nodes, to avoid repeated value retrieval
  • Improved alpha node hashing
  • Extensive use of Single/Composite design to avoid setting up a for loop when there is only 1 child
  • Primitive support, avoids continuous primitive wrapping

Primitive type support

As users know, JBRules 3.0 automatically wraps any primitive types he needs to work with in its respective Object Wrappers. That was a limitation that was causing 2 undesired side effects:
  1. Performance really suffers when one needs to wrap/unwrap primitives.
  2. Code using primitive wrappers is much more verbose and cluttered.
Example:
rule "return value"
when
$person1 : Person( $age1 : age )
person2 : Person( age == ( new Integer( $age1.intValue() + 2 ) ) )
then
...
end

As you can see in the above example, the rule's writer needs to be aware and keep wrapping/unwrapping primitive values to work with the engine.

JBRules 3.1m1 has now full support to primitive types, not only helping it to perform better and consume less memory but also making rules much more clear. Look at the same rule in 3.1m1:
rule "return value"
when
$person1 : Person( $age1 : age )
person2 : Person( age == ( $age1 + 2 ) )
then
...
end
It is now clear and straight forward to understand what the rule writer wanted his rule to do.

Shadow Facts support

As it is well known, JBRules uses POJO as its first and preferred fact representation structure. We design the engine targeting it to perform most efficiently on beans, as we understand that this is the most simple and productive way of integrating a rules engine in real world applications: work with user's own business objects model. Although, this kind of integration demands a carefull planing on the engine side to avoid collateral effects, as the engine do not own the beans. The application or the user can change any bean property on the fly and not notify the engine.
So it is mandatory that the engine implements some kind of control over the values being used for reasoning, keeping the whole engine state consistent. This is implemented by Shadow Facts, that are shallow copies (cache) of the bean values while reasoning over it, allowing updates only on safe points.
Shadow Facts are implemented in JBRules 3.1m1 as dynamic proxies and besides being mandatory to have from an engine perspective, they are almost invisible for the engine users. I say almost, because being dynamic proxies, there is only one requirement users need to meet: a nonarg default constructor for the classes asserted into the engine. Besides that, users don't have to worry about it. Only to know, their facts are being taken care appropriatelly. The proxy is not exposed to users, not even in consequence block.

New nodes

Evolving the engine also requires support to some new conditional expression elements. Three new CEs are included in 3.1m1, being them:

FROM: allows reasoning over facts not previously asserted into the engine. Specially useful for retrieval of facts on the fly from database tables or any other external source. Example:
rule "From"
when
$cheese : Cheese(type == "stilton" ) from cheesery.getCheeses()
then
// do stuff
end
COLLECT: allows reasoning over collections of objects from working memory. Example:
rule "Collect"
when
$cheeseList : ArrayList(size > 2) from collect( Cheese( price < 30 ) ) ;
then
// do stuff
end

ACCUMULATE: a more flexible and customizable version of Collect, allows to iterate and calculate values from a set of facts in the working memory. Example:
rule "Accumulate"
when
$person      : Person( $likes : likes )
$cheesery    : Cheesery( totalAmount > 100 )
                          from accumulate( $cheese : Cheese( type == $likes ),
                                           init( Cheesery cheesery = new Cheesery(); ),
                                           action( cheesery.addCheese( $cheese ); ),
                                           result( cheesery ) );
then
// do stuff
end
Conclusion

These are the main features you will se in this milestone from a core/compiler perspective. New milestones will bring even more news, specially related to the Rule Server under development as described in a previous post.

So, stay tunned, enjoy, and please provide us your feedback.

Edson

 

一款轻量而功能强大的点云可视化和编辑软件,支持pcd, ply, las等多种格式,轻松打开海量点云数据,支持多方式多字段渲染点云,对点进行方便的查询、量测和编辑,提供了地面滤波算法,可应用于测绘、高精地图、SLAM等领域。 PCDViewer是一款专业的点云数据处理软件,特别适用于处理和编辑大规模点云数据。该软件支持多种点云文件格式,包括pcd、ply和las等,这些格式广泛应用于激光雷达扫描数据、三维建模以及其他测绘技术。PCDViewer的强大之处在于其轻量级的系统要求与丰富的功能集,使得用户可以在Windows、Ubuntu等操作系统上轻松运行软件,高效地处理海量点云数据。 这款软件的一个主要特点是其多方式多字段渲染点云的能力。这允许用户根据不同的属性,如颜色、强度、高度等,对点云进行视觉上的分类和区分,从而更直观地分析和理解点云数据。此外,PCDViewer还提供了方便的查询、量测和编辑功能,允许用户直接对点云数据进行操作,诸如添加注释、删除噪声点或进行精确测量等,极大地提高了工作效率。 软件还内置了地面滤波算法,这一功能对于测绘学、地理信息系统(GIS)以及机器人导航和定位(SLAM)等领域尤为关键。地面滤波算法能够从点云数据中分离出地面点和非地面点,这对于如道路建模、地形分析、植被测量等应用来说至关重要。通过分离地面点,可以更准确地进行地面建模和地形特征分析,为自动化系统提供清晰的环境地图。
内容概要:本文提出了一种计及并网波动约束和储能荷电状态(SOC)的混合储能功率协调控制方法,并提供了完整的Matlab代码实现。该方法针对可再生能源并网系统中存在的功率波动问题,采用锂电池与超级电容构成的混合储能系统进行功率平抑,通过低通滤波与动态时间常数调节实现高频/低频功率分量的合理分配,同时引入SOC反馈控制机制,实时调节功率分配系数,确保各储能单元的荷电状态维持在安全范围内,避免过充过放,从而在满足并网功率波动标准的同时,延长储能系统使用寿命。文中详细阐述了控制策略的设计原理、关键参数整定方法及仿真验证过程,展示了该方法在平抑功率波动和均衡储能SOC方面的优越性能。; 适合人群:具备电力系统、新能源并网或储能控制基础知识的研究生、科研人员及从事相关领域工程开发的技术人员。; 使用场景及目标:①研究混合储能系统在平抑风电/光伏并网功率波动中的应用;②掌握基于SOC反馈的储能功率协调控制策略设计方法;③学习Matlab/Simulink在电力电子与电力系统仿真中的建模与分析技巧;④为撰写学术论文或完成科研项目提供可复现的技术方案与代码参考。; 阅读建议:建议结合Matlab代码逐行理解控制逻辑,重点关注低通滤波与SOC反馈环节的实现方式,并尝试调整参数观察系统响应变化,以深入掌握控制策略的动态特性与优化思路。
标题基于SpringBoot的校园创客空间管理系统设计与实现AI更换标题第1章引言介绍校园创客空间管理系统的研究背景、意义、现状以及论文方法与创新点。1.1研究背景与意义阐述校园创客空间管理系统在提升管理效率方面的重要性。1.2国内外研究现状分析国内外校园创客空间管理系统的研究与应用现状。1.3研究方法及创新点概述论文采用的研究方法及系统设计的创新之处。第2章相关理论介绍SpringBoot框架、数据库技术及系统开发所需的相关理论。2.1SpringBoot框架介绍介绍SpringBoot框架的核心特性及其在系统开发中的应用。2.2数据库技术阐述数据库设计原理及在管理系统中的数据存储方法。2.3系统开发相关理论介绍系统开发过程中涉及的前端技术、后端技术等。第3章系统需求分析对校园创客空间管理系统的功能需求和非功能需求进行详细分析。3.1功能需求分析列举系统所需实现的具体功能,如用户管理、空间预约等。3.2非功能需求分析分析系统的性能、安全性、易用性等非功能需求。3.3用户角色与权限分析分析系统用户角色及其对应权限,确保系统安全性。第4章系统设计详细介绍校园创客空间管理系统的设计方案,包括架构、模块及数据库设计。4.1系统架构设计给出系统的整体架构,包括前端、后端及数据库的连接方式。4.2系统模块设计详细介绍各个模块的功能设计及其交互方式。4.3数据库设计阐述数据库表结构设计、字段定义及关系建立。第5章系统实现介绍校园创客空间管理系统的具体实现过程,包括环境搭建、编码实现及测试。5.1系统开发环境搭建介绍系统开发所需的软件、硬件环境及配置步骤。5.2系统编码实现阐述系统各个模块的编码实现过程及关键代码解析。5.3系统测试与优化介绍系统测试方法、测试用例及测试结果,以及针对测试结果的优化措施。第6章结论与展望总结校园创客空间管理系统的设计与实现成果,并展望未来的研究方向。6.1
内容概要:本文提出了一种基于变分模态分解(VMD)、麻雀搜索算法(SSA)优化与长短期记忆网络(LSTM)相结合的光伏功率预测模型(VMD-SSA-LSTM),旨在提升光伏发电预测的精度与鲁棒性。该方法首先利用VMD对原始非平稳光伏功率序列进行自适应分解,获得一系列具有更稳定特征的本征模态分量(IMFs),有效降低数据复杂性与噪声干扰;随后引入麻雀搜索算法(SSA)对LSTM网络的关键超参数(如学习率、隐层节点数等)进行全局寻优,克服传统试凑法效率低、易陷入局部最优的问题,显著提升模型收敛速度与泛化能力;最后,构建多个LSTM子模型分别预测各模态分量,并将结果重构得到最终的光伏功率预测值。该混合模型充分融合了VMD在信号预处理中的优异分解性能、SSA在参数优化中的高效搜索能力以及LSTM在捕捉时间序列长期依赖关系上的强大建模优势,实现了对复杂气象因素影响下光伏出力波动的高精度拟合与预测。; 适合人群:具备一定电力系统、新能源发电或时间序列预测基础知识,熟悉MATLAB编程环境,从事光伏功率预测、智能电网调度、可再生能源集成、负荷预测等领域研究的科研人员、工程技术人员及高校研究生。; 使用场景及目标:①应用于光伏电站的短期与超短期功率预测,为电网安全调度、电力市场交易、储能系统配置及需求侧响应提供精准数据支撑;②解决传统单一预测模型(如ARIMA、BPNN、单一LSTM)在处理非平稳、强波动性光伏数据时存在的精度不足、稳定性差等问题;③为风电、负荷等其他非平稳时序预测问题提供一种有效的“分解-优化-预测”混合建模范式与技术实现路径。; 阅读建议:建议读者结合文中提供的完整MATLAB代码,深入理解VMD信号分解、SSA优化算法流程及LSTM网络构建的每一个技术环节,通过实际历史数据进行模型复现与对比实验(如与VMD-LSTM、SSA-LSTM等模型比较),掌握参数调优技巧与模型性能评估方法,从而真正掌握该先进混合预测模型的核心思想与应用精髓。
内容概要:本文围绕分布式传感器网络中的LEACH聚类算法展开深入研究,重点评估其在能量消耗方面的性能表现,并通过Matlab代码实现完整的仿真分析。研究聚焦于无线传感器网络能量受限的核心挑战,系统阐述LEACH(Low-Energy Adaptive Clustering Hierarchy)算法的聚类机制、簇头选举策略与数据聚合过程,旨在延长网络生命周期。文中构建了精确的能量消耗模型,详细分析了节点能量耗尽的动态演化过程,通过仿真实验对比不同节点分布、初始能量配置及轮次下的能耗情况,全面揭示了LEACH算法在节能优化方面的有效性与固有局限性,如簇头分布不均导致的“能量空洞”问题。; 适合人群:具备一定无线传感器网络基础知识,熟悉Matlab编程,从事物联网、智能感知或低功耗通信系统研究的科研人员及研究生。; 使用场景及目标:①用于高校课程教学,生动演示LEACH算法的基本原理与能量管理机制;②为优化无线传感器网络的能量效率提供可靠的仿真基础与数据支持;③支撑科研工作中对新型路由协议性能的评估与对比分析需求; 阅读建议:建议读者结合提供的Matlab代码亲自运行仿真程序,细致观察每一轮次中簇头的分布规律与各节点的剩余能量变化,从而深入理解LEACH算法通过“轮流担任簇头”来均衡网络能耗的核心设计思想,并鼓励在此基础上尝试提出改进算法,以解决节点能量耗尽不均的关键问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值